@pgcorp/ui-kit 0.5.0 → 0.7.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.
Files changed (56) hide show
  1. package/README.md +39 -0
  2. package/docs/public-api.md +6 -0
  3. package/package.json +5 -1
  4. package/src/components/shared/_internal/SHeaderSurface.css +98 -0
  5. package/src/components/shared/_internal/SHeaderSurface.vue +80 -0
  6. package/src/components/shared/_internal/SToastItem.css +8 -8
  7. package/src/components/shared/_internal/SToastItem.vue +8 -1
  8. package/src/components/shared/_internal/useRadioGroup.ts +106 -0
  9. package/src/components/shared/containers/SPageHeader.vue +13 -20
  10. package/src/components/shared/controls/SButton.css +6 -6
  11. package/src/components/shared/controls/SButton.vue +9 -1
  12. package/src/components/shared/controls/SCheckbox.vue +14 -43
  13. package/src/components/shared/controls/SChoiceCards.vue +16 -39
  14. package/src/components/shared/controls/SField.css +0 -12
  15. package/src/components/shared/controls/SField.vue +14 -10
  16. package/src/components/shared/controls/SFieldGroup.css +1 -19
  17. package/src/components/shared/controls/SFieldGroup.vue +13 -10
  18. package/src/components/shared/controls/SFieldLabel.css +0 -1
  19. package/src/components/shared/controls/SFieldLabel.vue +2 -1
  20. package/src/components/shared/controls/SInteractiveSurface.css +3 -3
  21. package/src/components/shared/controls/SInteractiveSurface.vue +9 -2
  22. package/src/components/shared/controls/SMarker.css +16 -16
  23. package/src/components/shared/controls/SMarker.vue +27 -1
  24. package/src/components/shared/controls/SSegmentedControl.vue +15 -43
  25. package/src/components/shared/controls/SSwitch.vue +14 -32
  26. package/src/components/shared/data-display/SActionListItem.css +2 -2
  27. package/src/components/shared/data-display/SActionListItem.vue +8 -1
  28. package/src/components/shared/data-display/SBadge.vue +41 -18
  29. package/src/components/shared/data-display/SChip.vue +22 -10
  30. package/src/components/shared/data-display/SMessage.css +8 -8
  31. package/src/components/shared/data-display/SMessage.vue +8 -1
  32. package/src/components/shared/data-display/SProgressBar.css +12 -12
  33. package/src/components/shared/data-display/SProgressBar.vue +12 -6
  34. package/src/components/shared/data-display/SProgressIndicator.css +5 -5
  35. package/src/components/shared/data-display/SProgressIndicator.vue +9 -1
  36. package/src/components/shared/data-display/SSectionHeader.vue +17 -21
  37. package/src/components/shared/data-display/SStatus.css +10 -10
  38. package/src/components/shared/data-display/SStatus.vue +9 -1
  39. package/src/components/shared/data-display/STable.vue +27 -4
  40. package/src/components/shared/data-display/STooltip.css +4 -4
  41. package/src/components/shared/data-display/STooltip.vue +159 -29
  42. package/src/components/shared/data-display/STooltipTarget.css +26 -0
  43. package/src/components/shared/data-display/STooltipTarget.vue +94 -0
  44. package/src/components/shared/database/SDataGrid.vue +13 -0
  45. package/src/components/shared/navigation/STabs.vue +11 -3
  46. package/src/internal/fieldPresentation.ts +28 -0
  47. package/src/internal/ownedAttrs.ts +3 -0
  48. package/src/internal/pillSurface.ts +93 -0
  49. package/src/internal/semanticTone.ts +23 -0
  50. package/src/internal/useBinaryInput.ts +76 -0
  51. package/src/styles/style.css +114 -0
  52. package/src/styles/tokens.css +31 -0
  53. package/src/components/shared/containers/SPageHeader.css +0 -82
  54. package/src/components/shared/data-display/SBadge.css +0 -73
  55. package/src/components/shared/data-display/SChip.css +0 -59
  56. package/src/components/shared/data-display/SSectionHeader.css +0 -84
