@cscfi/csc-ui 4.0.0-alpha.9 → 4.0.0-rc.2

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 (203) hide show
  1. package/README.md +36 -2
  2. package/dist/csc-ui.js +22771 -14908
  3. package/dist/custom-elements.json +8943 -5632
  4. package/dist/docs/c-accordion/usage.md +60 -0
  5. package/dist/docs/c-accordion-item/usage.md +1 -0
  6. package/dist/docs/c-alert/usage.md +5 -5
  7. package/dist/docs/c-autocomplete/usage.md +156 -0
  8. package/dist/docs/c-badge/usage.md +50 -0
  9. package/dist/docs/c-breadcrumb/usage.md +104 -0
  10. package/dist/docs/c-breadcrumb-item/usage.md +1 -0
  11. package/dist/docs/c-button/usage.md +13 -0
  12. package/dist/docs/c-button-group/usage.md +16 -2
  13. package/dist/docs/c-card/usage.md +55 -0
  14. package/dist/docs/c-card-actions/usage.md +1 -0
  15. package/dist/docs/c-card-content/usage.md +1 -0
  16. package/dist/docs/c-card-title/usage.md +3 -0
  17. package/dist/docs/c-checkbox/usage.md +37 -5
  18. package/dist/docs/c-color-picker/usage.md +160 -0
  19. package/dist/docs/c-csc-logo/usage.md +25 -0
  20. package/dist/docs/c-data-table/usage.md +180 -0
  21. package/dist/docs/c-date-picker/usage.md +224 -0
  22. package/dist/docs/c-divider/usage.md +36 -0
  23. package/dist/docs/c-file-upload/usage.md +189 -0
  24. package/dist/docs/c-icon/usage.md +51 -0
  25. package/dist/docs/c-icon-button/usage.md +80 -0
  26. package/dist/docs/c-link/usage.md +45 -1
  27. package/dist/docs/c-list/usage.md +50 -0
  28. package/dist/docs/c-list-item/usage.md +1 -0
  29. package/dist/docs/c-list-item-title/usage.md +1 -0
  30. package/dist/docs/c-loader/usage.md +52 -1
  31. package/dist/docs/c-login-button/usage.md +1 -0
  32. package/dist/docs/c-login-buttons/usage.md +48 -0
  33. package/dist/docs/c-login-card/usage.md +45 -0
  34. package/dist/docs/c-login-card-actions/usage.md +1 -0
  35. package/dist/docs/c-login-card-content/usage.md +1 -0
  36. package/dist/docs/c-login-card-title/usage.md +3 -0
  37. package/dist/docs/c-main/usage.md +21 -1
  38. package/dist/docs/c-menu/usage.md +15 -0
  39. package/dist/docs/c-menu-item/usage.md +11 -0
  40. package/dist/docs/c-message/usage.md +56 -0
  41. package/dist/docs/c-modal/usage.md +18 -12
  42. package/dist/docs/c-navigation-button/usage.md +32 -0
  43. package/dist/docs/c-number-field/usage.md +114 -0
  44. package/dist/docs/c-option/usage.md +1 -0
  45. package/dist/docs/c-option-value/usage.md +1 -0
  46. package/dist/docs/c-otp-input/usage.md +95 -0
  47. package/dist/docs/c-page/usage.md +44 -0
  48. package/dist/docs/c-pagination/usage.md +69 -0
  49. package/dist/docs/c-popover/usage.md +1 -1
  50. package/dist/docs/c-progress-bar/usage.md +1 -1
  51. package/dist/docs/c-progress-circle/usage.md +1 -1
  52. package/dist/docs/c-radio/usage.md +9 -6
  53. package/dist/docs/c-radio-group/usage.md +5 -6
  54. package/dist/docs/c-select/usage.md +131 -0
  55. package/dist/docs/c-side-navigation/usage.md +70 -0
  56. package/dist/docs/c-side-navigation-item/usage.md +1 -0
  57. package/dist/docs/c-side-navigation-title/usage.md +1 -0
  58. package/dist/docs/c-slider/usage.md +78 -0
  59. package/dist/docs/c-spinner/usage.md +1 -1
  60. package/dist/docs/c-status/usage.md +46 -0
  61. package/dist/docs/c-step/usage.md +1 -0
  62. package/dist/docs/c-steps/usage.md +35 -0
  63. package/dist/docs/c-sub-navigation-item/usage.md +1 -0
  64. package/dist/docs/c-switch/usage.md +10 -3
  65. package/dist/docs/c-tab/usage.md +1 -0
  66. package/dist/docs/c-tab-buttons/usage.md +15 -0
  67. package/dist/docs/c-tab-item/usage.md +1 -0
  68. package/dist/docs/c-tab-items/usage.md +1 -0
  69. package/dist/docs/c-table/usage.md +1 -1
  70. package/dist/docs/c-tabs/usage.md +77 -0
  71. package/dist/docs/c-tag/usage.md +1 -0
  72. package/dist/docs/c-tags/usage.md +85 -0
  73. package/dist/docs/c-text-field/usage.md +109 -0
  74. package/dist/docs/c-time-picker/usage.md +170 -0
  75. package/dist/docs/c-toasts/usage.md +27 -3
  76. package/dist/docs/c-toolbar/usage.md +17 -0
  77. package/dist/docs/c-tree-select/usage.md +156 -0
  78. package/dist/floating-ui.dom-DvzxEaDJ.js +1292 -0
  79. package/dist/styles/css/tailwind-theme.css +2 -1
  80. package/dist/styles/css/tokens.css +609 -178
  81. package/dist/vscode.css-custom-data.json +556 -99
  82. package/dist/vscode.html-custom-data.json +1050 -480
  83. package/dist/web-types.json +3303 -1707
  84. package/dist-types/components/c-accordion/CAccordion.vue.d.ts +21 -25
  85. package/dist-types/components/c-accordion-item/CAccordionItem.vue.d.ts +13 -12
  86. package/dist-types/components/c-alert/CAlert.vue.d.ts +12 -17
  87. package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +124 -31
  88. package/dist-types/components/c-breadcrumb/CBreadcrumb.vue.d.ts +35 -0
  89. package/dist-types/components/c-breadcrumb/fit.d.ts +29 -0
  90. package/dist-types/components/c-breadcrumb-item/CBreadcrumbItem.vue.d.ts +31 -0
  91. package/dist-types/components/c-button/CButton.vue.d.ts +52 -63
  92. package/dist-types/components/c-button-group/CButtonGroup.vue.d.ts +16 -14
  93. package/dist-types/components/c-card/CCard.vue.d.ts +2 -3
  94. package/dist-types/components/c-card-actions/CCardActions.vue.d.ts +5 -7
  95. package/dist-types/components/c-card-title/CCardTitle.vue.d.ts +11 -1
  96. package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +33 -52
  97. package/dist-types/components/c-color-picker/CColorPicker.vue.d.ts +189 -0
  98. package/dist-types/components/c-color-picker/colors.d.ts +66 -0
  99. package/dist-types/components/c-csc-logo/CCscLogo.vue.d.ts +1 -3
  100. package/dist-types/components/c-data-table/CDataTable.vue.d.ts +75 -51
  101. package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +277 -0
  102. package/dist-types/components/c-date-picker/dates.d.ts +119 -0
  103. package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +51 -8
  104. package/dist-types/components/c-file-upload/CFileUpload.vue.d.ts +204 -0
  105. package/dist-types/components/c-file-upload/files.d.ts +99 -0
  106. package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +23 -36
  107. package/dist-types/components/c-input/CInput.vue.d.ts +21 -43
  108. package/dist-types/components/c-link/CLink.vue.d.ts +6 -14
  109. package/dist-types/components/c-list/CList.vue.d.ts +4 -6
  110. package/dist-types/components/c-list-item/CListItem.vue.d.ts +14 -19
  111. package/dist-types/components/c-list-item-title/CListItemTitle.vue.d.ts +3 -2
  112. package/dist-types/components/c-loader/CLoader.vue.d.ts +13 -29
  113. package/dist-types/components/c-login-button/CLoginButton.vue.d.ts +9 -9
  114. package/dist-types/components/c-login-card/CLoginCard.vue.d.ts +11 -16
  115. package/dist-types/components/c-login-card-actions/CLoginCardActions.vue.d.ts +5 -7
  116. package/dist-types/components/c-login-card-title/CLoginCardTitle.vue.d.ts +11 -1
  117. package/dist-types/components/c-main/CMain.vue.d.ts +12 -5
  118. package/dist-types/components/c-menu/CMenu.vue.d.ts +17 -16
  119. package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +27 -35
  120. package/dist-types/components/c-message/CMessage.vue.d.ts +5 -15
  121. package/dist-types/components/c-modal/CModal.vue.d.ts +3 -3
  122. package/dist-types/components/c-navigation-button/CNavigationButton.vue.d.ts +20 -1
  123. package/dist-types/components/c-number-field/CNumberField.vue.d.ts +169 -0
  124. package/dist-types/components/c-number-field/numbers.d.ts +58 -0
  125. package/dist-types/components/c-option/COption.vue.d.ts +1 -1
  126. package/dist-types/components/c-otp-input/COtpInput.vue.d.ts +16 -30
  127. package/dist-types/components/c-page/CPage.vue.d.ts +2 -3
  128. package/dist-types/components/c-pagination/CPagination.vue.d.ts +56 -26
  129. package/dist-types/components/c-popover/CPopover.vue.d.ts +11 -7
  130. package/dist-types/components/c-progress-bar/CProgressBar.vue.d.ts +10 -14
  131. package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +7 -7
  132. package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +11 -8
  133. package/dist-types/components/c-select/CSelect.vue.d.ts +119 -35
  134. package/dist-types/components/c-side-navigation/CSideNavigation.vue.d.ts +10 -18
  135. package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +22 -14
  136. package/dist-types/components/c-slider/CSlider.vue.d.ts +29 -73
  137. package/dist-types/components/c-spinner/CSpinner.vue.d.ts +4 -8
  138. package/dist-types/components/c-status/CStatus.vue.d.ts +8 -9
  139. package/dist-types/components/c-step/CStep.vue.d.ts +6 -4
  140. package/dist-types/components/c-steps/CSteps.vue.d.ts +3 -7
  141. package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +23 -17
  142. package/dist-types/components/c-switch/CSwitch.vue.d.ts +17 -30
  143. package/dist-types/components/c-tab/CTab.vue.d.ts +11 -28
  144. package/dist-types/components/c-tab-buttons/CTabButtons.vue.d.ts +11 -13
  145. package/dist-types/components/c-tab-item/CTabItem.vue.d.ts +4 -5
  146. package/dist-types/components/c-tab-items/CTabItems.vue.d.ts +5 -4
  147. package/dist-types/components/c-table/CTable.vue.d.ts +7 -7
  148. package/dist-types/components/c-tabs/CTabs.vue.d.ts +13 -20
  149. package/dist-types/components/c-tag/CTag.vue.d.ts +22 -21
  150. package/dist-types/components/c-tags/CTags.vue.d.ts +9 -10
  151. package/dist-types/components/c-text-field/CTextField.vue.d.ts +74 -77
  152. package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +205 -0
  153. package/dist-types/components/c-time-picker/times.d.ts +82 -0
  154. package/dist-types/components/c-toast/CToast.vue.d.ts +3 -4
  155. package/dist-types/components/c-toast/swipe.d.ts +40 -0
  156. package/dist-types/components/c-toasts/CToasts.vue.d.ts +14 -16
  157. package/dist-types/components/c-toolbar/CToolbar.vue.d.ts +10 -1
  158. package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +12 -8
  159. package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +257 -0
  160. package/dist-types/index.d.ts +41 -32
  161. package/dist-types/registry.d.ts +9 -0
  162. package/dist-types/shared/FieldMessage.vue.d.ts +8 -5
  163. package/dist-types/shared/PanelHeadingRow.vue.d.ts +13 -0
  164. package/dist-types/shared/SelectionIndicator.vue.d.ts +21 -0
  165. package/dist-types/shared/TypedField.vue.d.ts +48 -0
  166. package/dist-types/shared/appDefaults.d.ts +75 -0
  167. package/dist-types/shared/defineElement.d.ts +1 -0
  168. package/dist-types/shared/inputMask.d.ts +106 -0
  169. package/dist-types/shared/lightDismiss.d.ts +35 -0
  170. package/dist-types/shared/modalStack.d.ts +4 -3
  171. package/dist-types/shared/navigationDrawer.d.ts +4 -0
  172. package/dist-types/shared/optionLabel.d.ts +18 -0
  173. package/dist-types/shared/pageLock.d.ts +26 -0
  174. package/dist-types/shared/peekCap.d.ts +35 -0
  175. package/dist-types/shared/popoverChain.d.ts +13 -10
  176. package/dist-types/shared/positionArea.d.ts +9 -4
  177. package/dist-types/shared/reducedMotion.d.ts +10 -0
  178. package/dist-types/shared/selectAll.d.ts +29 -0
  179. package/dist-types/shared/splitMatches.d.ts +18 -0
  180. package/dist-types/shared/useAnchoredPanel.d.ts +107 -0
  181. package/dist-types/shared/useControlAttrs.d.ts +8 -0
  182. package/dist-types/shared/useDesignatedTrigger.d.ts +5 -4
  183. package/dist-types/shared/useFallbackPosition.d.ts +71 -0
  184. package/dist-types/shared/useHostEmit.d.ts +38 -0
  185. package/dist-types/shared/useIdReferences.d.ts +39 -0
  186. package/dist-types/shared/useKeyboardModality.d.ts +7 -0
  187. package/dist-types/shared/useNarrowViewport.d.ts +19 -0
  188. package/dist-types/shared/useScrollStrip.d.ts +39 -0
  189. package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
  190. package/dist-types/shared/useTypedField.d.ts +108 -0
  191. package/dist-types/shared/valueEvents.d.ts +41 -0
  192. package/dist-types/shared/visualViewport.d.ts +51 -0
  193. package/dist-types/tag-name-map.d.ts +1572 -672
  194. package/dist-types/theme/applyTheme.d.ts +6 -6
  195. package/dist-types/theme/chart-data.d.ts +51 -0
  196. package/dist-types/theme/ramp.d.ts +38 -0
  197. package/dist-types/theme/themeMode.d.ts +51 -0
  198. package/dist-types/types.d.ts +7 -11
  199. package/package.json +32 -21
  200. package/dist/css-anchor-positioning-fn-RTxo68pt.js +0 -6447
  201. package/dist/docs/c-toast/usage.md +0 -1
  202. package/dist-types/shared/anchorPolyfill.d.ts +0 -24
  203. package/dist-types/shared/emitModelValue.d.ts +0 -37
