Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*): kongponents alpha [KHCP-9494] #880

Merged
merged 30 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
23c1056
feat(*): upgrade to kongponents alpha [KHCP-9494]
adamdehaven Oct 31, 2023
4bd3bce
feat(copy-uuid): kongponents alpha
adamdehaven Oct 31, 2023
69a5459
fix(error-boundary): deps
adamdehaven Oct 31, 2023
c4272ce
fix(metric-cards): kongponents alpha updates
adamdehaven Oct 31, 2023
be2a25c
fix(analytics-chart): kongponents alpha updates
adamdehaven Oct 31, 2023
8393ce8
fix(spec-renderer): kongponents alpha updates
adamdehaven Nov 1, 2023
6d55bbc
fix(forms): kongponents alpha updates
adamdehaven Nov 1, 2023
915776c
fix: kongponents alpha updates
adamdehaven Nov 1, 2023
cc26eea
Merge branch 'main' into feat/khcp-9494-kongponents-alpha
adamdehaven Nov 1, 2023
78ebc7f
chore: lockfile
adamdehaven Nov 1, 2023
7a0276f
chore: unused code
adamdehaven Nov 1, 2023
07b5cca
chore: dist limits
adamdehaven Nov 1, 2023
ea05255
test(copy-uuid): color assertions
adamdehaven Nov 1, 2023
fe432cc
fix: dropdown prop
adamdehaven Nov 1, 2023
5e7068f
Merge branch 'main' into feat/khcp-9494-kongponents-alpha
adamdehaven Nov 1, 2023
4e58f4a
chore: lockfile
adamdehaven Nov 1, 2023
9820716
chore: bump package
adamdehaven Nov 1, 2023
00ef2c9
fix: layouts
adamdehaven Nov 2, 2023
656d305
chore: bump package
adamdehaven Nov 2, 2023
659b05e
chore: bump package
adamdehaven Nov 2, 2023
38898d9
Merge branch 'main' into feat/khcp-9494-kongponents-alpha
adamdehaven Nov 3, 2023
9761c59
chore: lockfile
adamdehaven Nov 3, 2023
62a89bf
feat(*): upgrade kongponents to v9 [KHCP-9494]
adamdehaven Nov 3, 2023
9246a12
Merge branch 'main' into feat/khcp-9494-kongponents-alpha
adamdehaven Nov 7, 2023
cba2beb
fix: lockfile
adamdehaven Nov 7, 2023
d5e5e87
feat(ktextarea): kongponents alpha fixes
adamdehaven Nov 7, 2023
a9a8839
fix(copy-uuid): alignment
adamdehaven Nov 14, 2023
3c40174
Merge branch 'main' into feat/khcp-9494-kongponents-alpha
adamdehaven Nov 20, 2023
2a1e3fc
fix: lockfile
adamdehaven Nov 20, 2023
4b0ccc4
chore(deps): update package
adamdehaven Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1",
"@evilmartians/lefthook": "^1.5.2",
"@kong/design-tokens": "^1.11.9",
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"@rushstack/eslint-patch": "^1.5.1",
"@types/flat": "^5.0.3",
"@types/js-yaml": "^4.0.6",
Expand Down
9 changes: 5 additions & 4 deletions packages/analytics/analytics-chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
},
"peerDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"vue": "^3.3.4"
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong-ui-public/sandbox-layout": "workspace:^",
"@kong/design-tokens": "^1.11.9",
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"@types/uuid": "^9.0.5",
"vue": "^3.3.4"
},
Expand Down Expand Up @@ -63,6 +63,7 @@
},
"dependencies": {
"@kong-ui-public/analytics-utilities": "workspace:^0.10.1",
"@kong/icons": "^1.7.8",
"approximate-number": "^2.1.1",
"chart.js": "^4.4.0",
"chartjs-adapter-date-fns": "^3.0.0",
Expand All @@ -74,7 +75,7 @@
"vue-chartjs": "^5.2.0"
},
"distSizeChecker": {
"warningLimit": "1.2MB",
"errorLimit": "1.3MB"
"warningLimit": "1.35MB",
"errorLimit": "1.4MB"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<KLabel>Dataset options</KLabel>
<div class="dataset-options">
<KButton
appearance="outline"
appearance="secondary"
size="small"
@click="addDataset()"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@
<KLabel>Dataset options</KLabel>
<div class="dataset-options">
<KButton
appearance="outline"
appearance="secondary"
class="first-button"
size="small"
@click="randomizeData()"
>
Randomize data
</KButton>
<KButton
appearance="outline"
appearance="secondary"
size="small"
@click="addDataset()"
>
Expand Down Expand Up @@ -291,7 +291,6 @@ const exploreResult = computed<AnalyticsExploreV2Result | null>(() => {
const end = Date.now()

const records: AnalyticsExploreRecord[] = []
const totalRequests = 0

const dimensions = [...statusCodeDimensionValues.value]

Expand Down Expand Up @@ -471,16 +470,16 @@ const isTopNTable = computed<boolean>(() => {
return (ChartTypesSimple.TOPN === chartType.value)
})

const onMetricSelected = (item: any) => {
if (!item) {
return
}
// const onMetricSelected = (item: any) => {
// if (!item) {
// return
// }

selectedMetric.value = {
name: item.value,
unit: item.unit,
}
}
// selectedMetric.value = {
// name: item.value,
// unit: item.unit,
// }
// }

watch(multiDimensionToggle, () => {
serviceDimensionValues.value = new Set(Array(5).fill(0).map(() => `Service${rand(1, 100)}`))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
placement="right"
>
<div class="limit-icon-wrapper">
<KIcon
class="warning-icon"
color="currentColor"
hide-title
icon="warning"
:secondary-color="KUI_COLOR_TEXT_WARNING"
size="18"
<WarningIcon
:color="KUI_COLOR_TEXT_WARNING"
decorative
:size="KUI_ICON_SIZE_40"
/>
</div>
<template #content>
Expand Down Expand Up @@ -109,7 +106,8 @@ import { GranularityKeys, msToGranularity } from '@kong-ui-public/analytics-util
import type { AnalyticsExploreResult, AnalyticsExploreV2Result, GranularityFullObj } from '@kong-ui-public/analytics-utilities'
import { datavisPalette, hasMillisecondTimestamps } from '../utils'
import TimeSeriesChart from './chart-types/TimeSeriesChart.vue'
import { KUI_COLOR_TEXT_WARNING } from '@kong/design-tokens'
import { KUI_COLOR_TEXT_WARNING, KUI_ICON_SIZE_40 } from '@kong/design-tokens'
import { WarningIcon } from '@kong/icons'

const props = defineProps({
chartData: {
Expand Down Expand Up @@ -340,7 +338,6 @@ provide('legendPosition', toRef(props, 'legendPosition'))
}

.limit-icon-wrapper {
color: $kui-color-text-inverse;
display: flex;
flex-direction: row;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
>
<div class="tooltip-title">
<span class="title font-bold">{{ tooltipTitle }}</span>
<KIcon
<DragIcon
v-if="locked"
class="drag-icon"
icon="drag"
:color="KUI_COLOR_TEXT_NEUTRAL"
/>
<span
v-if="context"
Expand Down Expand Up @@ -41,6 +41,8 @@

<script setup lang="ts">
import { ref, watch } from 'vue'
import { DragIcon } from '@kong/icons'
import { KUI_COLOR_TEXT_NEUTRAL } from '@kong/design-tokens'

const emit = defineEmits(['dimensions', 'top', 'left'])

Expand Down
5 changes: 3 additions & 2 deletions packages/analytics/analytics-metric-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@
},
"peerDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/kongponents": "^8.126.2"
"@kong/kongponents": "9.0.0-alpha.54"
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^"
"@kong-ui-public/i18n": "workspace:^",
"@kong/kongponents": "9.0.0-alpha.54"
}
}
4 changes: 2 additions & 2 deletions packages/analytics/metric-cards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
"test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
},
"peerDependencies": {
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"vue": "^3.3.4"
},
"devDependencies": {
"@kong/design-tokens": "^1.11.9",
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"vue": "^3.3.4"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
v-if="allCardsHaveErrors"
class="error-display"
>
<KIcon
class="error-display-icon"
icon="warning"
size="24"
/>
<WarningIcon class="error-display-icon" />
<div
v-if="errorMessage"
class="error-display-message"
Expand Down Expand Up @@ -54,6 +50,7 @@ import type { MetricCardDef, MetricCardDisplayValue } from '../types'
import { changePolarity, metricChange, defineIcon, calculateChange } from '../utilities'
import MetricsCard from './display/MetricsCard.vue'
import MetricCardLoadingSkeleton from './display/MetricCardLoadingSkeleton.vue'
import { WarningIcon } from '@kong/icons'

// Import any one of the `@kong/icons` components to access the interface - they are all the same.
// Then alias as `GenericIcon` to provide the icon interface to the prop types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
:label="tooltip"
placement="right"
>
<KIcon
icon="info"
size="12"
<InfoIcon
:color="KUI_COLOR_TEXT_NEUTRAL"
:size="KUI_ICON_SIZE_30"
/>
</KTooltip>
</div>
Expand All @@ -40,11 +40,11 @@
v-if="hasError"
class="metricscard-error"
>
<KIcon
icon="warning"
size="20"
<WarningIcon
:color="KUI_COLOR_TEXT_NEUTRAL"
:size="KUI_ICON_SIZE_40"
/>
<div>{{ errorMessage }}</div>
<div>&nbsp;{{ errorMessage }}</div>
</div>
<!-- Metric value -->
<div
Expand Down Expand Up @@ -103,19 +103,19 @@ import {
KUI_FONT_SIZE_30, // 14px
KUI_FONT_SIZE_100, // 48px
KUI_ICON_SIZE_30,
KUI_ICON_SIZE_40,
KUI_COLOR_TEXT_SUCCESS, // Positive trend
KUI_COLOR_TEXT_NEUTRAL_STRONG, // Neutral trend
KUI_COLOR_TEXT_NEUTRAL,
} from '@kong/design-tokens'
import { MetricCardType } from '../../enums'
import { MetricCardSize } from '../../constants'
import { InfoIcon, WarningIcon, IndeterminateSmallIcon, CloudUploadIcon, EqualIcon, ResponseIcon, VitalsIcon, WarningOutlineIcon } from '@kong/icons'

// Import any one of the `@kong/icons` components to access the interface - they are all the same.
// Then alias as `GenericIcon` to provide the icon interface to the prop types.
import type { KongIcon as GenericIcon } from '@kong/icons'

import { IndeterminateSmallIcon, CloudUploadIcon, EqualIcon, ResponseIcon, VitalsIcon, WarningOutlineIcon } from '@kong/icons'

const iconMap = new Map<MetricCardType, any>([
[MetricCardType.GENERIC_COUNT, VitalsIcon],
[MetricCardType.TRAFFIC, CloudUploadIcon],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/app-layout/docs/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ A Kong UI dynamic sidebar component.
- `vue` and `vue-router` must be initialized in the host application
- `@kong/kongponents` must be available as a `dependency` in the host application, along with the package's style imports. [See here for instructions on installing Kongponents](https://kongponents.konghq.com/#globally-install-all-kongponents). Specifically, the following Kongponents must be available:
- `KDropdownItem`
- `KDropdownMenu`
- `KDropdown`
- `KIcon`
- `KTooltip`
- The sidebar is set to `position: fixed` and is expected to render at 100% of the viewport height. This means your Navbar, etc. should never be placed above the sidebar unless on mobile.
Expand Down
7 changes: 4 additions & 3 deletions packages/core/app-layout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong-ui-public/app-layout",
"version": "0.24.10",
"version": "1.0.0",
"type": "module",
"main": "./dist/app-layout.umd.js",
"module": "./dist/app-layout.es.js",
Expand Down Expand Up @@ -38,18 +38,19 @@
"test:unit:open": "cross-env FORCE_COLOR=1 vitest --ui"
},
"peerDependencies": {
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"vue": "^3.3.4",
"vue-router": "^4.2.5"
},
"dependencies": {
"@kong/icons": "^1.7.8",
"focus-trap": "^7.5.3",
"focus-trap-vue": "^4.0.2",
"lodash.clonedeep": "^4.5.0"
},
"devDependencies": {
"@kong/design-tokens": "^1.11.9",
"@kong/kongponents": "^8.126.2",
"@kong/kongponents": "9.0.0-alpha.54",
"@types/lodash.clonedeep": "^4.5.7",
"vue": "^3.3.4",
"vue-router": "^4.2.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
Docs / Support
</a>
</div>
<KDropdownMenu
button-appearance="btn-link"
<KDropdown
appearance="tertiary"
class="admin-menu"
:items="[
{ label: 'AppLayout', to: '/' },
Expand Down Expand Up @@ -321,7 +321,7 @@ const sidebarItemsTop = computed((): SidebarPrimaryItem[] => {
--KButtonLink: #fff;

// Ensure button is aligned center
:deep(.k-dropdown-trigger) {
:deep(.dropdown-trigger) {
> div {
align-items: center;
display: flex;
Expand Down
26 changes: 9 additions & 17 deletions packages/core/app-layout/sandbox/pages/PageHeaderPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
label-position="left"
/>
<KButton
appearance="creation"
appearance="primary"
icon="plus"
>
Do Things
Expand All @@ -60,18 +60,11 @@
title="About this Cat"
>
<template #actions>
<KButton
appearance="btn-link"
class="about-action-button"
>
<template #icon>
<KIcon
color="#0044f4"
icon="pencil"
size="16"
/>
</template>
</KButton>
<EditIcon
color="#0044f4"
role="button"
:size="20"
/>
</template>

<div>
Expand Down Expand Up @@ -115,7 +108,7 @@
This cat has a habit of sleeping in uncomfortable looking positions.
</div>
<div>
<KButton appearance="btn-link">
<KButton appearance="tertiary">
<template #icon>
🍔
</template>
Expand All @@ -135,6 +128,7 @@
import { computed, ref } from 'vue'
import type { Method } from '@kong/kongponents'
import { AppAboutSection, AppPageHeader } from '../../src'
import { EditIcon } from '@kong/icons'

const breadcrumbs = computed(() => {
return [
Expand Down Expand Up @@ -178,8 +172,6 @@ const enabled = ref(false)

.about-action-button {
display: flex;
min-height: unset !important;
height: 16px !important;
}

.badge-label {
Expand All @@ -189,9 +181,9 @@ const enabled = ref(false)
}

.method-badges {
column-gap: 4px;
display: flex;
flex-wrap: wrap;
column-gap: 4px;
row-gap: 8px;
}
</style>
Loading
Loading