@cscfi/csc-ui 4.0.0-alpha.3 → 4.0.0-alpha.31

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 (115) hide show
  1. package/dist/csc-ui.js +14305 -8019
  2. package/dist/custom-elements.json +8952 -4605
  3. package/dist/docs/c-alert/usage.md +24 -0
  4. package/dist/docs/c-autocomplete/usage.md +152 -0
  5. package/dist/docs/c-breadcrumb/usage.md +104 -0
  6. package/dist/docs/c-breadcrumb-item/usage.md +1 -0
  7. package/dist/docs/c-button-group/usage.md +14 -1
  8. package/dist/docs/c-checkbox/usage.md +53 -0
  9. package/dist/docs/c-date-picker/usage.md +224 -0
  10. package/dist/docs/c-main/usage.md +21 -1
  11. package/dist/docs/c-menu/usage.md +15 -0
  12. package/dist/docs/c-menu-item/usage.md +6 -0
  13. package/dist/docs/c-number-field/usage.md +112 -0
  14. package/dist/docs/c-option-value/usage.md +1 -0
  15. package/dist/docs/c-popover/usage.md +33 -0
  16. package/dist/docs/c-progress-bar/usage.md +23 -0
  17. package/dist/docs/c-progress-circle/usage.md +25 -0
  18. package/dist/docs/c-radio/usage.md +45 -0
  19. package/dist/docs/c-radio-group/usage.md +67 -0
  20. package/dist/docs/c-select/usage.md +127 -0
  21. package/dist/docs/c-side-navigation/usage.md +21 -0
  22. package/dist/docs/c-spinner/usage.md +21 -0
  23. package/dist/docs/c-switch/usage.md +36 -0
  24. package/dist/docs/c-tab-buttons/usage.md +7 -0
  25. package/dist/docs/c-table/usage.md +14 -0
  26. package/dist/docs/c-text-field/usage.md +106 -0
  27. package/dist/docs/c-time-picker/usage.md +170 -0
  28. package/dist/docs/c-toolbar/usage.md +17 -0
  29. package/dist/docs/c-tooltip/usage.md +30 -0
  30. package/dist/docs/c-tree-select/usage.md +156 -0
  31. package/dist/floating-ui.dom-DvzxEaDJ.js +1292 -0
  32. package/dist/styles/css/tailwind-theme.css +33 -0
  33. package/dist/styles/css/tokens.css +719 -197
  34. package/dist/vscode.css-custom-data.json +474 -20
  35. package/dist/vscode.html-custom-data.json +659 -57
  36. package/dist/web-types.json +2813 -697
  37. package/dist-types/components/c-alert/CAlert.vue.d.ts +18 -4
  38. package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +118 -21
  39. package/dist-types/components/c-breadcrumb/CBreadcrumb.vue.d.ts +35 -0
  40. package/dist-types/components/c-breadcrumb/fit.d.ts +29 -0
  41. package/dist-types/components/c-breadcrumb-item/CBreadcrumbItem.vue.d.ts +31 -0
  42. package/dist-types/components/c-button/CButton.vue.d.ts +4 -4
  43. package/dist-types/components/c-button-group/CButtonGroup.vue.d.ts +1 -1
  44. package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +3 -3
  45. package/dist-types/components/c-data-table/CDataTable.vue.d.ts +6 -2
  46. package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +282 -0
  47. package/dist-types/components/c-date-picker/dates.d.ts +119 -0
  48. package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +50 -7
  49. package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +1 -1
  50. package/dist-types/components/c-input/CInput.vue.d.ts +6 -6
  51. package/dist-types/components/c-list-item/CListItem.vue.d.ts +1 -1
  52. package/dist-types/components/c-main/CMain.vue.d.ts +10 -2
  53. package/dist-types/components/c-menu/CMenu.vue.d.ts +13 -3
  54. package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +30 -3
  55. package/dist-types/components/c-number-field/CNumberField.vue.d.ts +174 -0
  56. package/dist-types/components/c-number-field/numbers.d.ts +58 -0
  57. package/dist-types/components/c-otp-input/COtpInput.vue.d.ts +1 -1
  58. package/dist-types/components/c-pagination/CPagination.vue.d.ts +1 -1
  59. package/dist-types/components/c-popover/CPopover.vue.d.ts +43 -0
  60. package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +32 -0
  61. package/dist-types/components/c-radio/CRadio.vue.d.ts +7 -11
  62. package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +10 -48
  63. package/dist-types/components/c-select/CSelect.vue.d.ts +115 -27
  64. package/dist-types/components/c-side-navigation/CSideNavigation.vue.d.ts +1 -1
  65. package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +1 -1
  66. package/dist-types/components/c-slider/CSlider.vue.d.ts +3 -3
  67. package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +1 -1
  68. package/dist-types/components/c-tab-buttons/CTabButtons.vue.d.ts +1 -1
  69. package/dist-types/components/c-table/CTable.vue.d.ts +11 -1
  70. package/dist-types/components/c-table/injectTableStyles.d.ts +1 -0
  71. package/dist-types/components/c-tag/CTag.vue.d.ts +7 -0
  72. package/dist-types/components/c-tags/CTags.vue.d.ts +1 -1
  73. package/dist-types/components/c-text-field/CTextField.vue.d.ts +27 -10
  74. package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +210 -0
  75. package/dist-types/components/c-time-picker/times.d.ts +82 -0
  76. package/dist-types/components/c-toasts/CToasts.vue.d.ts +1 -1
  77. package/dist-types/components/c-toolbar/CToolbar.vue.d.ts +10 -1
  78. package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +49 -0
  79. package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +261 -0
  80. package/dist-types/index.d.ts +19 -2
  81. package/dist-types/shared/FieldMessage.vue.d.ts +21 -0
  82. package/dist-types/shared/PanelHeadingRow.vue.d.ts +13 -0
  83. package/dist-types/shared/SelectionIndicator.vue.d.ts +21 -0
  84. package/dist-types/shared/TypedField.vue.d.ts +46 -0
  85. package/dist-types/shared/appDefaults.d.ts +75 -0
  86. package/dist-types/shared/defineElement.d.ts +1 -0
  87. package/dist-types/shared/inputMask.d.ts +106 -0
  88. package/dist-types/shared/lightDismiss.d.ts +35 -0
  89. package/dist-types/shared/modalStack.d.ts +4 -3
  90. package/dist-types/shared/optionLabel.d.ts +18 -0
  91. package/dist-types/shared/pageLock.d.ts +26 -0
  92. package/dist-types/shared/peekCap.d.ts +35 -0
  93. package/dist-types/shared/popoverChain.d.ts +65 -0
  94. package/dist-types/shared/positionArea.d.ts +13 -0
  95. package/dist-types/shared/reducedMotion.d.ts +10 -0
  96. package/dist-types/shared/selectAll.d.ts +29 -0
  97. package/dist-types/shared/splitMatches.d.ts +18 -0
  98. package/dist-types/shared/useAnchoredPanel.d.ts +102 -0
  99. package/dist-types/shared/useDesignatedTrigger.d.ts +41 -0
  100. package/dist-types/shared/useFallbackPosition.d.ts +63 -0
  101. package/dist-types/shared/useHostStates.d.ts +25 -0
  102. package/dist-types/shared/useKeyboardModality.d.ts +7 -0
  103. package/dist-types/shared/useNarrowViewport.d.ts +19 -0
  104. package/dist-types/shared/useScrollStrip.d.ts +39 -0
  105. package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
  106. package/dist-types/shared/useTypedField.d.ts +103 -0
  107. package/dist-types/shared/visualViewport.d.ts +51 -0
  108. package/dist-types/tag-name-map.d.ts +769 -54
  109. package/dist-types/theme/chart-data.d.ts +51 -0
  110. package/dist-types/theme/ramp.d.ts +38 -0
  111. package/dist-types/theme/themeMode.d.ts +51 -0
  112. package/dist-types/types.d.ts +7 -0
  113. package/package.json +21 -9
  114. package/dist/css-anchor-positioning-fn-RTxo68pt.js +0 -6447
  115. package/dist-types/shared/anchorPolyfill.d.ts +0 -24