@@ -0,0 +1,93 @@
1
+ import {
2
+ validateBoolean,
3
+ validateExactString,
4
+ } from './runtimeContract'
5
+ import { resolveSemanticToneBinding } from './semanticTone'
6
+
7
+ const PILL_KINDS = ['badge', 'chip'] as const
8
+ const PILL_SEVERITIES = [
9
+ 'primary',
10
+ 'secondary',
11
+ 'success',
12
+ 'info',
13
+ 'warn',
14
+ 'danger',
15
+ 'contrast',
16
+ ] as const
17
+ const PILL_SIZES = ['xs', 'sm', 'md'] as const
18
+ const PILL_MAX_WIDTHS = ['none', 'sm', 'md'] as const
19
+ const PILL_ICON_MOTIONS = ['static', 'spin'] as const
20
+
21
+ export type PillSurfaceKind = typeof PILL_KINDS[number]
22
+ export type PillSurfaceSeverity = typeof PILL_SEVERITIES[number]
23
+ export type PillSurfaceSize = typeof PILL_SIZES[number]
24
+ export type PillSurfaceMaxWidth = typeof PILL_MAX_WIDTHS[number]
25
+ export type PillSurfaceIconMotion = typeof PILL_ICON_MOTIONS[number]
26
+
27
+ export const PILL_ICON_CLASS = 's-pill-icon inline-flex h-[var(--s-pill-icon-size)] w-[var(--s-pill-icon-size)] shrink-0 items-center justify-center'
28
+ export const PILL_ICON_GRAPHIC_CLASS = 's-pill-icon-graphic h-full w-full'
29
+ export const PILL_ICON_SPIN_CLASS = 'animate-spin'
30
+ export const PILL_LABEL_CLASS = 's-pill-label min-w-0'
31
+ export const PILL_LABEL_TRUNCATE_CLASS = 'overflow-hidden text-ellipsis whitespace-nowrap'
32
+
33
+ export interface PillSurfaceContract {
34
+ kind: PillSurfaceKind
35
+ severity: PillSurfaceSeverity
36
+ size: PillSurfaceSize
37
+ dot: boolean
38
+ closable: boolean
39
+ disabled: boolean
40
+ truncate: boolean
41
+ maxWidth: PillSurfaceMaxWidth
42
+ iconMotion: PillSurfaceIconMotion
43
+ }
44
+
45
+ export interface PillSurfaceBindings {
46
+ 'data-s-pill-surface': PillSurfaceKind
47
+ 'data-s-tone': PillSurfaceSeverity
48
+ 'data-s-pill-size': PillSurfaceSize
49
+ 'data-s-pill-dot'?: 'true'
50
+ 'data-s-pill-closable'?: 'true'
51
+ 'data-s-pill-disabled'?: 'true'
52
+ 'data-s-pill-truncate'?: 'true'
53
+ 'data-s-pill-max-width'?: Exclude<PillSurfaceMaxWidth, 'none'>
54
+ 'data-s-pill-icon-motion'?: Exclude<PillSurfaceIconMotion, 'static'>
55
+ }
56
+
57
+ /**
58
+ * Создаёт exact bindings единого pill/feedback presentation owner.
59
+ * Creates exact bindings for the canonical pill/feedback presentation owner.
60
+ */
61
+ export function resolvePillSurfaceBindings(
62
+ owner: 'SBadge' | 'SChip',
63
+ contract: PillSurfaceContract,
64
+ ): PillSurfaceBindings {
65
+ const kind = validateExactString(owner, 'pill kind', contract.kind, PILL_KINDS)
66
+ const toneBinding = resolveSemanticToneBinding(owner, 'severity', contract.severity, PILL_SEVERITIES)
67
+ const size = validateExactString(owner, 'size', contract.size, PILL_SIZES)
68
+ const maxWidth = validateExactString(owner, 'maxWidth', contract.maxWidth, PILL_MAX_WIDTHS)
69
+ const iconMotion = validateExactString(owner, 'iconMotion', contract.iconMotion, PILL_ICON_MOTIONS)
70
+ const dot = validateBoolean(owner, 'dot', contract.dot)
71
+ const closable = validateBoolean(owner, 'closable', contract.closable)
72
+ const disabled = validateBoolean(owner, 'disabled', contract.disabled)
73
+ const truncate = validateBoolean(owner, 'truncate', contract.truncate)
74
+
75
+ if (kind === 'chip' && dot) {
76
+ throw new TypeError('SChip: dot presentation не поддерживается. / SChip: dot presentation is not supported.')
77
+ }
78
+ if (kind === 'badge' && closable) {
79
+ throw new TypeError('SBadge: closable presentation не поддерживается. / SBadge: closable presentation is not supported.')
80
+ }
81
+
82
+ return {
83
+ 'data-s-pill-surface': kind,
84
+ ...toneBinding,
85
+ 'data-s-pill-size': size,
86
+ ...(dot ? { 'data-s-pill-dot': 'true' as const } : {}),
87
+ ...(closable ? { 'data-s-pill-closable': 'true' as const } : {}),
88
+ ...(disabled ? { 'data-s-pill-disabled': 'true' as const } : {}),
89
+ ...(truncate ? { 'data-s-pill-truncate': 'true' as const } : {}),
90
+ ...(maxWidth === 'none' ? {} : { 'data-s-pill-max-width': maxWidth }),
91
+ ...(iconMotion === 'static' ? {} : { 'data-s-pill-icon-motion': iconMotion }),
92
+ }
93
+ }
@@ -0,0 +1,23 @@
1
+ import { validateExactString } from './runtimeContract'
2
+
3
+ /** Единственный internal DOM marker для component-owned visual tone. */
4
+ export const SEMANTIC_TONE_ATTRIBUTE = 'data-s-tone' as const
5
+
6
+ export type SemanticToneBinding<Tone extends string> = Readonly<{
7
+ 'data-s-tone': Tone
8
+ }>
9
+
10
+ /**
11
+ * Проверяет component-specific tone vocabulary и создаёт единый namespaced DOM binding.
12
+ * Validates a component-specific tone vocabulary and creates the canonical namespaced DOM binding.
13
+ */
14
+ export function resolveSemanticToneBinding<const Tones extends readonly string[]>(
15
+ owner: string,
16
+ coordinate: string,
17
+ value: unknown,
18
+ tones: Tones,
19
+ ): SemanticToneBinding<Tones[number]> {
20
+ return {
21
+ [SEMANTIC_TONE_ATTRIBUTE]: validateExactString(owner, coordinate, value, tones),
22
+ }
23
+ }
@@ -0,0 +1,76 @@
1
+ import { computed, onMounted, ref, useId, watch } from 'vue'
2
+
3
+ import { resolveOptionalDomId } from './runtimeContract'
4
+
5
+ export type BinaryInputOwner = 'SCheckbox' | 'SSwitch'
6
+
7
+ export interface BinaryInputModelContract {
8
+ readonly modelValue: boolean
9
+ readonly readonly: boolean
10
+ readonly id?: string
11
+ }
12
+
13
+ export interface BinaryInputOptions {
14
+ readonly owner: BinaryInputOwner
15
+ readonly inputName: 'checkbox' | 'switch'
16
+ readonly props: BinaryInputModelContract
17
+ readonly indeterminate?: () => boolean
18
+ readonly emitUpdate: (value: boolean) => void
19
+ readonly emitClick: (event: MouseEvent) => void
20
+ }
21
+
22
+ /**
23
+ * Единый runtime owner controlled binary input: identity, value, readonly и native events.
24
+ * Canonical runtime owner for controlled binary input identity, value, readonly, and native events.
25
+ */
26
+ export function useBinaryInput(options: BinaryInputOptions) {
27
+ const generatedInputId = useId()
28
+ const inputId = computed(() => resolveOptionalDomId(
29
+ options.owner,
30
+ 'id',
31
+ options.props.id,
32
+ `s-${options.inputName}-${generatedInputId}`,
33
+ ))
34
+ const inputEl = ref<HTMLInputElement | null>(null)
35
+ const checkedValue = computed(() => {
36
+ if (typeof options.props.modelValue !== 'boolean') {
37
+ throw new TypeError(`${options.owner}: modelValue must be boolean`)
38
+ }
39
+ return options.props.modelValue
40
+ })
41
+
42
+ const applyIndeterminate = (): void => {
43
+ if (inputEl.value) {
44
+ inputEl.value.indeterminate = (options.indeterminate?.() ?? false) && !checkedValue.value
45
+ }
46
+ }
47
+ onMounted(applyIndeterminate)
48
+ watch([options.indeterminate ?? (() => false), checkedValue], applyIndeterminate)
49
+
50
+ const onChange = (event: Event): void => {
51
+ if (options.props.readonly) return
52
+ const target = event.currentTarget
53
+ if (!(target instanceof HTMLInputElement)) {
54
+ throw new TypeError(
55
+ `${options.owner}: change event owner must be the native ${options.inputName} input`,
56
+ )
57
+ }
58
+ options.emitUpdate(target.checked)
59
+ }
60
+
61
+ const onClick = (event: MouseEvent): void => {
62
+ if (options.props.readonly) {
63
+ event.preventDefault()
64
+ return
65
+ }
66
+ options.emitClick(event)
67
+ }
68
+
69
+ return {
70
+ checkedValue,
71
+ inputEl,
72
+ inputId,
73
+ onChange,
74
+ onClick,
75
+ } as const
76
+ }
@@ -26,6 +26,120 @@ body {
26
26
  }
