@pgcorp/ui-kit 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -8
- package/docs/accessibility.md +12 -0
- package/docs/getting-started.md +32 -2
- package/docs/public-api.md +19 -2
- package/docs/theming.md +16 -0
- package/package.json +18 -3
- package/src/components/shared/codeLanguages.ts +2 -107
- package/src/components/shared/containers/SPanel.css +32 -1
- package/src/components/shared/containers/SPanel.vue +4 -0
- package/src/components/shared/controls/SCheckbox.vue +2 -2
- package/src/components/shared/controls/SInteractiveSurface.css +4 -0
- package/src/components/shared/controls/SInteractiveSurface.vue +1 -1
- package/src/components/shared/controls/SListbox.vue +4 -4
- package/src/components/shared/controls/SSwitch.vue +2 -2
- package/src/components/shared/data-display/SChart.css +149 -0
- package/src/components/shared/data-display/SChart.vue +493 -0
- package/src/components/shared/data-display/SChip.css +19 -0
- package/src/components/shared/data-display/SChip.vue +30 -6
- package/src/components/shared/data-display/SCodeBlock.css +68 -0
- package/src/components/shared/data-display/SCodeBlock.vue +102 -16
- package/src/components/shared/data-display/SMetricCard.css +1 -0
- package/src/components/shared/data-display/SMetricCard.vue +1 -0
- package/src/components/shared/data-display/STable.vue +120 -145
- package/src/components/shared/data-display/chart.ts +54 -0
- package/src/components/shared/navigation/STabList.vue +0 -3
- package/src/internal/chartGeometry.ts +748 -0
- package/src/internal/codeLanguageIdentity.ts +89 -0
- package/src/internal/lazyCodeEditor.ts +1 -0
- package/src/internal/linkTarget.ts +1 -3
- package/src/internal/ownedAttrs.ts +1 -0
- package/src/internal/useBinaryInput.ts +9 -2
- package/src/styles/tailwind.css +3 -0
- package/src/styles/tokens.css +33 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Поддерживаемые семейства графиков. / Supported chart families. */
|
|
2
|
+
export type SChartType = 'line' | 'area' | 'bar' | 'pie' | 'donut'
|
|
3
|
+
|
|
4
|
+
/** Семантическая categorical palette без raw CSS values. / Semantic categorical palette without raw CSS values. */
|
|
5
|
+
export type SChartTone =
|
|
6
|
+
| 'series-1'
|
|
7
|
+
| 'series-2'
|
|
8
|
+
| 'series-3'
|
|
9
|
+
| 'series-4'
|
|
10
|
+
| 'series-5'
|
|
11
|
+
| 'series-6'
|
|
12
|
+
| 'series-7'
|
|
13
|
+
| 'series-8'
|
|
14
|
+
| 'success'
|
|
15
|
+
| 'warn'
|
|
16
|
+
| 'danger'
|
|
17
|
+
|
|
18
|
+
/** Одна общая категория Cartesian axis либо radial slice. / One shared Cartesian category or radial slice. */
|
|
19
|
+
export interface SChartCategory {
|
|
20
|
+
readonly key: string
|
|
21
|
+
readonly label: string
|
|
22
|
+
/** Используется slice-ом pie/donut; Cartesian series владеет собственным tone. / Used by pie/donut slices; Cartesian series owns its tone. */
|
|
23
|
+
readonly tone?: SChartTone
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Один data series; values позиционно соответствуют categories. / One data series; values correspond positionally to categories. */
|
|
27
|
+
export interface SChartSeries {
|
|
28
|
+
readonly key: string
|
|
29
|
+
readonly label: string
|
|
30
|
+
readonly values: readonly number[]
|
|
31
|
+
readonly tone?: SChartTone
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Accessible-name contract графика. / Chart accessible-name contract. */
|
|
35
|
+
export type SChartAccessibility =
|
|
36
|
+
| { readonly mode: 'decorative' }
|
|
37
|
+
| { readonly mode: 'label'; readonly label: string; readonly description?: string }
|
|
38
|
+
| { readonly mode: 'labelledby'; readonly id: string; readonly describedby?: string }
|
|
39
|
+
|
|
40
|
+
/** Домен шкалы без неявных min/max fallbacks. / Scale domain without implicit min/max fallbacks. */
|
|
41
|
+
export type SChartDomain =
|
|
42
|
+
| { readonly mode: 'auto'; readonly includeZero?: boolean }
|
|
43
|
+
| { readonly mode: 'fixed'; readonly minimum: number; readonly maximum: number }
|
|
44
|
+
|
|
45
|
+
export type SChartSize = 'compact' | 'sm' | 'md' | 'lg'
|
|
46
|
+
export type SChartGrid = 'none' | 'horizontal' | 'vertical' | 'both'
|
|
47
|
+
export type SChartLegend = 'none' | 'top' | 'bottom'
|
|
48
|
+
export type SChartDataLabels = 'none' | 'latest' | 'all'
|
|
49
|
+
export type SChartMarkers = 'none' | 'latest' | 'all'
|
|
50
|
+
export type SChartXLabels = 'none' | 'endpoints' | 'auto' | 'all'
|
|
51
|
+
export type SChartCurve = 'linear' | 'smooth'
|
|
52
|
+
export type SChartBarMode = 'grouped' | 'stacked'
|
|
53
|
+
export type SChartRadialLabel = 'value' | 'percentage' | 'category'
|
|
54
|
+
export type SChartDataTablePresentation = 'assistive' | 'visible' | 'none'
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
>
|
|
15
15
|
<div class="s-tabs-header__content" :style="{ paddingRight: controlsPadding }">
|
|
16
16
|
<div
|
|
17
|
-
ref="tabListWrapperRef"
|
|
18
17
|
class="s-tab-list-wrapper"
|
|
19
18
|
:class="scrollClasses"
|
|
20
19
|
@wheel.passive="onWheelTabList"
|
|
@@ -57,7 +56,6 @@
|
|
|
57
56
|
<div
|
|
58
57
|
v-else
|
|
59
58
|
v-bind="ownedAttrs.bindings()"
|
|
60
|
-
ref="tabListWrapperRef"
|
|
61
59
|
class="s-tab-list-wrapper"
|
|
62
60
|
:data-placement="placement"
|
|
63
61
|
:data-inset="inset"
|
|
@@ -189,7 +187,6 @@ const ctx = maybeCtx
|
|
|
189
187
|
|
|
190
188
|
const controlsRef = ref<HTMLElement | null>(null)
|
|
191
189
|
const controlsWidth = ref(0)
|
|
192
|
-
const tabListWrapperRef = ref<HTMLElement | null>(null)
|
|
193
190
|
const tabListRef = ref<HTMLElement | null>(null)
|
|
194
191
|
const isScrollable = ref(false)
|
|
195
192
|
const isScrolledToStart = ref(true)
|