@@ -3,31 +3,40 @@ import type { CFieldSize } from '../../types';
3
3
  * Native `autocapitalize` behaviour of the input.
4
4
  */
5
5
  export type CTextFieldAutocapitalize = 'characters' | 'none' | 'off' | 'on' | 'sentences' | 'words';
6
- export interface CTextFieldProps {
6
+ /**
7
+ * Type of the input. `password` gets a reveal toggle, `date` a picker button,
8
+ * `number` honours `min`/`max`/`step`; the rest map straight to the native
9
+ * input type.
10
+ */
11
+ export type CTextFieldType = 'date' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';
12
+ interface CTextFieldProps {
7
13
  /**
8
- * HTML input autocomplete
14
+ * How on-screen keyboards capitalize typed text, as the native
15
+ * `autocapitalize` attribute; unset leaves the browser's default
16
+ */
17
+ autocapitalize?: CTextFieldAutocapitalize;
18
+ /**
19
+ * The browser's autofill hint, as the native `autocomplete` attribute
20
+ * (`email`, `new-password`, `off`…)
9
21
  *
10
- * @seeded from csc-ui — verify
11
22
  * @freeform any HTML autocomplete token list
12
23
  */
13
24
  autocomplete?: string;
14
25
  /**
15
26
  * Enable native input autocorrection (Safari). Maps to the input's
16
27
  * `autocorrect="on"`/`"off"` attribute; left unset (browser default per
17
- * input type) when not specified. Mirrors the platform
28
+ * input type) when not specified. The attribute takes the native values
29
+ * (`autocorrect="off"`), the property also the platform's
18
30
  * `HTMLElement.autocorrect` boolean.
19
31
  */
20
- autocorrect?: boolean;
32
+ autocorrect?: 'off' | 'on' | boolean;
21
33
  /**
22
- * HTML input autocapitalize
23
- *
24
- * @seeded from csc-ui — verify
34
+ * Focus the input when the field mounts, as the native `autofocus` does —
35
+ * which is not honoured inside a shadow root.
25
36
  */
26
- automaticCapitalize?: CTextFieldAutocapitalize;
37
+ autofocus?: boolean;
27
38
  /**
28
39
  * Disable the input
29
- *
30
- * @seeded from csc-ui — verify
31
40
  */
32
41
  disabled?: boolean;
33
42
  /**
@@ -39,152 +48,140 @@ export interface CTextFieldProps {
39
48
  /**
40
49
  * Hide the hint and error messages
41
50
  *
42
- * @seeded from csc-ui — verify
51
+ * @defaultable false
43
52
  */
44
53
  hideDetails?: boolean;
45
54
  /**
46
55
  * Hint text for the input
47
56
  *
48
- * @seeded from csc-ui — verify
49
57
  * @freeform
50
58
  */
51
59
  hint?: string;
52
60
  /**
53
- * Id of the input
54
- *
55
- * @seeded from csc-ui — verify
56
- * @freeform
61
+ * Show the control as invalid: its `error-message`, when set, replaces the
62
+ * hint, and the control is marked `aria-invalid`.
57
63
  */
58
- hostId?: string;
64
+ invalid?: boolean;
59
65
  /**
60
66
  * Label of the input
61
67
  *
62
- * @seeded from csc-ui — verify
63
68
  * @freeform
64
69
  */
65
70
  label?: string;
66
71
  /**
67
72
  * Label on top of the input
68
73
  *
69
- * @seeded from csc-ui — verify
74
+ * @defaultable false
70
75
  */
71
76
  labelOnTop?: boolean;
72
77
  /**
73
- * Maximum value on a numeric input
78
+ * Input mask the typed text follows: `#` a digit, `A` a letter, `*` a letter or a digit, `\` escapes the next character, `[…]` wraps a trailing optional section, anything else is a literal. Applies to a single-line `text`, `tel` or `search` field
74
79
  *
75
- * @seeded from csc-ui — verify
80
+ * @freeform a mask pattern, e.g. `+358 ## ### ####`
81
+ */
82
+ mask?: string;
83
+ /**
84
+ * Largest value of a `type="number"` field, as the native `max` attribute
76
85
  */
77
86
  max?: null | number;
78
87
  /**
79
- * Minimum value on a numeric input
80
- *
81
- * @seeded from csc-ui — verify
88
+ * Smallest value of a `type="number"` field, as the native `min` attribute
82
89
  */
83
90
  min?: null | number;
84
91
  /**
85
- * Name of the input
92
+ * `name` of the inner input. The component is not form-associated, so it
93
+ * does not submit with a `<form>`.
86
94
  *
87
- * @seeded from csc-ui — verify
88
95
  * @freeform
89
96
  */
90
97
  name?: string;
91
98
  /**
92
- * Placeholder of the input
99
+ * Placeholder of the input. Beside a floating `label` it shows only while
100
+ * the field is focused; under a `mask` it replaces the mask guide
93
101
  *
94
- * @seeded from csc-ui — verify
95
102
  * @freeform
96
103
  */
97
104
  placeholder?: string;
98
105
  /**
99
- * Mark as readonly
100
- *
101
- * @seeded from csc-ui — verify
106
+ * Make the input read-only: its text can be selected and copied but not
107
+ * edited
102
108
  */
103
109
  readonly?: boolean;
104
110
  /**
105
111
  * Set the input as required
106
- *
107
- * @seeded from csc-ui — verify
108
112
  */
109
113
  required?: boolean;
110
114
  /**
111
- * Rows on the input
112
- *
113
- * @seeded from csc-ui — verify
115
+ * Number of text lines the field shows; above `1` it becomes a multi-line
116
+ * textarea
114
117
  */
115
118
  rows?: number;
116
119
  /**
117
- * Shadow variant of the input
120
+ * Draw the field as a raised, drop-shadowed box instead of an outlined one
118
121
  *
119
- * @seeded from csc-ui — verify
122
+ * @defaultable false
120
123
  */
121
124
  shadow?: boolean;
122
- /** Field height: the 44px default or the 36px `small` box (single-line fields) */
123
- size?: CFieldSize;
124
125
  /**
125
- * Step size on a numeric input
126
+ * Field height: the 52px default (the shared control height) or the 36px `small` box (single-line fields)
126
127
  *
127
- * @seeded from csc-ui — verify
128
+ * @defaultable 'default'
129
+ */
130
+ size?: CFieldSize;
131
+ /**
132
+ * Step of a `type="number"` field, as the native `step` attribute
128
133
  */
129
134
  step?: null | number;
130
135
  /**
131
- * Trim whitespace from the return value
132
- *
133
- * @seeded from csc-ui — verify
136
+ * Trim leading and trailing whitespace from the emitted text, and from the
137
+ * shown text when the field is left
134
138
  */
135
139
  trimWhitespace?: boolean;
136
140
  /**
137
- * Type of the input
138
- *
139
- * @seeded from csc-ui — verify
141
+ * The native input type: `password` adds a toggle that reveals the text,
142
+ * `date` a button that opens the browser's date picker, and `number` honours
143
+ * `min`, `max` and `step`
140
144
  */
141
145
  type?: CTextFieldType;
142
146
  /**
143
- * Set the validity of the input
147
+ * The text in the field; under a `mask`, the text as shown, literals
148
+ * included
144
149
  *
145
- * @seeded from csc-ui — verify
146
- */
147
- valid?: boolean;
148
- /**
149
- * Value of the input
150
- *
151
- * @seeded from csc-ui — verify
152
150
  * @freeform
153
151
  */
154
152
  value?: string;
155
153
  }
156
- /**
157
- * Type of the input. `password` gets a reveal toggle, `date` a picker button,
158
- * `number` honours `min`/`max`/`step`; the rest map straight to the native
159
- * input type.
160
- */
161
- export type CTextFieldType = 'date' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';
162
154
  declare const _default: typeof __VLS_export;
163
155
  export default _default;
164
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CTextFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTextFieldProps> & Readonly<{}>, {
156
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CTextFieldProps, {
157
+ focus: (options?: FocusOptions) => void;
158
+ maskComplete: import("vue").ComputedRef<boolean>;
159
+ unmaskedValue: import("vue").ComputedRef<string>;
160
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTextFieldProps> & Readonly<{}>, {
165
161
  label: string;
162
+ mask: string;
163
+ invalid: boolean;
164
+ name: string;
166
165
  value: string;
167
166
  type: CTextFieldType;
168
- name: string;
167
+ rows: number;
168
+ size: CFieldSize;
169
+ hideDetails: boolean;
170
+ labelOnTop: boolean;
171
+ shadow: boolean;
172
+ step: null | number;
169
173
  disabled: boolean;
170
174
  errorMessage: string;
171
- hideDetails: boolean;
172
175
  hint: string;
173
- hostId: string;
174
- labelOnTop: boolean;
175
176
  placeholder: string;
176
177
  required: boolean;
177
- shadow: boolean;
178
- size: CFieldSize;
179
- valid: boolean;
180
- autocomplete: string;
181
- readonly: boolean;
182
- autocorrect: boolean;
178
+ autocapitalize: CTextFieldAutocapitalize;
179
+ autocorrect: "off" | "on" | boolean;
180
+ autofocus: boolean;
183
181
  max: null | number;
184
182
  min: null | number;
185
- step: null | number;
186
- automaticCapitalize: CTextFieldAutocapitalize;
187
- rows: number;
183
+ readonly: boolean;
184
+ autocomplete: string;
188
185
  trimWhitespace: boolean;
189
186
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
190
187
  pre?: (props: {}) => any;
@@ -0,0 +1,205 @@
1
+ import type { CFieldSize } from '../../types';
2
+ /** A time range: ISO `HH:mm` ends, either of which may be `null` while only one is typed; an end before the start spans midnight. */
3
+ export interface CTimePickerRange {
4
+ /** The end of the range; earlier than the start for an overnight range. */
5
+ end: null | string;
6
+ /** The start of the range. */
7
+ start: null | string;
8
+ }
9
+ /**
10
+ * The text committed from the field, as typed: a string, or both ends'
11
+ * texts under `range`.
12
+ */
13
+ export type CTimePickerText = {
14
+ end: string;
15
+ start: string;
16
+ } | string;
17
+ /**
18
+ * UI texts of `c-time-picker`, merged key by key over the AM/PM texts
19
+ * `Intl` gives for the page's `lang` and the English defaults.
20
+ */
21
+ export interface CTimePickerTexts {
22
+ /** The period before noon in a 12-hour `format`. */
23
+ am?: string;
24
+ /** Accessible name of the dialog when the field has no label. */
25
+ chooseTime?: string;
26
+ /** Accessible label of the clear button. */
27
+ clearSelection?: string;
28
+ /** Accessible label of the close button in the fullscreen panel (narrow viewports). */
29
+ closePanel?: string;
30
+ /** Label of the Done button in the fullscreen panel (narrow viewports). */
31
+ done?: string;
32
+ /** Name of the end input and the end tab under `range`. */
33
+ end?: string;
34
+ /** Accessible name of the hour column. */
35
+ hours?: string;
36
+ /** Accessible name of the minute column. */
37
+ minutes?: string;
38
+ /** Label of the Now button (`show-now`). */
39
+ now?: string;
40
+ /** Accessible label of the clock button. */
41
+ openClock?: string;
42
+ /** Accessible name of the AM/PM column. */
43
+ period?: string;
44
+ /** The period from noon in a 12-hour `format`. */
45
+ pm?: string;
46
+ /** Name of the start input and the start tab under `range`. */
47
+ start?: string;
48
+ }
49
+ /**
50
+ * Value of `c-time-picker`: an ISO `HH:mm` string, a
51
+ * {@link CTimePickerRange} under `range`, or `null` when empty.
52
+ */
53
+ export type CTimePickerValue = CTimePickerRange | null | string;
54
+ interface CTimePickerProps {
55
+ /**
56
+ * Make the value clearable
57
+ */
58
+ clearable?: boolean;
59
+ /**
60
+ * Disable the field
61
+ */
62
+ disabled?: boolean;
63
+ /**
64
+ * Error message shown in place of the hint while the field is invalid
65
+ *
66
+ * @freeform
67
+ */
68
+ errorMessage?: string;
69
+ /**
70
+ * How times are shown and read from typing: a pattern of the tokens `H`,
71
+ * `HH` (24-hour), `h`, `hh` (12-hour, with the period `a`) and `mm` with
72
+ * any separators, e.g. `HH:mm` or `h:mm a`
73
+ *
74
+ * @defaultable 'HH.mm'
75
+ * @freeform
76
+ */
77
+ format?: string;
78
+ /**
79
+ * Hide the hint and error messages
80
+ *
81
+ * @defaultable false
82
+ */
83
+ hideDetails?: boolean;
84
+ /**
85
+ * Hint text for the field
86
+ *
87
+ * @freeform
88
+ */
89
+ hint?: string;
90
+ /**
91
+ * Show the control as invalid: its `error-message`, when set, replaces the
92
+ * hint, and the control is marked `aria-invalid`.
93
+ */
94
+ invalid?: boolean;
95
+ /**
96
+ * Element label
97
+ *
98
+ * @freeform
99
+ */
100
+ label?: string;
101
+ /**
102
+ * Label on top of the field
103
+ *
104
+ * @defaultable false
105
+ */
106
+ labelOnTop?: boolean;
107
+ /**
108
+ * The latest time that can be picked or typed, as an ISO `HH:mm` time
109
+ *
110
+ * @freeform
111
+ */
112
+ max?: string;
113
+ /**
114
+ * The earliest time that can be picked or typed, as an ISO `HH:mm` time;
115
+ * a `min` after `max` is invalid and both are ignored
116
+ *
117
+ * @freeform
118
+ */
119
+ min?: string;
120
+ /**
121
+ * Minutes between the minute column's rows; typed times need not fall on
122
+ * the step
123
+ */
124
+ minuteStep?: number;
125
+ /**
126
+ * Input field name
127
+ *
128
+ * @freeform
129
+ */
130
+ name?: string;
131
+ /**
132
+ * Placeholder of the input; the `format` pattern when empty
133
+ *
134
+ * @freeform
135
+ */
136
+ placeholder?: string;
137
+ /**
138
+ * Pick a range: the value becomes `{ start, end }` and the field holds two
139
+ * inputs
140
+ */
141
+ range?: boolean;
142
+ /**
143
+ * Set the field as required
144
+ */
145
+ required?: boolean;
146
+ /**
147
+ * Shadow variant
148
+ *
149
+ * @defaultable false
150
+ */
151
+ shadow?: boolean;
152
+ /**
153
+ * Show a Now button under the columns that commits the current time
154
+ *
155
+ * @defaultable false
156
+ */
157
+ showNow?: boolean;
158
+ /**
159
+ * Field height: the 52px default (the shared control height) or the 36px `small` box
160
+ *
161
+ * @defaultable 'default'
162
+ */
163
+ size?: CFieldSize;
164
+ /**
165
+ * UI text overrides (i18n), merged over the AM/PM texts `Intl` gives for
166
+ * the page's `lang` and the English defaults. Objects have no attribute
167
+ * form — bind as a DOM property
168
+ *
169
+ * @defaultable {}
170
+ */
171
+ texts?: CTimePickerTexts;
172
+ /**
173
+ * The time as an ISO `HH:mm` string on a 24-hour clock, or `{ start, end }`
174
+ * under `range`; `null` when empty
175
+ */
176
+ value?: CTimePickerValue;
177
+ }
178
+ declare const _default: typeof __VLS_export;
179
+ export default _default;
180
+ declare const __VLS_export: import("vue").DefineComponent<CTimePickerProps, {
181
+ badInput: import("vue").ComputedRef<boolean>;
182
+ focus: (options?: FocusOptions) => void;
183
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTimePickerProps> & Readonly<{}>, {
184
+ label: string;
185
+ invalid: boolean;
186
+ name: string;
187
+ value: CTimePickerValue;
188
+ size: CFieldSize;
189
+ texts: CTimePickerTexts;
190
+ hideDetails: boolean;
191
+ labelOnTop: boolean;
192
+ shadow: boolean;
193
+ format: string;
194
+ showNow: boolean;
195
+ clearable: boolean;
196
+ disabled: boolean;
197
+ errorMessage: string;
198
+ hint: string;
199
+ placeholder: string;
200
+ required: boolean;
201
+ max: string;
202
+ min: string;
203
+ range: boolean;
204
+ minuteStep: number;
205
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Time-of-day helpers for `c-time-picker` (ADR-0061). Pure functions over
3
+ * ISO `HH:mm` strings on a 24-hour clock — no seconds, no date, no zone.
4
+ * Arithmetic works in minutes since midnight.
5
+ */
6
+ import type { MaskSlot } from '../../shared/inputMask';
7
+ /** `min` / `max` in minutes since midnight; `null` where unbounded. */
8
+ export interface CTimePickerBounds {
9
+ max: null | number;
10
+ min: null | number;
11
+ }
12
+ /** The two period texts of a 12-hour format, as shown. */
13
+ export interface CTimePickerPeriods {
14
+ am: string;
15
+ pm: string;
16
+ }
17
+ export declare const isTime: (value: unknown) => value is string;
18
+ export declare const toMinutes: (time: string) => number;
19
+ export declare const fromMinutes: (minutes: number) => string;
20
+ /** The current local time, as ISO. */
21
+ export declare const nowTime: () => string;
22
+ /**
23
+ * Whether `pattern` is usable: one hour token then `mm`, a literal between
24
+ * them, and the period `a` exactly when the hour is 12-hour (`h`, `hh`) —
25
+ * before or after the time. No other letters. Anything else falls back to
26
+ * the built-in pattern.
27
+ */
28
+ export declare const isValidPattern: (pattern: string) => boolean;
29
+ /** Whether a valid pattern shows a 12-hour clock with a period. */
30
+ export declare const isTwelveHour: (pattern: string) => boolean;
31
+ /** Whether a valid pattern pads the hour to two digits. */
32
+ export declare const padsHour: (pattern: string) => boolean;
33
+ /** The hour as its column row shows it under `pattern`: `0`–`23`, or `12`, `1`–`11`. */
34
+ export declare const hourLabel: (hour24: number, pattern: string) => string;
35
+ export declare const formatTime: (time: string, pattern: string, periods: CTimePickerPeriods) => string;
36
+ /**
37
+ * Read typed text as a time (ADR-0061). Lenient: any run of `.`, `:` or
38
+ * spaces separates the hour from the minutes; a bare hour reads as on the
39
+ * hour (`9` → `09:00`); three or four digits split as hour and minutes
40
+ * (`930` → `09:30`); a minute of one digit is that minute (`9.3` →
41
+ * `09:03`). A period — the resolved AM/PM texts or English `a` / `p` —
42
+ * makes the hour 12-hour whatever the pattern; a 12-hour pattern also
43
+ * takes a 24-hour time, and reads an hour without a period as AM. Returns
44
+ * the ISO time, or `null`.
45
+ */
46
+ export declare const parseTime: (text: string, pattern: string, periods: CTimePickerPeriods) => null | string;
47
+ /**
48
+ * The input mask typing follows under a pattern (ADR-0061, ADR-0059): the
49
+ * hour and the minutes take one or two digits, closing early on a typed
50
+ * separator or on a first digit no two-digit value starts with (an hour
51
+ * 3–9, 2–9 on a 12-hour clock; a minute 6–9); the period is a word slot
52
+ * over the resolved AM/PM texts, so `p` shows the whole PM text. A
53
+ * separator of the pattern also accepts any of `. : space` typed in its
54
+ * place and shows as the pattern's own.
55
+ */
56
+ export declare const compileTimeMask: (pattern: string, periods: CTimePickerPeriods) => MaskSlot[];
57
+ /**
58
+ * `min` / `max` read as minutes. A bound that is not an ISO time is
59
+ * unbounded; `min` after `max` is invalid — `null` — not an overnight wrap.
60
+ */
61
+ export declare const readBounds: (min: unknown, max: unknown) => CTimePickerBounds | null;
62
+ export declare const inBounds: (minutes: number, b: CTimePickerBounds) => boolean;
63
+ export declare const clampToBounds: (minutes: number, b: CTimePickerBounds) => number;
64
+ /** Whether no minute of the hour (0–23) is inside the bounds. */
65
+ export declare const hourDisabled: (hour: number, b: CTimePickerBounds) => boolean;
66
+ /** Whether no minute of the half day is inside the bounds. */
67
+ export declare const periodDisabled: (period: "am" | "pm", b: CTimePickerBounds) => boolean;
68
+ /** The hour column's hours (0–23) in row order: `0…23`, or `1…11, 12` of one half day. */
69
+ export declare const hourRows: (twelve: boolean, pm?: boolean) => number[];
70
+ /**
71
+ * The minute column's minutes: every `step` from 0, plus `current` sorted in
72
+ * when it is off the step (ADR-0061: a step shapes the column, never the
73
+ * value). A step that is not a positive integer is 1.
74
+ */
75
+ export declare const minuteRows: (step: number, current: null | number) => number[];
76
+ /** The minute row nearest `minute` on the step, never past the last row. */
77
+ export declare const roundToStep: (minute: number, step: number) => number;
78
+ /**
79
+ * The AM/PM texts for `lang` from `Intl.DateTimeFormat`'s `dayPeriod` — the
80
+ * fallback under `texts` (ADR-0061). `null` without a language or `Intl`.
81
+ */
82
+ export declare const intlPeriods: (lang: string) => CTimePickerPeriods | null;
@@ -1,9 +1,8 @@
1
1
  import type { CToastMessage } from '../../types';
2
- export interface CToastProps {
2
+ interface CToastProps {
3
3
  /**
4
- * Messages
5
- *
6
- * @seeded from csc-ui — verify
4
+ * The message the toast shows: its text, heading, type, close button and
5
+ * timer. The parent `c-toasts` sets it.
7
6
  */
8
7
  message?: CToastMessage | null;
9
8
  }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The toast's **swipe dismiss** rules (CONTEXT.md, ADR-0073), kept free of the
3
+ * DOM so the node project can pin them down. The component feeds in pointer
4
+ * travel and samples; these decide when a press becomes a swipe, how faded the
5
+ * dragged toast is and whether letting go dismisses it.
6
+ */
7
+ /** Travel in px before a press decides between a swipe and the page's own gesture. */
8
+ export declare const SWIPE_SLOP_PX = 10;
9
+ /** Share of the toast's width past which a release dismisses. */
10
+ export declare const SWIPE_DISMISS_FRACTION: number;
11
+ /** Release speed in px/ms that dismisses however short the drag (a flick). */
12
+ export declare const SWIPE_FLICK_PX_PER_MS = 0.5;
13
+ /** How far back, in ms, the release velocity looks. */
14
+ export declare const SWIPE_VELOCITY_WINDOW_MS = 100;
15
+ /** What a press is after travelling `dx`, `dy`: still undecided, a swipe, or the page's. */
16
+ export type CToastSwipeIntent = 'claim' | 'pending' | 'release';
17
+ /** One pointer position on the swipe axis, stamped with the event's `timeStamp`. */
18
+ export interface CToastSwipeSample {
19
+ t: number;
20
+ x: number;
21
+ }
22
+ export declare const swipeIntent: (dx: number, dy: number) => CToastSwipeIntent;
23
+ /**
24
+ * Velocity in px/ms over the samples inside the window ending at `now`. Fewer
25
+ * than two samples, or no time between them (synthetic events can share a
26
+ * coarsened stamp), read as standing still.
27
+ */
28
+ export declare const swipeVelocity: (samples: readonly CToastSwipeSample[], now: number) => number;
29
+ /**
30
+ * Whether a release at offset `dx` moving at `velocity` dismisses: a flick
31
+ * along the drag always does and a flick back toward rest never does;
32
+ * otherwise the toast must be past the threshold.
33
+ */
34
+ export declare const swipeOutcome: ({ dx, velocity, width, }: {
35
+ dx: number;
36
+ velocity: number;
37
+ width: number;
38
+ }) => "dismiss" | "return";
39
+ /** The dragged toast's opacity at offset `dx`. */
40
+ export declare const swipeOpacity: (dx: number, width: number) => number;
@@ -3,38 +3,36 @@ import type { CToastMessage } from '../../types';
3
3
  * Horizontal placement of the toast stack.
4
4
  */
5
5
  export type CToastsHorizontal = 'center' | 'left' | 'right';
6
- export interface CToastsProps {
6
+ /**
7
+ * Vertical placement of the toast stack.
8
+ */
9
+ export type CToastsVertical = 'bottom' | 'top';
10
+ interface CToastsProps {
7
11
  /**
8
- * Use absolute positioning
9
- *
10
- * @seeded from csc-ui — verify
12
+ * Places the stack in its nearest positioned ancestor instead of the
13
+ * viewport, for in-container notifications. Such a stack is not
14
+ * guaranteed to paint above an open modal.
11
15
  */
12
16
  absolute?: boolean;
13
17
  /**
14
- * Horizontal position
15
- *
16
- * @seeded from csc-ui — verify
18
+ * Where the stack sits across the viewport, or across its container
19
+ * under `absolute`.
17
20
  */
18
21
  horizontal?: CToastsHorizontal;
19
22
  /**
20
- * Vertical position
21
- *
22
- * @seeded from csc-ui — verify
23
+ * The edge the stack is anchored to; toasts slide in from it.
23
24
  */
24
25
  vertical?: CToastsVertical;
25
26
  }
26
- /**
27
- * Vertical placement of the toast stack.
28
- */
29
- export type CToastsVertical = 'bottom' | 'top';
30
27
  declare const _default: typeof __VLS_export;
31
28
  export default _default;
32
29
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CToastsProps, {
33
- addToast: (message: CToastMessage) => void;
30
+ _toastLeaving: (toast: HTMLElement) => void;
31
+ addToast: (message: CToastMessage) => string | undefined;
34
32
  removeToast: (id: string) => void;
35
33
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CToastsProps> & Readonly<{}>, {
36
- vertical: CToastsVertical;
37
34
  absolute: boolean;
35
+ vertical: CToastsVertical;
38
36
  horizontal: CToastsHorizontal;
39
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
40
38
  default?: (props: {}) => any;
@@ -1,8 +1,17 @@
1
+ interface CToolbarProps {
2
+ /**
3
+ * Keep the toolbar in the page flow so it scrolls away with the content
4
+ * instead of staying pinned to the top of its scroll container
5
+ */
6
+ static?: boolean;
7
+ }
1
8
  declare var __VLS_1: {};
2
9
  type __VLS_Slots = {} & {
3
10
  default?: (props: typeof __VLS_1) => any;
4
11
  };
5
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
+ declare const __VLS_base: import("vue").DefineComponent<CToolbarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CToolbarProps> & Readonly<{}>, {
13
+ static: boolean;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
15
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
16
  declare const _default: typeof __VLS_export;
8
17
  export default _default;