@@ -0,0 +1,261 @@
1
+ import type { CFieldSize } from '../../types';
2
+ /**
3
+ * Custom search predicate for `c-tree-select`. Receives the item, the query
4
+ * and the item's ancestors root-first; return `true` to list the item. The
5
+ * default matches the query case-insensitively anywhere in the `name` or
6
+ * `code` of the item or of any of its ancestors.
7
+ */
8
+ export type CTreeSelectFilter = (item: CTreeSelectItem, query: string, path: CTreeSelectItem[]) => boolean;
9
+ /**
10
+ * One item of a `c-tree-select` tree. An item with a non-empty `children`
11
+ * array is a branch; any other item is a leaf. Values must be unique across
12
+ * the whole tree.
13
+ */
14
+ export interface CTreeSelectItem {
15
+ /** Child items; present and non-empty for a branch. */
16
+ children?: CTreeSelectItem[];
17
+ /**
18
+ * Short code shown before the name and matched by the search (a
19
+ * classification number, say).
20
+ */
21
+ code?: string;
22
+ /**
23
+ * Disable the item: a disabled branch cannot be entered, a disabled leaf
24
+ * cannot be committed.
25
+ */
26
+ disabled?: boolean;
27
+ /** The item's label. */
28
+ name: string;
29
+ /** The item's value, unique across the tree. */
30
+ value: number | string;
31
+ }
32
+ export interface CTreeSelectProps {
33
+ /**
34
+ * Let a branch be committed as the value: a pinned select-branch row heads
35
+ * every level below the root, and matching branches are listed as search
36
+ * results
37
+ */
38
+ allowBranch?: boolean;
39
+ /**
40
+ * Make the selected value clearable
41
+ */
42
+ clearable?: boolean;
43
+ /**
44
+ * Disable the field
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Error message shown in place of the hint while the field is invalid
49
+ *
50
+ * @freeform
51
+ */
52
+ errorMessage?: string;
53
+ /**
54
+ * Custom search predicate; receives the item, the query and the item's
55
+ * ancestors. Functions have no attribute form — bind as a DOM property
56
+ */
57
+ filter?: CTreeSelectFilter;
58
+ /**
59
+ * Hide the hint and error messages
60
+ *
61
+ * @defaultable false
62
+ */
63
+ hideDetails?: boolean;
64
+ /**
65
+ * Hint text for the field
66
+ *
67
+ * @freeform
68
+ */
69
+ hint?: string;
70
+ /**
71
+ * Id of the element
72
+ *
73
+ * @freeform
74
+ */
75
+ hostId?: string;
76
+ /**
77
+ * The tree to pick from. Arrays have no attribute form — bind as a DOM
78
+ * property (`:items.prop` in Vue)
79
+ */
80
+ items?: CTreeSelectItem[];
81
+ /**
82
+ * Items per page before the list scrolls
83
+ *
84
+ * @defaultable 6
85
+ */
86
+ itemsPerPage?: number;
87
+ /**
88
+ * Element label
89
+ *
90
+ * @freeform
91
+ */
92
+ label?: string;
93
+ /**
94
+ * Label on top of the field
95
+ *
96
+ * @defaultable false
97
+ */
98
+ labelOnTop?: boolean;
99
+ /**
100
+ * Names of the levels, top level first, shown in the panel header; a
101
+ * missing entry falls back to `texts.level(n)`. Arrays have no attribute
102
+ * form — bind as a DOM property
103
+ */
104
+ levelLabels?: string[];
105
+ /**
106
+ * Input field name
107
+ *
108
+ * @freeform
109
+ */
110
+ name?: string;
111
+ /**
112
+ * Placeholder for the search input inside the panel
113
+ *
114
+ * @freeform
115
+ */
116
+ placeholder?: string;
117
+ /**
118
+ * Set the field as required
119
+ */
120
+ required?: boolean;
121
+ /**
122
+ * Emit the committed item with its path as a `CTreeSelectSelection` instead
123
+ * of its value
124
+ */
125
+ returnObject?: boolean;
126
+ /**
127
+ * Shadow variant
128
+ *
129
+ * @defaultable false
130
+ */
131
+ shadow?: boolean;
132
+ /**
133
+ * Field height: the 52px default (the shared control height) or the 36px `small` box
134
+ *
135
+ * @defaultable 'default'
136
+ */
137
+ size?: CFieldSize;
138
+ /**
139
+ * UI text overrides (i18n), merged over the English defaults. Objects have
140
+ * no attribute form — bind as a DOM property (`:texts.prop` in Vue)
141
+ *
142
+ * @defaultable {}
143
+ */
144
+ texts?: CTreeSelectTexts;
145
+ /**
146
+ * Set the validity of the field
147
+ */
148
+ valid?: boolean;
149
+ /**
150
+ * Selected value: the committed item's value, or the `CTreeSelectSelection`
151
+ * with `return-object`; `null` when nothing is selected
152
+ */
153
+ value?: CTreeSelectValue;
154
+ }
155
+ /**
156
+ * The committed item as emitted with `return-object`: a fresh object — never
157
+ * the `items` entry itself — with its ancestors root-first and without
158
+ * `children`.
159
+ */
160
+ export interface CTreeSelectSelection {
161
+ /** The committed item's code, when it has one. */
162
+ code?: string;
163
+ /** The committed item's label. */
164
+ name: string;
165
+ /** The committed item's ancestors, root-first. */
166
+ path: Array<{
167
+ code?: string;
168
+ name: string;
169
+ value: number | string;
170
+ }>;
171
+ /** The committed item's value. */
172
+ value: number | string;
173
+ }
174
+ /**
175
+ * UI texts of `c-tree-select`, shallow-merged over the English defaults.
176
+ * Static labels are strings; interpolated ones are functions.
177
+ */
178
+ export interface CTreeSelectTexts {
179
+ /** Accessible label of the breadcrumb navigation in the panel. */
180
+ breadcrumb?: string;
181
+ /**
182
+ * Label of the "Browse instead" control shown in the header while a query
183
+ * is typed.
184
+ */
185
+ browse?: string;
186
+ /** Meta text on a branch row; receives its number of children. */
187
+ children?: (count: number) => string;
188
+ /**
189
+ * Header text in browse mode; receives the label of the level being
190
+ * listed.
191
+ */
192
+ choose?: (levelLabel: string) => string;
193
+ /** Accessible label of the clear button. */
194
+ clearSelection?: string;
195
+ /** Accessible label of the close button in the fullscreen panel (narrow viewports). */
196
+ closePanel?: string;
197
+ /** Accessible label of the search input inside the panel. */
198
+ filterOptions?: string;
199
+ /**
200
+ * Header text of a level whose rows are all leaves in an unevenly deep
201
+ * tree (an evenly deep tree shows the step counter instead).
202
+ */
203
+ final?: string;
204
+ /**
205
+ * Default label of level `n` (1 = the top level) when `level-labels` gives
206
+ * none.
207
+ */
208
+ level?: (n: number) => string;
209
+ /** Header text in search mode; receives the number of matches. */
210
+ matches?: (count: number) => string;
211
+ /** Text of the row shown when nothing is listed. */
212
+ noResults?: string;
213
+ /** Label of the root crumb. */
214
+ root?: string;
215
+ /** Placeholder of the search input when the `placeholder` prop is empty. */
216
+ searchPlaceholder?: string;
217
+ /**
218
+ * Label of the pinned select-branch row; receives the current branch's
219
+ * name.
220
+ */
221
+ select?: (name: string) => string;
222
+ /**
223
+ * Header step counter shown while the tree is evenly deep (every leaf at
224
+ * one level); receives the step and the total number of levels.
225
+ */
226
+ step?: (n: number, total: number) => string;
227
+ /** Accessible label of the chevron button that opens and closes the panel. */
228
+ toggleOptions?: string;
229
+ }
230
+ /**
231
+ * Selection value of `c-tree-select`: the committed item's value — or a
232
+ * {@link CTreeSelectSelection} with `return-object` — and `null` when
233
+ * cleared.
234
+ */
235
+ export type CTreeSelectValue = CTreeSelectSelection | null | number | string;
236
+ declare const _default: typeof __VLS_export;
237
+ export default _default;
238
+ declare const __VLS_export: import("vue").DefineComponent<CTreeSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTreeSelectProps> & Readonly<{}>, {
239
+ label: string;
240
+ filter: CTreeSelectFilter;
241
+ value: CTreeSelectValue;
242
+ name: string;
243
+ itemsPerPage: number;
244
+ size: CFieldSize;
245
+ texts: CTreeSelectTexts;
246
+ hideDetails: boolean;
247
+ labelOnTop: boolean;
248
+ shadow: boolean;
249
+ clearable: boolean;
250
+ disabled: boolean;
251
+ errorMessage: string;
252
+ hint: string;
253
+ hostId: string;
254
+ items: CTreeSelectItem[];
255
+ placeholder: string;
256
+ required: boolean;
257
+ returnObject: boolean;
258
+ valid: boolean;
259
+ allowBranch: boolean;
260
+ levelLabels: string[];
261
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,25 +1,42 @@
1
1
  export type { CAlertIconType, CAlertProps, CAlertType, } from './components/c-alert/CAlert.vue';
2
- export type { CAutocompleteFilter, CAutocompleteItem, CAutocompleteOption, CAutocompleteProps, } from './components/c-autocomplete/CAutocomplete.vue';
2
+ export type { CAutocompleteFilter, CAutocompleteItem, CAutocompleteOption, CAutocompleteProps, CAutocompleteTexts, CAutocompleteValue, } from './components/c-autocomplete/CAutocomplete.vue';
3
+ export type { CBreadcrumbItemProps } from './components/c-breadcrumb-item/CBreadcrumbItem.vue';
4
+ export type { CBreadcrumbProps, CBreadcrumbTexts, } from './components/c-breadcrumb/CBreadcrumb.vue';
3
5
  export type { CButtonGroupProps, CButtonGroupSize, CButtonGroupValue, } from './components/c-button-group/CButtonGroup.vue';
4
6
  export type { CButtonProps, CButtonSize, CButtonType, } from './components/c-button/CButton.vue';
5
7
  export type { CCardActionsAlign, CCardActionsJustify, CCardActionsProps, } from './components/c-card-actions/CCardActions.vue';
6
8
  export type { CDataTableAlign, CDataTableCellContent, CDataTableCellContext, CDataTableColumn, CDataTableColumnExpansion, CDataTableColumnPin, CDataTableExpandedContext, CDataTableFooterContext, CDataTableProps, CDataTableRow, CDataTableSelectionMode, CDataTableSort, CDataTableSortDirection, CDataTableTexts, } from './components/c-data-table/CDataTable.vue';
9
+ export type { CDatePickerDisabledDate, CDatePickerProps, CDatePickerRange, CDatePickerText, CDatePickerTexts, CDatePickerType, CDatePickerValue, CDatePickerWeekday, } from './components/c-date-picker/CDatePicker.vue';
7
10
  export type { CIconButtonProps, CIconButtonSize, } from './components/c-icon-button/CIconButton.vue';
8
11
  export type { CLoginCardActionsAlign, CLoginCardActionsJustify, CLoginCardActionsProps, } from './components/c-login-card-actions/CLoginCardActions.vue';
9
12
  export type { CLoginCardBlendMode, CLoginCardProps, } from './components/c-login-card/CLoginCard.vue';
13
+ export type { CNumberFieldProps, CNumberFieldTexts, } from './components/c-number-field/CNumberField.vue';
10
14
  export type { CPaginationOptions, CPaginationProps, CPaginationSize, } from './components/c-pagination/CPagination.vue';
15
+ export type { CPopoverProps } from './components/c-popover/CPopover.vue';
16
+ export type { CProgressCircleProps } from './components/c-progress-circle/CProgressCircle.vue';
17
+ export type { CSelectProps, CSelectTexts, CSelectValue, } from './components/c-select/CSelect.vue';
11
18
  export type { CStatusProps, CStatusType, } from './components/c-status/CStatus.vue';
12
19
  export type { CTabButtonsProps, CTabButtonsSize, } from './components/c-tab-buttons/CTabButtons.vue';
13
20
  export type { CTabsJustify, CTabsProps } from './components/c-tabs/CTabs.vue';
14
21
  export type { CTagProps, CTagSize } from './components/c-tag/CTag.vue';
15
22
  export type { CTagsProps, CTagsSize } from './components/c-tags/CTags.vue';
16
23
  export type { CTextFieldAutocapitalize, CTextFieldProps, CTextFieldType, } from './components/c-text-field/CTextField.vue';
24
+ export type { CTimePickerProps, CTimePickerRange, CTimePickerText, CTimePickerTexts, CTimePickerValue, } from './components/c-time-picker/CTimePicker.vue';
17
25
  export type { CToastProps } from './components/c-toast/CToast.vue';
18
26
  export type { CToastsHorizontal, CToastsProps, CToastsVertical, } from './components/c-toasts/CToasts.vue';
27
+ export type { CTooltipProps } from './components/c-tooltip/CTooltip.vue';
28
+ export type { CTreeSelectFilter, CTreeSelectItem, CTreeSelectProps, CTreeSelectSelection, CTreeSelectTexts, CTreeSelectValue, } from './components/c-tree-select/CTreeSelect.vue';
19
29
  export type * from './tag-name-map';
20
30
  export { applyTheme, resetTheme, themeToCss } from './theme/applyTheme';
21
31
  export type { Family, ThemeSeeds } from './theme/applyTheme';
22
- export type { CFieldSize, CSelectItem, CToastMessage, CToastType, } from './types';
32
+ export { applyDefaults, DEFAULTABLE_PROPS, resetDefaults, } from './shared/appDefaults';
33
+ export type { AppDefaults, DefaultableTag } from './shared/appDefaults';
34
+ export { chartAnatomy, chartAnatomyHex, chartSlots, chartSlotsHex, } from './theme/chart-data';
35
+ export type { ChartAnatomy, ChartSlots } from './theme/chart-data';
36
+ export { DEFAULT_SEEDS, FAMILIES } from './theme/ramp.js';
37
+ export { observeThemeMode, themeMode } from './theme/themeMode';
38
+ export type { ThemeMode } from './theme/themeMode';
39
+ export type { CFieldSize, CPlacement, CSelectItem, CToastMessage, CToastType, } from './types';
23
40
  export { h } from 'vue';
24
41
  export type { VNode, VNodeChild } from 'vue';
25
42
  /**
@@ -0,0 +1,21 @@
1
+ interface FieldMessageProps {
2
+ /** Consumer-supplied text shown in place of the hint while invalid. */
3
+ errorMessage?: string;
4
+ /** Suppress the whole message area (no reserved height either). */
5
+ hideDetails?: boolean;
6
+ /** Neutral helper text shown while valid (or when no error message is supplied). */
7
+ hint?: string;
8
+ /** Part name stamped on the message area (`message` unless the host reserves it). */
9
+ part?: string;
10
+ /** Host control's validity; `false` switches to the error message when one is supplied. */
11
+ valid?: boolean;
12
+ }
13
+ declare const __VLS_export: import("vue").DefineComponent<FieldMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FieldMessageProps> & Readonly<{}>, {
14
+ part: string;
15
+ hideDetails: boolean;
16
+ errorMessage: string;
17
+ hint: string;
18
+ valid: boolean;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ /** Accessible label of the close button. */
3
+ closeLabel: string;
4
+ /** The field's label, shown as the panel heading. */
5
+ heading: string;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ close: () => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onClose?: (() => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,21 @@
1
+ interface SelectionIndicatorProps {
2
+ /** Fill the box and show the check glyph. */
3
+ checked?: boolean;
4
+ /** Paint the disabled colour channel. */
5
+ disabled?: boolean;
6
+ /** Paint the error colour channel (box unless disabled; mark always). */
7
+ error?: boolean;
8
+ /** Render the keyboard focus halo pseudo-element for the host to reveal. */
9
+ focusHalo?: boolean;
10
+ /** Fill the box and show the indeterminate bar (wins over `checked`). */
11
+ indeterminate?: boolean;
12
+ }
13
+ declare const __VLS_export: import("vue").DefineComponent<SelectionIndicatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SelectionIndicatorProps> & Readonly<{}>, {
14
+ error: boolean;
15
+ disabled: boolean;
16
+ checked: boolean;
17
+ indeterminate: boolean;
18
+ focusHalo: boolean;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
@@ -0,0 +1,46 @@
1
+ import type { CFieldSize } from '../types';
2
+ import { type TypedField } from './useTypedField';
3
+ type __VLS_Props = {
4
+ /** The `anchor-name` style from `useAnchoredPanel`. */
5
+ anchorStyle: string;
6
+ /** Accessible label of the clear button. */
7
+ clearLabel: string;
8
+ clearable: boolean;
9
+ disabled: boolean;
10
+ errorMessage: string;
11
+ /** The `useTypedField` state this field renders. */
12
+ field: TypedField;
13
+ hideDetails: boolean;
14
+ hint: string;
15
+ inputId: string;
16
+ /** The virtual keyboard the inputs ask for. */
17
+ inputmode: 'numeric' | 'text';
18
+ label: string;
19
+ labelOnTop: boolean;
20
+ name: string;
21
+ /** Whether the host's panel is open — the field stays active. */
22
+ open: boolean;
23
+ required: boolean;
24
+ shadow: boolean;
25
+ size: CFieldSize;
26
+ valid: boolean;
27
+ };
28
+ declare var __VLS_20: {
29
+ buttonSize: "x-small";
30
+ iconSize: number;
31
+ } | {
32
+ buttonSize: "default";
33
+ iconSize: number;
34
+ };
35
+ type __VLS_Slots = {} & {
36
+ trigger?: (props: typeof __VLS_20) => any;
37
+ };
38
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
40
+ declare const _default: typeof __VLS_export;
41
+ export default _default;
42
+ type __VLS_WithSlots<T, S> = T & {
43
+ new (): {
44
+ $slots: S;
45
+ };
46
+ };
@@ -0,0 +1,75 @@
1
+ /**
2
+ * App-wide prop defaults (ADR-0048).
3
+ *
4
+ * A consumer sets a *defaultable* prop once for every instance of a tag —
5
+ * `labelOnTop` on every text field, one `texts` translation per list field —
6
+ * instead of repeating it per instance:
7
+ *
8
+ * applyDefaults({ 'c-text-field': { labelOnTop: true } });
9
+ *
10
+ * Only props tagged `@defaultable <built-in>` in their SFC take part; the
11
+ * analyzer derives the `AppDefaults` type and the `DEFAULTABLE_PROPS`
12
+ * allow-list from those tags (src/tag-name-map.ts). Each such prop declares
13
+ * `undefined` in `withDefaults` — so "unset" is observable — and resolves
14
+ * through `useAppDefault` below, in this order:
15
+ *
16
+ * host attribute → own property (non-nullish) → app default → built-in
17
+ *
18
+ * Why the host attribute comes first — two Vue `defineCustomElement` quirks:
19
+ * 1. A Boolean prop supplied via *attribute* (`<c-select hide-details>`)
20
+ * has been observed to reset to its default on the wrapper's re-render
21
+ * (it re-renders on every value change): the host attribute persists,
22
+ * but the prop flips. The attribute is the stable signal.
23
+ * 2. Binding `hide-details` to a nested `c-input` in a template is mangled
24
+ * on update — the key matches c-input's declared prop, so Vue treats it
25
+ * as a property, and the reset above reflects back out and removes the
26
+ * attribute. Wrappers therefore forward it through a plain
27
+ * `data-hide-details` attribute (no declared-prop collision, so Vue
28
+ * patches it reliably) that c-input reads back.
29
+ * Property writes reflect to attributes as well (`el.size = 'small'` writes
30
+ * `size="small"`, `el.labelOnTop = false` removes the attribute), so one
31
+ * attribute-first order is sound for Booleans, strings and numbers alike.
32
+ *
33
+ * The registry is a module-level `reactive()` object and every resolved
34
+ * computed depends on it, so a later `applyDefaults()` re-renders mounted
35
+ * elements (runtime language switching). Not provide/inject: the library
36
+ * coordinates through module singletons (modalStack, popoverChain,
37
+ * applyTheme), and a per-element app context would not be live for trees
38
+ * that are already mounted.
39
+ */
40
+ import { type ComputedRef } from 'vue';
41
+ import { type AppDefaults } from '../tag-name-map';
42
+ export type { AppDefaults } from '../tag-name-map';
43
+ export { DEFAULTABLE_PROPS } from '../tag-name-map';
44
+ /** A tag with at least one defaultable prop. */
45
+ export type DefaultableTag = keyof AppDefaults;
46
+ type Bucket<T extends DefaultableTag> = NonNullable<AppDefaults[T]>;
47
+ /** The value a resolved prop takes: the element member type, made required. */
48
+ type Resolved<T extends DefaultableTag, K extends keyof Bucket<T>> = Required<NonNullable<Bucket<T>[K]>>;
49
+ /**
50
+ * Set app-wide defaults. Merges with previously applied defaults tag by tag;
51
+ * a key set to `undefined` clears that key. An object prop (`texts`) is stored
52
+ * whole and merged key by key with the built-in and per-instance texts at each
53
+ * element. Live: mounted elements re-render. No-op outside the browser — a
54
+ * module-level registry must not leak across server requests, and custom
55
+ * elements never render on the server.
56
+ */
57
+ export declare function applyDefaults(defaults: AppDefaults): void;
58
+ /** Clear the app-wide defaults of the given tags, or of every tag when omitted. */
59
+ export declare function resetDefaults(tags?: DefaultableTag[]): void;
60
+ /**
61
+ * Per-instance resolver for defaultable props. Call once in setup, then one
62
+ * line per prop:
63
+ *
64
+ * const appDefault = useAppDefault('c-text-field', props);
65
+ * const labelOnTopResolved = appDefault('labelOnTop', false);
66
+ *
67
+ * Scalars: host attribute → own property (non-nullish) → app default →
68
+ * built-in, with Boolean coercion applied *after* the layer is chosen
69
+ * (`coerceBoolean(undefined)` is `false` and would swallow the fallthrough).
70
+ * Objects (`texts`): per-key merge, built-in ← app default ← own.
71
+ *
72
+ * A nullish own value counts as "unset" (Vue itself treats `null` as an
73
+ * explicit value; here it falls through to the app default).
74
+ */
75
+ export declare const useAppDefault: <T extends DefaultableTag>(tag: T, props: object) => <K extends keyof Bucket<T> & string>(key: K, builtIn: Resolved<T, K>) => ComputedRef<Resolved<T, K>>;
@@ -1,4 +1,5 @@
1
1
  import { type Component } from 'vue';
2
+ export declare const hyphenate: (key: string) => string;
2
3
  /**
3
4
  * Register a Vue SFC as a custom element under `tag`, with the shared Tailwind
4
5
  * utility stylesheet applied to its shadow root alongside the SFC's own styles.
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Input masks (CONTEXT.md "Input mask"; ADR-0059): conform typed text to a
3
+ * pattern as it is typed. One engine behind `c-text-field`'s `mask` and
4
+ * `c-date-picker`'s `format`.
5
+ *
6
+ * A mask compiles to a list of slots. A **token** slot takes one to `max`
7
+ * characters its `accepts` predicate allows — a `c-text-field` token takes
8
+ * exactly one; a date part takes one or two digits, and closes early on a
9
+ * typed separator or a first digit no longer value can start. A **literal**
10
+ * slot is a fixed character, inserted lazily: only when a later token
11
+ * character arrives, so an empty field stays `''` and Backspace behaves like
12
+ * plain text. A typed character that is the next literal (or one of its
13
+ * `aliases`) is consumed as that literal.
14
+ *
15
+ * A **word** slot takes one of a few words — a time's AM/PM period — typed
16
+ * by its first letters: once they name one word, the slot shows the whole
17
+ * word and closes. Its characters all count as typed, and a deleting edit
18
+ * that leaves a word partial clears it, so one Backspace removes it.
19
+ *
20
+ * An **optional section** (`[…]`, trailing only) holds optional slots: its
21
+ * tokens take zero or one character (`min: 0`) and its literals are marked
22
+ * `optional`. Completeness and the mask guide count required slots only.
23
+ */
24
+ export interface MaskResult {
25
+ /** The caret position in `text`. */
26
+ caret: number;
27
+ /** Whether every required token slot is filled. */
28
+ complete: boolean;
29
+ /**
30
+ * What the mask still asks for after `text` — the **mask guide**: each
31
+ * unfilled required token drawn as `_`, literals as themselves; optional
32
+ * slots are never drawn. `''` once complete.
33
+ */
34
+ rest: string;
35
+ /** The conformed text. */
36
+ text: string;
37
+ /** Per character of `text`: whether it fills a token slot (not a literal). */
38
+ tokenAt: boolean[];
39
+ /** Only the characters filling token slots. */
40
+ unmasked: string;
41
+ }
42
+ export type MaskSlot = {
43
+ /** Other typed characters that stand for this literal. */
44
+ aliases?: string;
45
+ kind: 'literal';
46
+ /** Part of an optional section: never drawn in the guide, never appended. */
47
+ optional?: boolean;
48
+ text: string;
49
+ } | {
50
+ accepts: (ch: string) => boolean;
51
+ /** Closes the slot early once its characters so far are `value`. */
52
+ closesAfter?: (value: string) => boolean;
53
+ kind: 'token';
54
+ max: number;
55
+ /** `0` for an optional token. */
56
+ min: number;
57
+ } | {
58
+ kind: 'word';
59
+ /** The words the slot takes, matched case-insensitively and shown as written here. */
60
+ words: string[];
61
+ };
62
+ /**
63
+ * Compile a `c-text-field` mask: `#` a digit, `A` a letter, `*` a letter or
64
+ * a digit, `\` escapes the next character, `[…]` wraps a trailing optional
65
+ * section; everything else is a literal. Returns `null` for a mask that
66
+ * breaks the section rules: a nested, unclosed or stray bracket, or anything
67
+ * but another section after the first one.
68
+ */
69
+ export declare const compileMask: (pattern: string) => MaskSlot[] | null;
70
+ /** Say once per pattern, page-wide, that a mask was ignored as invalid. */
71
+ export declare const warnInvalidMask: (tag: string, pattern: string) => void;
72
+ /** Whether every token of a mask takes only digits (a numeric keyboard fits). */
73
+ export declare const isNumericMask: (pattern: string) => boolean;
74
+ /**
75
+ * Conform `text` to `slots`, mapping `caret` (a position in `text`) onto the
76
+ * result. Characters that fit no slot are dropped. `deleting` marks an edit
77
+ * that removed text: trailing literals are then trimmed, so Backspace never
78
+ * sticks on a separator. Otherwise literals that end the mask are appended
79
+ * once the last token is filled.
80
+ */
81
+ export declare const conformMask: (slots: MaskSlot[], text: string, caret?: number, deleting?: boolean) => MaskResult;
82
+ /** Rewrites text to its conformed form, mapping a caret position onto it. */
83
+ export type Conformer<R extends ConformResult = ConformResult> = (text: string, caret?: number, deleting?: boolean) => R;
84
+ /** The part of a conform result the caret machinery needs. */
85
+ export interface ConformResult {
86
+ caret: number;
87
+ text: string;
88
+ /** Per character of `text`: whether it is typed content (not an inserted literal or separator). */
89
+ tokenAt: boolean[];
90
+ }
91
+ /**
92
+ * Conform an `<input>` after a native `input` event: rewrite its text and
93
+ * caret in place and return the result. `previous` is the text shown before
94
+ * the edit — a Backspace (Delete) that only removed an inserted character (a
95
+ * literal, a group separator) removes the typed character before (after) it
96
+ * instead. Returns `null`, leaving the input untouched, during IME
97
+ * composition, or on a paste or drop when `skipPaste` is set (the date picker
98
+ * reads pasted text leniently instead).
99
+ */
100
+ export declare const applyConform: <R extends ConformResult>(input: HTMLInputElement, event: Event, conform: Conformer<R>, previous: string, { skipPaste }?: {
101
+ skipPaste?: boolean | undefined;
102
+ }) => null | R;
103
+ /** `applyConform` over mask slots. */
104
+ export declare const applyMask: (input: HTMLInputElement, event: Event, slots: MaskSlot[], previous: string, options?: {
105
+ skipPaste?: boolean;
106
+ }) => MaskResult | null;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Light dismiss (CONTEXT.md "Light dismiss", ADR-0050): the platform's rule
3
+ * for closing a transient surface from the pointer, shared by every surface
4
+ * that implements dismissal itself — the anchored field panels
5
+ * (`useAnchoredPanel`), the popover chain and `c-menu`, all of which are
6
+ * `popover="manual"` and so get nothing from the browser.
7
+ *
8
+ * A native `popover="auto"` does not close on `pointerdown`: the browser
9
+ * remembers where the press landed and dismisses on the matching `pointerup`
10
+ * only when *both* fell outside. A touch scroll begins with a `pointerdown`
11
+ * and turns into `pointercancel`, never `pointerup`, so scrolling the page
12
+ * under an open surface leaves it open. The hand-rolled `pointerdown`
13
+ * listeners this module replaces closed the panel on the first touch of every
14
+ * scroll — the bug that made `c-tree-select` unusable on a phone.
15
+ *
16
+ * Listeners are capture-phase on `document`, like the ones they replace, so a
17
+ * consumer's `stopPropagation()` cannot hide an outside press from them.
18
+ */
19
+ /** Detach the listeners `attachPointerPair` / `attachLightDismiss` installed. Idempotent. */
20
+ export type Detach = () => void;
21
+ /**
22
+ * Report each completed primary-pointer press-and-release pair with both
23
+ * composed paths. A press that ends in `pointercancel` — a touch that became a
24
+ * scroll or a pan — is dropped, and a release with no press seen since attach
25
+ * (the gesture that opened the surface) is ignored.
26
+ */
27
+ export declare const attachPointerPair: (onPair: (down: EventTarget[], up: EventTarget[]) => void) => Detach;
28
+ export interface LightDismissOptions {
29
+ /** True when a composed event path passes through the surface's own inside (host subtree, panel, designated trigger). */
30
+ isInside(path: EventTarget[]): boolean;
31
+ /** The press and its release both landed outside: close the surface. */
32
+ onDismiss(): void;
33
+ }
34
+ /** The single-surface case: dismiss when press and release both landed outside. */
35
+ export declare const attachLightDismiss: (options: LightDismissOptions) => Detach;
@@ -13,9 +13,10 @@
13
13
  * below the toast band,
14
14
  * - **backdrop visibility**: exactly one backdrop — the active modal's — is
15
15
  * visible at a time,
16
- * - **inertness**: everything outside the active modal is `inert`, except
17
- * `c-toasts` (toasts stay interactive above any modal),
18
- * - **scroll lock** on the document while the stack is non-empty,
16
+ * - **inertness** and **scroll lock**, delegated to the shared page lock
17
+ * (`pageLock.ts`, ADR-0050): everything outside the active modal is
18
+ * `inert` except `c-toasts`, and the document stops scrolling while the
19
+ * stack is non-empty,
19
20
  * - **Escape routing** to the active modal only, and
20
21
  * - **focus restore** to the element focused when each modal opened.
21
22
  */