27
27
 
28
28
  @layer components {
29
+ :where([data-s-tone="primary"]) {
30
+ --s-feedback-tone-background: var(--s-feedback-primary-background);
31
+ --s-feedback-tone-foreground: var(--s-feedback-primary-foreground);
32
+ }
33
+
34
+ :where([data-s-tone="secondary"]) {
35
+ --s-feedback-tone-background: var(--s-feedback-secondary-background);
36
+ --s-feedback-tone-foreground: var(--s-feedback-secondary-foreground);
37
+ }
38
+
39
+ :where([data-s-tone="success"]) {
40
+ --s-feedback-tone-background: var(--s-feedback-success-background);
41
+ --s-feedback-tone-foreground: var(--s-feedback-success-foreground);
42
+ }
43
+
44
+ :where([data-s-tone="info"]) {
45
+ --s-feedback-tone-background: var(--s-feedback-info-background);
46
+ --s-feedback-tone-foreground: var(--s-feedback-info-foreground);
47
+ }
48
+
49
+ :where([data-s-tone="warn"]) {
50
+ --s-feedback-tone-background: var(--s-feedback-warn-background);
51
+ --s-feedback-tone-foreground: var(--s-feedback-warn-foreground);
52
+ }
53
+
54
+ :where([data-s-tone="danger"]) {
55
+ --s-feedback-tone-background: var(--s-feedback-danger-background);
56
+ --s-feedback-tone-foreground: var(--s-feedback-danger-foreground);
57
+ }
58
+
59
+ :where([data-s-tone="contrast"]) {
60
+ --s-feedback-tone-background: var(--s-feedback-contrast-background);
61
+ --s-feedback-tone-foreground: var(--s-feedback-contrast-foreground);
62
+ }
63
+
64
+ :where([data-s-pill-surface]) {
65
+ display: inline-flex;
66
+ min-width: 0;
67
+ align-items: center;
68
+ border-radius: var(--s-feedback-pill-radius);
69
+ background-color: var(--s-feedback-tone-background);
70
+ color: var(--s-feedback-tone-foreground);
71
+ }
72
+
73
+ :where([data-s-pill-surface="badge"]) {
74
+ --s-pill-icon-size: 0.75rem;
75
+ gap: 0.25rem;
76
+ font-weight: 600;
77
+ }
78
+
79
+ :where([data-s-pill-surface="chip"]) {
80
+ --s-pill-icon-size: 0.875rem;
81
+ font-weight: 500;
82
+ }
83
+
84
+ :where([data-s-pill-surface="badge"][data-s-pill-size="md"]) {
85
+ padding: 0.125rem 0.625rem;
86
+ font-size: 0.75rem;
87
+ line-height: 1rem;
88
+ }
89
+
90
+ :where([data-s-pill-surface="badge"][data-s-pill-size="sm"]) {
91
+ padding: 0.125rem 0.5rem;
92
+ font-size: 0.6875rem;
93
+ line-height: 1rem;
94
+ }
95
+
96
+ :where([data-s-pill-surface="badge"][data-s-pill-size="xs"]) {
97
+ padding: 0 0.375rem;
98
+ font-size: 0.625rem;
99
+ line-height: 1rem;
100
+ }
101
+
102
+ :where([data-s-pill-surface="chip"][data-s-pill-size="md"]) {
103
+ min-height: 1.75rem;
104
+ gap: 0.375rem;
105
+ padding-inline: 0.625rem;
106
+ font-size: 0.75rem;
107
+ }
108
+
109
+ :where([data-s-pill-surface="chip"][data-s-pill-size="sm"]) {
110
+ min-height: 1.5rem;
111
+ gap: 0.25rem;
112
+ padding-inline: 0.5rem;
113
+ font-size: 0.6875rem;
114
+ line-height: 1rem;
115
+ }
116
+
117
+ :where([data-s-pill-surface="chip"][data-s-pill-size="md"][data-s-pill-closable="true"]) {
118
+ padding-right: 0.25rem;
119
+ }
120
+
121
+ :where([data-s-pill-surface="chip"][data-s-pill-size="sm"][data-s-pill-closable="true"]) {
122
+ padding-right: 0.125rem;
123
+ }
124
+
125
+ :where([data-s-pill-surface][data-s-pill-disabled="true"]) {
126
+ opacity: 0.6;
127
+ }
128
+
129
+ :where([data-s-pill-surface][data-s-pill-dot="true"]) {
130
+ width: 0.625rem;
131
+ height: 0.625rem;
132
+ padding: 0;
133
+ }
134
+
135
+ :where([data-s-pill-surface][data-s-pill-max-width="sm"]) {
136
+ max-width: 9.5rem;
137
+ }
138
+
139
+ :where([data-s-pill-surface][data-s-pill-max-width="md"]) {
140
+ max-width: 14rem;
141
+ }
142
+
29
143
  :where([data-s-field-surface]) {
30
144
  transition-property: color, background-color, border-color, box-shadow;
31
145
  transition-duration: var(--s-motion-standard);
@@ -231,6 +231,7 @@
231
231
  /* Semantic feedback surfaces */
232
232
  --s-feedback-surface: color-mix(in srgb, var(--color-surface) 88%, transparent);
233
233
  --s-feedback-backdrop-blur: 1.5rem;
234
+ --s-feedback-pill-radius: var(--s-radius-pill);
234
235
  --s-floating-surface: var(--color-surface);
235
236
  --s-floating-foreground: var(--color-text);
236
237
  --s-floating-outline: color-mix(in srgb, var(--color-border) 44%, transparent);
@@ -607,6 +608,21 @@
607
608
  --s-progress-indicator-foreground-warn: var(--color-warn-600);
608
609
  --s-progress-indicator-foreground-danger: var(--color-danger-600);
609
610
 
611
+ --s-feedback-primary-background: var(--color-primary-100);
612
+ --s-feedback-primary-foreground: var(--color-primary-800);
613
+ --s-feedback-secondary-background: var(--color-surface-100);
614
+ --s-feedback-secondary-foreground: var(--color-surface-800);
615
+ --s-feedback-success-background: var(--color-success-100);
616
+ --s-feedback-success-foreground: var(--color-success-800);
617
+ --s-feedback-info-background: var(--color-info-100);
618
+ --s-feedback-info-foreground: var(--color-info-800);
619
+ --s-feedback-warn-background: var(--color-warn-100);
620
+ --s-feedback-warn-foreground: var(--color-warn-800);
621
+ --s-feedback-danger-background: var(--color-danger-100);
622
+ --s-feedback-danger-foreground: var(--color-danger-800);
623
+ --s-feedback-contrast-background: var(--color-surface-800);
624
+ --s-feedback-contrast-foreground: var(--color-surface-100);
625
+
610
626
  --s-graph-node-tone-neutral-fill: var(--color-surface-50);
611
627
  --s-graph-node-tone-neutral-border: var(--color-surface-500);
612
628
  --s-graph-node-tone-neutral-label: var(--color-surface-900);
@@ -742,6 +758,21 @@
742
758
  --s-progress-indicator-foreground-warn: var(--color-warn-300);
743
759
  --s-progress-indicator-foreground-danger: var(--color-danger-300);
744
760
 
761
+ --s-feedback-primary-background: var(--color-primary-950);
762
+ --s-feedback-primary-foreground: var(--color-primary-50);
763
+ --s-feedback-secondary-background: var(--color-surface-800);
764
+ --s-feedback-secondary-foreground: var(--color-surface-50);
765
+ --s-feedback-success-background: var(--color-success-950);
766
+ --s-feedback-success-foreground: var(--color-success-50);
767
+ --s-feedback-info-background: var(--color-info-950);
768
+ --s-feedback-info-foreground: var(--color-info-50);
769
+ --s-feedback-warn-background: var(--color-warn-950);
770
+ --s-feedback-warn-foreground: var(--color-warn-50);
771
+ --s-feedback-danger-background: var(--color-danger-950);
772
+ --s-feedback-danger-foreground: var(--color-danger-50);
773
+ --s-feedback-contrast-background: var(--color-surface-200);
774
+ --s-feedback-contrast-foreground: var(--color-surface-800);
775
+
745
776
  --s-graph-node-tone-neutral-fill: var(--color-surface-700);
746
777
  --s-graph-node-tone-neutral-border: var(--color-surface-300);
747
778
  --s-graph-node-tone-neutral-label: var(--color-surface-50);
@@ -1,82 +0,0 @@
1
- @reference "../../../styles/reference.css";
2
-
3
- .s-page-header {
4
- @apply flex min-w-0 items-start justify-between gap-4 border border-surface-200 bg-surface-0 p-5 shadow-sm;
5
- @apply dark:border-surface-700 dark:bg-surface-900;
6
- border-radius: var(--radius-sm);
7
- }
8
-
9
- .s-page-header[data-appearance='plain'] {
10
- @apply border-x-0 border-t-0 bg-transparent px-0 pt-0 shadow-none dark:bg-transparent;
11
- border-radius: 0;
12
- }
13
-
14
- .s-page-header[data-size='compact'] {
15
- @apply p-4;
16
- }
17
-
18
- .s-page-header[data-appearance='plain'][data-size='compact'] {
19
- @apply px-0 pt-0;
20
- }
21
-
22
- .s-page-header[data-appearance='bare'] {
23
- @apply border-0 bg-transparent p-0 shadow-none dark:bg-transparent;
24
- border-radius: 0;
25
- }
26
-
27
- .s-page-header__copy {
28
- @apply min-w-0;
29
- }
30
-
31
- .s-page-header__eyebrow {
32
- @apply text-xs font-medium uppercase text-surface-500 dark:text-surface-400;
33
- }
34
-
35
- .s-page-header__title {
36
- @apply m-0 text-2xl font-semibold leading-tight text-surface-900 dark:text-surface-50;
37
- }
38
-
39
- .s-page-header__title[data-presentation='assistive'] {
40
- position: absolute;
41
- width: 1px;
42
- height: 1px;
43
- padding: 0;
44
- margin: -1px;
45
- clip-path: inset(50%);
46
- white-space: nowrap;
47
- border: 0;
48
- }
49
-
50
- .s-page-header[data-size='compact'] .s-page-header__title {
51
- @apply text-xl;
52
- }
53
-
54
- .s-page-header__eyebrow + .s-page-header__title {
55
- @apply mt-1;
56
- }
57
-
58
- .s-page-header__description {
59
- @apply mt-2 max-w-4xl text-sm text-surface-500 dark:text-surface-400;
60
- }
61
-
62
- .s-page-header__actions {
63
- @apply flex shrink-0 flex-wrap items-center justify-end gap-2;
64
- }
65
-
66
- .s-page-header[data-actions-layout='stacked'] {
67
- @apply flex-col;
68
- }
69
-
70
- .s-page-header[data-actions-layout='stacked'] .s-page-header__actions {
71
- @apply w-full justify-start;
72
- }
73
-
74
- @media (max-width: 639px) {
75
- .s-page-header[data-actions-layout='responsive'] {
76
- @apply flex-col;
77
- }
78
-
79
- .s-page-header[data-actions-layout='responsive'] .s-page-header__actions {
80
- @apply w-full justify-start;
81
- }
82
- }
@@ -1,73 +0,0 @@
1
- @reference "../../../styles/reference.css";
2
-
3
- .s-badge {
4
- @apply inline-flex items-center gap-1 rounded-full font-semibold;
5
- }
6
-
7
- .s-badge[data-size='md'] {
8
- @apply px-2.5 py-0.5 text-xs;
9
- }
10
-
11
- .s-badge[data-size='sm'] {
12
- @apply px-2 py-0.5 text-[11px] leading-4;
13
- }
14
-
15
- .s-badge[data-size='xs'] {
16
- @apply px-1.5 py-0 text-[10px] leading-4;
17
- }
18
-
19
- .s-badge__icon {
20
- @apply inline-flex h-3 w-3 shrink-0 items-center justify-center;
21
- }
22
-
23
- .s-badge__icon-graphic {
24
- @apply h-full w-full;
25
- }
26
-
27
- .s-badge[data-icon-motion='spin'] .s-badge__icon-graphic {
28
- @apply animate-spin;
29
- }
30
-
31
- .s-badge__label {
32
- @apply min-w-0;
33
- }
34
-
35
- .s-badge[data-max-width='sm'] {
36
- max-width: 9.5rem;
37
- }
38
-
39
- .s-badge[data-max-width='md'] {
40
- max-width: 14rem;
41
- }
42
-
43
- .s-badge[data-truncate='true'] .s-badge__label {
44
- @apply overflow-hidden text-ellipsis whitespace-nowrap;
45
- }
46
-
47
- /* Severity Colors */
48
- .s-badge[data-severity='primary'] {
49
- @apply bg-primary-100 text-primary-800 dark:bg-primary-950 dark:text-primary-50;
50
- }
51
- .s-badge[data-severity='secondary'] {
52
- @apply bg-surface-100 text-surface-800 dark:bg-surface-800 dark:text-surface-50;
53
- }
54
- .s-badge[data-severity='success'] {
55
- @apply bg-success-100 text-success-800 dark:bg-success-950 dark:text-success-50;
56
- }
57
- .s-badge[data-severity='info'] {
58
- @apply bg-info-100 text-info-800 dark:bg-info-950 dark:text-info-50;
59
- }
60
- .s-badge[data-severity='warn'] {
61
- @apply bg-warn-100 text-warn-800 dark:bg-warn-950 dark:text-warn-50;
62
- }
63
- .s-badge[data-severity='danger'] {
64
- @apply bg-danger-100 text-danger-800 dark:bg-danger-950 dark:text-danger-50;
65
- }
66
- .s-badge[data-severity='contrast'] {
67
- @apply bg-surface-800 text-surface-100 dark:bg-surface-200 dark:text-surface-800;
68
- }
69
-
70
- /* Dot Mode */
71
- .s-badge.s-badge--dot {
72
- @apply w-2.5 h-2.5 p-0;
73
- }
@@ -1,59 +0,0 @@
1
- @reference "../../../styles/reference.css";
2
-
3
- .s-chip {
4
- @apply inline-flex min-w-0 items-center rounded-full font-medium;
5
- }
6
-
7
- .s-chip[data-size='md'] {
8
- @apply min-h-7 gap-1.5 px-2.5 text-xs;
9
- }
10
-
11
- .s-chip[data-size='md'][data-closable='true'] {
12
- @apply pr-1;
13
- }
14
-
15
- .s-chip[data-size='sm'] {
16
- @apply min-h-6 gap-1 px-2 text-[11px] leading-4;
17
- }
18
-
19
- .s-chip[data-size='sm'][data-closable='true'] {
20
- @apply pr-0.5;
21
- }
22
-
23
- .s-chip__icon {
24
- @apply inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center;
25
- }
26
-
27
- .s-chip__icon-graphic {
28
- @apply h-full w-full;
29
- }
30
-
31
- .s-chip__label {
32
- @apply min-w-0 overflow-hidden text-ellipsis whitespace-nowrap;
33
- }
34
-
35
- .s-chip[data-disabled='true'] {
36
- @apply opacity-60;
37
- }
38
-
39
- .s-chip[data-severity='primary'] {
40
- @apply bg-primary-100 text-primary-800 dark:bg-primary-950 dark:text-primary-50;
41
- }
42
- .s-chip[data-severity='secondary'] {
43
- @apply bg-surface-100 text-surface-800 dark:bg-surface-800 dark:text-surface-50;
44
- }
45
- .s-chip[data-severity='success'] {
46
- @apply bg-success-100 text-success-800 dark:bg-success-950 dark:text-success-50;
47
- }
48
- .s-chip[data-severity='info'] {
49
- @apply bg-info-100 text-info-800 dark:bg-info-950 dark:text-info-50;
50
- }
51
- .s-chip[data-severity='warn'] {
52
- @apply bg-warn-100 text-warn-800 dark:bg-warn-950 dark:text-warn-50;
53
- }
54
- .s-chip[data-severity='danger'] {
55
- @apply bg-danger-100 text-danger-800 dark:bg-danger-950 dark:text-danger-50;
56
- }
57
- .s-chip[data-severity='contrast'] {
58
- @apply bg-surface-800 text-surface-100 dark:bg-surface-200 dark:text-surface-800;
59
- }
@@ -1,84 +0,0 @@
1
- @reference "../../../styles/reference.css";
2
-
3
- .s-section-header {
4
- @apply flex min-w-0 flex-wrap items-start justify-between gap-3;
5
- }
6
-
7
- .s-section-header[data-spacing-after='sm'] {
8
- @apply mb-2;
9
- }
10
-
11
- .s-section-header[data-spacing-after='md'] {
12
- @apply mb-3;
13
- }
14
-
15
- .s-section-header[data-divider='true'] {
16
- @apply border-b border-surface-200 pb-3 dark:border-surface-700;
17
- }
18
-
19
- .s-section-header[data-padding='sm'] {
20
- @apply p-2;
21
- }
22
-
23
- .s-section-header[data-padding='md'] {
24
- @apply p-4;
25
- }
26
-
27
- .s-section-header[data-divider='true'][data-padding='sm'] {
28
- @apply pb-2;
29
- }
30
-
31
- .s-section-header[data-divider='true'][data-padding='md'] {
32
- @apply pb-4;
33
- }
34
-
35
- .s-section-header__copy {
36
- @apply min-w-0 flex-1;
37
- }
38
-
39
- .s-section-header__eyebrow {
40
- @apply text-xs font-semibold uppercase text-surface-500 dark:text-surface-400;
41
- }
42
-
43
- .s-section-header__title {
44
- @apply m-0 break-words text-base font-semibold text-surface-900 dark:text-surface-50;
45
- }
46
-
47
- .s-section-header[data-size='sm'] .s-section-header__title {
48
- @apply text-sm;
49
- }
50
-
51
- .s-section-header[data-variant='display'] .s-section-header__title {
52
- @apply text-xl font-semibold uppercase tracking-[0.22em] text-surface-700 dark:text-surface-200;
53
- }
54
-
55
- .s-section-header__eyebrow + .s-section-header__title {
56
- @apply mt-1;
57
- }
58
-
59
- .s-section-header__description,
60
- .s-section-header__meta {
61
- @apply mt-1 min-w-0 break-words text-xs text-surface-500 dark:text-surface-400;
62
- overflow-wrap: anywhere;
63
- }
64
-
65
- .s-section-header__trailing {
66
- @apply flex min-w-0 flex-wrap items-center justify-end gap-2;
67
- }
68
-
69
- .s-section-header__badges,
70
- .s-section-header__actions {
71
- @apply flex min-w-0 flex-wrap items-center justify-end gap-2;
72
- }
73
-
74
- .s-section-header[data-trailing-layout='stacked'] .s-section-header__trailing,
75
- .s-section-header[data-trailing-layout='stacked'] .s-section-header__actions {
76
- @apply w-full justify-start;
77
- }
78
-
79
- @media (max-width: 639px) {
80
- .s-section-header[data-trailing-layout='responsive'] .s-section-header__trailing,
81
- .s-section-header[data-trailing-layout='responsive'] .s-section-header__actions {
82
- @apply w-full justify-start;
83
- }
84
- }