@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
@@ -1,6 +1,12 @@
1
1
  type CDropdownItemType = 'item' | 'option';
2
2
  type CDropdownParentType = 'autocomplete' | 'select';
3
3
  interface CDropdownProps {
4
+ /**
5
+ * Accessible label of the fullscreen panel's close button (narrow viewports)
6
+ *
7
+ * @freeform
8
+ */
9
+ closeLabel?: string;
4
10
  /** Whether items are <c-option> elements or plain objects */
5
11
  dropdownItemType?: CDropdownItemType;
6
12
  /**
@@ -9,31 +15,63 @@ interface CDropdownProps {
9
15
  * @freeform
10
16
  */
11
17
  hostId?: string;
12
- /** Current highlighted index */
18
+ /** Current highlighted index; `-1` (`SELECT_ALL_INDEX`) is the select-all row */
13
19
  index?: null | number;
14
20
  /** Dropdown options: a NodeList of <c-option> or an array of items */
15
21
  items?: ArrayLike<DropdownItem>;
16
22
  /** Items per page before adding scroll */
17
23
  itemsPerPage?: number;
24
+ /**
25
+ * The parent field's label, shown as the fullscreen panel's heading (narrow viewports)
26
+ *
27
+ * @freeform
28
+ */
29
+ label?: string;
30
+ /**
31
+ * Multi-select mode: rows toggle instead of committing, each carries a
32
+ * decorative checkbox indicator, and the listbox is `aria-multiselectable`
33
+ */
34
+ multiple?: boolean;
18
35
  /** Dropdown parent (the c-select / c-autocomplete host element) */
19
36
  parent?: HTMLElement | null;
37
+ /**
38
+ * The select-all row in `multiple` mode, as the parent computes it (label,
39
+ * tri-state, counts for the live region); `null` renders no row
40
+ */
41
+ selectAllRow?: CDropdownSelectAllRow | null;
42
+ /**
43
+ * Values of the currently selected items — the picked values in `multiple`
44
+ * mode, the single value otherwise; drives each row's `aria-selected`, its
45
+ * indicator and the single-mode selected-row check
46
+ */
47
+ selected?: (number | string)[];
20
48
  /** Parent type — drives autocomplete-only behaviour (highlight, messages) */
21
49
  type?: CDropdownParentType;
22
50
  }
51
+ /**
52
+ * The select-all row as the parent computes it (ADR-0046): the label, the
53
+ * indicator's tri-state and the counts the live region speaks.
54
+ */
55
+ interface CDropdownSelectAllRow {
56
+ label: string;
57
+ selected: number;
58
+ state: 'all' | 'none' | 'some';
59
+ total: number;
60
+ }
23
61
  type DropdownItem = {
24
- disabled?: boolean;
62
+ disabled?: boolean | string;
25
63
  name: string;
26
64
  outerHTML?: string;
27
65
  selected?: boolean;
28
66
  value: number | string;
29
67
  };
30
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
68
+ declare var __VLS_1: {}, __VLS_10: {}, __VLS_27: {};
31
69
  type __VLS_Slots = {} & {
32
70
  default?: (props: typeof __VLS_1) => any;
33
71
  } & {
34
- 'input-top'?: (props: typeof __VLS_3) => any;
72
+ 'input-top'?: (props: typeof __VLS_10) => any;
35
73
  } & {
36
- 'input-bottom'?: (props: typeof __VLS_5) => any;
74
+ 'input-bottom'?: (props: typeof __VLS_27) => any;
37
75
  };
38
76
  declare const __VLS_base: import("vue").DefineComponent<CDropdownProps, {
39
77
  close: () => void;
@@ -43,12 +81,17 @@ declare const __VLS_base: import("vue").DefineComponent<CDropdownProps, {
43
81
  setStatusText: (text: string) => void;
44
82
  updateList: (reset?: boolean) => void;
45
83
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CDropdownProps> & Readonly<{}>, {
84
+ label: string;
46
85
  type: CDropdownParentType;
47
- hostId: string;
48
- items: ArrayLike<DropdownItem>;
86
+ multiple: boolean;
49
87
  itemsPerPage: number;
50
- dropdownItemType: CDropdownItemType;
51
88
  index: null | number;
89
+ items: ArrayLike<DropdownItem>;
90
+ selected: (number | string)[];
91
+ closeLabel: string;
92
+ selectAllRow: CDropdownSelectAllRow | null;
93
+ dropdownItemType: CDropdownItemType;
94
+ hostId: string;
52
95
  parent: HTMLElement | null;
53
96
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
97
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -0,0 +1,204 @@
1
+ import type { CFieldSize } from '../../types';
2
+ /** The second argument of an upload function. */
3
+ export interface CFileUploadContext {
4
+ /** The entry's id. */
5
+ id: string;
6
+ /** Report progress as a fraction from 0 to 1; the row stays indeterminate until the first call. */
7
+ onProgress: (fraction: number) => void;
8
+ /** Aborted when the user cancels, the entry is removed, or the field unmounts. */
9
+ signal: AbortSignal;
10
+ }
11
+ /** One file a `c-file-upload` holds (CONTEXT.md "File entry"). */
12
+ export interface CFileUploadEntry {
13
+ /** The rejection text shown for a failed upload. */
14
+ error?: string;
15
+ /** The browser file, for a file the user added. Absent on a server file. */
16
+ file?: File;
17
+ /** Stable identity: generated for an added file, the consumer's own for a server file. */
18
+ id: string;
19
+ /** The file name. */
20
+ name: string;
21
+ /** What the upload function resolved to. */
22
+ result?: unknown;
23
+ /** The size in bytes. */
24
+ size: number;
25
+ /** Where the entry stands. */
26
+ status: CFileUploadStatus;
27
+ /** The media type, as the browser reported it. */
28
+ type?: string;
29
+ }
30
+ /** Sends one file; resolves to the entry's `result` or rejects to mark it failed. */
31
+ export type CFileUploadFunction = (file: File, context: CFileUploadContext) => Promise<unknown>;
32
+ /** One rejected file, as the `reject` event reports it. */
33
+ export interface CFileUploadRejection {
34
+ /** The refused file. */
35
+ file: File;
36
+ /** Why it was refused. */
37
+ reason: CFileUploadRejectReason;
38
+ }
39
+ /** Why a file was rejected. */
40
+ export type CFileUploadRejectReason = 'count' | 'duplicate' | 'folder' | 'size' | 'type';
41
+ /** Where a file entry stands (CONTEXT.md "Upload status"). */
42
+ export type CFileUploadStatus = 'done' | 'error' | 'local' | 'queued' | 'uploading';
43
+ /** UI texts of `c-file-upload`, merged key by key over the English defaults. */
44
+ export interface CFileUploadTexts {
45
+ /** Announced after an add, with the number of files added. */
46
+ announceAdded?: (count: number) => string;
47
+ /** Announced when an upload fails, with the file name and the row's error text. */
48
+ announceFailed?: (name: string, error: string) => string;
49
+ /** Announced for a rejected file, with its name and the reason text. */
50
+ announceRejected?: (name: string, reason: string) => string;
51
+ /** Announced when an upload is done, with the file name. */
52
+ announceUploaded?: (name: string) => string;
53
+ /** Accessible label of a queued or uploading row's cancel button. */
54
+ cancel?: (name: string) => string;
55
+ /** The link-styled end of the large drop zone's prompt. */
56
+ choose?: (multiple: boolean) => string;
57
+ /** The compact row's button, and the large drop zone's prompt on a touch screen. */
58
+ chooseButton?: (multiple: boolean) => string;
59
+ /** Accessible label of a rejected row's close button. */
60
+ close?: (name: string) => string;
61
+ /** The compact row's prompt beside its button. */
62
+ compactPrompt?: (multiple: boolean) => string;
63
+ /** The large drop zone's prompt before the choose link. */
64
+ dragPrompt?: (multiple: boolean) => string;
65
+ /** The drop zone's prompt while files are dragged over the field. */
66
+ dropActive?: (multiple: boolean) => string;
67
+ /** An uploading row's status: bytes sent, file size (both formatted) and the whole percentage. */
68
+ progress?: (loaded: string, total: string, percent: number) => string;
69
+ /** A queued row's status. */
70
+ queued?: string;
71
+ /** Rejection reason: a file beyond the count the field holds. */
72
+ rejectedCount?: (max: number) => string;
73
+ /** Rejection reason: a file the field already holds. */
74
+ rejectedDuplicate?: string;
75
+ /** Rejection reason: a dropped folder. */
76
+ rejectedFolder?: string;
77
+ /** Rejection reason: a file over `max-size`, with the formatted limit. */
78
+ rejectedSize?: (max: string) => string;
79
+ /** Rejection reason: a type outside `accept`. */
80
+ rejectedType?: string;
81
+ /** Accessible label of a row's remove button. */
82
+ remove?: (name: string) => string;
83
+ /** Accessible label of a failed row's retry button. */
84
+ retry?: (name: string) => string;
85
+ /** Accessible name of a done row's check mark. */
86
+ uploaded?: string;
87
+ /** A failed row's status when the upload function gave no message. */
88
+ uploadFailed?: string;
89
+ /** An uploading row's status before the first progress report. */
90
+ uploading?: string;
91
+ }
92
+ interface CFileUploadProps {
93
+ /**
94
+ * The file types the field takes, in the native `accept` syntax: extensions (`.pdf`) and media types (`image/*`, `application/json`), comma separated. It filters the file dialog and is checked again on a drop
95
+ *
96
+ * @freeform
97
+ */
98
+ accept?: string;
99
+ /**
100
+ * Show the drop zone as a control-height row — a "Choose files" button and a drop prompt — that lines up with the fields beside it
101
+ *
102
+ * @defaultable false
103
+ */
104
+ compact?: boolean;
105
+ /**
106
+ * Disable the field. Uploads already running continue
107
+ */
108
+ disabled?: boolean;
109
+ /**
110
+ * Error message shown in place of the hint while the field is invalid
111
+ *
112
+ * @freeform
113
+ */
114
+ errorMessage?: string;
115
+ /**
116
+ * Hide the hint and error messages
117
+ *
118
+ * @defaultable false
119
+ */
120
+ hideDetails?: boolean;
121
+ /**
122
+ * Hint text under the drop zone — the place to name the accepted types and limits
123
+ *
124
+ * @freeform
125
+ */
126
+ hint?: string;
127
+ /**
128
+ * Show the control as invalid: its `error-message`, when set, replaces the
129
+ * hint, and the control is marked `aria-invalid`.
130
+ */
131
+ invalid?: boolean;
132
+ /**
133
+ * Label of the field
134
+ *
135
+ * @freeform
136
+ */
137
+ label?: string;
138
+ /**
139
+ * Hold added files as `local` even with an upload function, until `startUploads()` queues them — for a form that uploads on its own button. Files added after the call wait for the next one
140
+ */
141
+ manual?: boolean;
142
+ /**
143
+ * The most file entries a `multiple` field holds; files beyond it are rejected
144
+ */
145
+ maxFiles?: null | number;
146
+ /**
147
+ * The largest file in bytes; a larger one is rejected. Sizes are shown in decimal units, so write the limit in decimal bytes (`10000000` reads "10 MB")
148
+ */
149
+ maxSize?: null | number;
150
+ /**
151
+ * Let a pick or a drop add several files. Without it the field holds one file and a new pick replaces it; the value is a list either way
152
+ */
153
+ multiple?: boolean;
154
+ /**
155
+ * Set the field as required
156
+ */
157
+ required?: boolean;
158
+ /**
159
+ * Height of the `compact` row: the 52px default (the shared control height) or the 36px `small` row. The large drop zone has one size
160
+ *
161
+ * @defaultable 'default'
162
+ */
163
+ size?: CFieldSize;
164
+ /**
165
+ * UI text overrides (i18n), merged over the English defaults. Objects have no attribute form — bind as a DOM property
166
+ *
167
+ * @defaultable {}
168
+ */
169
+ texts?: CFileUploadTexts;
170
+ /**
171
+ * The upload function: called once per added file with an abort signal and a progress callback taking a fraction from 0 to 1; what it resolves to becomes the entry's `result`, an `Error` it rejects with becomes the entry's `error` text. Without one the field only holds the files. A function — bind as a DOM property
172
+ */
173
+ upload?: CFileUploadFunction;
174
+ /**
175
+ * The file entries — always a list. A picked file's entry carries the browser `File`; a server file's entry is `{ id, name, size, status: 'done' }`. `''` reads as empty — what a plain `v-model` holding `null` writes. An array — bind as a DOM property
176
+ *
177
+ * @propertyonly
178
+ */
179
+ value?: CFileUploadEntry[] | null | string;
180
+ }
181
+ declare const _default: typeof __VLS_export;
182
+ export default _default;
183
+ declare const __VLS_export: import("vue").DefineComponent<CFileUploadProps, {
184
+ focus: (options?: FocusOptions) => void;
185
+ startUploads: () => void;
186
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CFileUploadProps> & Readonly<{}>, {
187
+ label: string;
188
+ invalid: boolean;
189
+ manual: boolean;
190
+ value: CFileUploadEntry[] | null | string;
191
+ multiple: boolean;
192
+ size: CFieldSize;
193
+ texts: CFileUploadTexts;
194
+ hideDetails: boolean;
195
+ compact: boolean;
196
+ disabled: boolean;
197
+ errorMessage: string;
198
+ hint: string;
199
+ required: boolean;
200
+ accept: string;
201
+ maxFiles: null | number;
202
+ maxSize: null | number;
203
+ upload: CFileUploadFunction;
204
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The pure half of `c-file-upload` (ADR-0071): `accept` matching, the decimal
3
+ * byte formatter, the file-type icon category, the name split that keeps an
4
+ * extension visible, the upload-error wording rule and the screening of one
5
+ * add into accepted and rejected files. No DOM — `files.node.spec.ts`.
6
+ */
7
+ /** The icon family a file belongs to (decision 19 of `_plan/c-file-upload.md`). */
8
+ export type FileCategory = 'archive' | 'audio' | 'code' | 'document' | 'generic' | 'image' | 'spreadsheet' | 'video';
9
+ /** The file facts these helpers read — a `File`, or a plain object in a node spec. */
10
+ export interface FileFacts {
11
+ /** Milliseconds since the epoch; a `File` always has it. */
12
+ lastModified?: number;
13
+ name: string;
14
+ size: number;
15
+ type: string;
16
+ }
17
+ /** Why a file was refused; mirrors the component's `CFileUploadRejectReason`. */
18
+ export type RejectReason = 'count' | 'duplicate' | 'folder' | 'size' | 'type';
19
+ /** The file's media type, else the one its extension suggests, else `''`; lowercase. */
20
+ export declare const mediaType: (file: Pick<FileFacts, "name" | "type">) => string;
21
+ /**
22
+ * Whether a file passes an `accept` list in the native syntax — `.pdf`,
23
+ * `image/*`, `application/json`, comma separated, case-insensitive. An empty
24
+ * list accepts everything. A drop bypasses the dialog's own filter, so every
25
+ * add is checked here.
26
+ */
27
+ export declare const matchesAccept: (file: Pick<FileFacts, "name" | "type">, accept: string) => boolean;
28
+ /** The icon family of a file, by media type and then by extension. */
29
+ export declare const fileCategory: (file: Pick<FileFacts, "name" | "type">) => FileCategory;
30
+ /**
31
+ * A file name split into the stem that may truncate and the extension that
32
+ * stays visible: `['quarterly-report', '.pdf']`. A dotfile, a name without a
33
+ * dot, or a "extension" that is really a word (`notes.final draft`) keeps the
34
+ * whole name as the stem.
35
+ */
36
+ export declare const splitName: (name: string) => [stem: string, extension: string];
37
+ /**
38
+ * A byte count in decimal SI units in the page's language: `482 kB`,
39
+ * `1.2 MB` (`fi`: `482 kt`, `1,2 Mt`). Kilobytes take no decimals, larger
40
+ * units one; a value that rounds to 1000 steps up a unit. Under a kilobyte
41
+ * the unit is spelled out (`512 bytes`, `512 tavua`) — ICU's short English
42
+ * byte is the odd `512 byte`.
43
+ */
44
+ export declare const formatBytes: (bytes: number, lang: string) => string;
45
+ /**
46
+ * The text a failed row shows: the rejection's own message when it is an
47
+ * `Error` the consumer threw, else `fallback`. A `TypeError` (fetch's
48
+ * "Failed to fetch") and a `DOMException` (an abort, an XHR failure) carry
49
+ * browser wording, so they fall back too.
50
+ */
51
+ export declare const uploadErrorText: (reason: unknown, fallback: string) => string;
52
+ /** One dropped or picked file, flagged when the drop says it is a folder. */
53
+ export interface Candidate<F extends FileFacts> {
54
+ file: F;
55
+ folder: boolean;
56
+ }
57
+ /**
58
+ * A file the field already holds: an entry's browser `File`, or a server
59
+ * file's name and size (it has no `lastModified`).
60
+ */
61
+ export interface HeldFile {
62
+ lastModified?: number;
63
+ name: string;
64
+ size: number;
65
+ }
66
+ /**
67
+ * Whether a new file is one the field already holds: the same name, size and
68
+ * last-modified time — a file picked again from the same folder. A server
69
+ * file, which has no last-modified time, matches on name and size.
70
+ */
71
+ export declare const isSameFile: (file: Pick<FileFacts, "lastModified" | "name" | "size">, held: HeldFile) => boolean;
72
+ export interface ScreenOptions {
73
+ /** The `accept` list. */
74
+ accept: string;
75
+ /** What the field already holds — checked for duplicates, and counted against `maxFiles`. */
76
+ held: readonly HeldFile[];
77
+ /** The most entries a `multiple` field holds; `null` for no cap. */
78
+ maxFiles: null | number;
79
+ /** The largest file in bytes; `null` for no cap. */
80
+ maxSize: null | number;
81
+ /** Whether a pick adds files; without it, one file replaces the entry. */
82
+ multiple: boolean;
83
+ }
84
+ /**
85
+ * Sorts one add into the files to keep and the files to refuse, in drop
86
+ * order. A folder, a type outside `accept`, a file over `maxSize` and a file
87
+ * already held — or already kept from this add — are refused for that
88
+ * reason; of the rest, those beyond the room left — one without `multiple`,
89
+ * else `maxFiles` minus the entries held — are refused as `count`.
90
+ */
91
+ export declare const screenFiles: <F extends FileFacts>(candidates: readonly Candidate<F>[], { accept, held, maxFiles, maxSize, multiple }: ScreenOptions) => {
92
+ accepted: F[];
93
+ rejected: {
94
+ file: F;
95
+ reason: RejectReason;
96
+ }[];
97
+ };
98
+ /** A page-unique id for a file entry the component creates. */
99
+ export declare const createEntryId: () => string;
@@ -1,80 +1,67 @@
1
- export interface CIconButtonProps {
1
+ /**
2
+ * Size of the icon button. `small` and `x-small` render progressively more
3
+ * compact buttons; omitting the attribute renders the default size.
4
+ */
5
+ export type CIconButtonSize = 'default' | 'small' | 'x-small';
6
+ interface CIconButtonProps {
2
7
  /**
3
- * Show a badge on top of the icon
4
- *
5
- * @seeded from csc-ui — verify
8
+ * Count shown in a bubble at the button's top-right corner; hidden while
9
+ * `null` or empty, so `0` still shows.
6
10
  */
7
11
  badge?: null | number | string;
8
12
  /**
9
- * Danger variant of the button
10
- *
11
- * @seeded from csc-ui — verify
13
+ * Danger appearance for a destructive action: the filled button in the error
14
+ * colour; no effect on `outlined`, `ghost` or `text`.
12
15
  */
13
16
  danger?: boolean;
14
17
  /**
15
- * Disable the button
16
- *
17
- * @seeded from csc-ui — verify
18
+ * Disable the button: it leaves the Tab order and ignores the pointer.
18
19
  */
19
20
  disabled?: boolean;
20
21
  /**
21
- * Ghost variant of the button
22
- *
23
- * @seeded from csc-ui — verify
22
+ * Ghost appearance: a light primary tint, for lower emphasis.
24
23
  */
25
24
  ghost?: boolean;
26
25
  /**
27
- * Inverted color for dark backgrounds
28
- *
29
- * @seeded from csc-ui — verify
26
+ * Inverted colours for a fixed dark or brand-coloured backdrop: the
27
+ * `inverse-*` family, the same in both theme modes. Combines with the other
28
+ * appearances.
30
29
  */
31
30
  inverted?: boolean;
32
31
  /**
33
- * Loading variant of the button
34
- *
35
- * @seeded from csc-ui — verify
32
+ * Show a spinner in place of the icon and ignore clicks; the button stays
33
+ * focusable and is announced as busy and unavailable.
36
34
  */
37
35
  loading?: boolean;
38
36
  /**
39
- * Outlined variant of the button
40
- *
41
- * @seeded from csc-ui — verify
37
+ * Outlined appearance: a primary outline with no fill, for lower emphasis.
42
38
  */
43
39
  outlined?: boolean;
44
40
  /**
45
- * Path for the svg icon
41
+ * Icon path of an icon the button draws itself, always 24px; a slotted icon
42
+ * wins over it.
46
43
  *
47
- * @seeded from csc-ui — verify
48
44
  * @freeform SVG path data
49
45
  */
50
46
  path?: string;
51
47
  /**
52
- * Size of the button
53
- *
54
- * @seeded from csc-ui — verify
48
+ * Size of the button: `default` (40px), `small` (32px) or `x-small` (28px).
55
49
  */
56
50
  size?: CIconButtonSize;
57
51
  /**
58
- * Text variant of the button
59
- *
60
- * @seeded from csc-ui — verify
52
+ * Text appearance: no fill or outline, the lightest look.
61
53
  */
62
54
  text?: boolean;
63
55
  }
64
- /**
65
- * Size of the icon button. `small` and `x-small` render progressively more
66
- * compact buttons; omitting the attribute renders the default size.
67
- */
68
- export type CIconButtonSize = 'default' | 'small' | 'x-small';
69
56
  declare const _default: typeof __VLS_export;
70
57
  export default _default;
71
58
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CIconButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CIconButtonProps> & Readonly<{}>, {
72
59
  path: string;
73
60
  text: boolean;
74
61
  outlined: boolean;
62
+ size: CIconButtonSize;
75
63
  disabled: boolean;
76
64
  loading: boolean;
77
- size: CIconButtonSize;
78
65
  danger: boolean;
79
66
  ghost: boolean;
80
67
  inverted: boolean;
@@ -3,95 +3,73 @@ interface CInputProps {
3
3
  /** Set by the wrapping form component when its input has focus or holds a value. */
4
4
  active?: boolean;
5
5
  /**
6
- * Disable the input
7
- *
8
- * @seeded from csc-ui — verify
6
+ * Dim the field and show the not-allowed cursor; the wrapping component
7
+ * disables its own input
9
8
  */
10
9
  disabled?: boolean;
11
- /**
12
- * Error message shown in place of the hint while the input is invalid
13
- *
14
- * @freeform
15
- */
16
- errorMessage?: string;
17
10
  /** Set by the wrapping form component when its input holds a value. */
18
11
  filled?: boolean;
19
12
  /**
20
- * Hide the hint and error messages
21
- *
22
- * @seeded from csc-ui — verify
13
+ * Leave out the message slot (the field's hint / error message)
23
14
  */
24
15
  hideDetails?: boolean;
25
- /**
26
- * Hint text for the input
27
- *
28
- * @seeded from csc-ui — verify
29
- * @freeform
30
- */
31
- hint?: string;
32
16
  /**
33
17
  * id of the inner input element (for the label's htmlFor).
34
18
  *
35
19
  * @freeform
36
20
  */
37
21
  inputId?: string;
22
+ /**
23
+ * Show the control as invalid. Marking the input `aria-invalid`, and
24
+ * showing its error message, are the wrapping component's job.
25
+ */
26
+ invalid?: boolean;
38
27
  /** Renders textarea-specific spacing tweaks. */
39
28
  isTextarea?: boolean;
40
29
  /**
41
30
  * Label of the input
42
31
  *
43
- * @seeded from csc-ui — verify
44
32
  * @freeform
45
33
  */
46
34
  label?: string;
47
35
  /**
48
36
  * Label on top of the input
49
- *
50
- * @seeded from csc-ui — verify
51
37
  */
52
38
  labelOnTop?: boolean;
53
39
  /**
54
- * Set the input as required
55
- *
56
- * @seeded from csc-ui — verify
40
+ * Show the required asterisk after the label; the wrapping component marks
41
+ * its own input required
57
42
  */
58
43
  required?: boolean;
59
44
  /**
60
- * Shadow variant of the input
61
- *
62
- * @seeded from csc-ui — verify
45
+ * Draw the field as a raised, drop-shadowed box with a focus outline
46
+ * instead of the outlined border and its label notch
63
47
  */
64
48
  shadow?: boolean;
65
- /** Field height: the 44px default or the 36px `small` box */
49
+ /** Field height: the 52px default (the shared control height) or the 36px `small` box */
66
50
  size?: CFieldSize;
67
- /**
68
- * Set the validíty of the input
69
- *
70
- * @seeded from csc-ui — verify
71
- */
72
- valid?: boolean;
73
51
  }
74
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
52
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
75
53
  type __VLS_Slots = {} & {
76
54
  pre?: (props: typeof __VLS_1) => any;
77
55
  } & {
78
56
  default?: (props: typeof __VLS_3) => any;
79
57
  } & {
80
58
  post?: (props: typeof __VLS_5) => any;
59
+ } & {
60
+ message?: (props: typeof __VLS_7) => any;
81
61
  };
82
62
  declare const __VLS_base: import("vue").DefineComponent<CInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CInputProps> & Readonly<{}>, {
83
63
  label: string;
84
- disabled: boolean;
85
- errorMessage: string;
64
+ invalid: boolean;
65
+ size: CFieldSize;
86
66
  hideDetails: boolean;
87
- hint: string;
88
67
  labelOnTop: boolean;
89
- required: boolean;
90
68
  shadow: boolean;
91
- size: CFieldSize;
92
- valid: boolean;
93
- inputId: string;
69
+ disabled: boolean;
70
+ required: boolean;
94
71
  active: boolean;
72
+ inputId: string;
95
73
  filled: boolean;
96
74
  isTextarea: boolean;
97
75
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1,30 +1,23 @@
1
1
  interface CLinkProps {
2
2
  /**
3
- * Url of link
3
+ * URL the link leads to. Without it the link has no destination: it is
4
+ * neither focusable nor announced as a link.
4
5
  *
5
- * @seeded from csc-ui — verify
6
6
  * @freeform any URL
7
7
  */
8
8
  href?: string;
9
9
  /**
10
- * regular target attribute of a hyperlink
10
+ * Where the `href` opens, as on a native `<a>`: the same tab unless set —
11
+ * `_blank` for a new one.
11
12
  *
12
- * @seeded from csc-ui — verify
13
13
  * @freeform any browsing-context name (e.g. _blank, _self)
14
14
  */
15
15
  target?: string;
16
16
  /**
17
- * Display line under the link
18
- *
19
- * @seeded from csc-ui — verify
17
+ * Underline the text. Underline links inside running text, so colour is not
18
+ * the only thing telling them apart.
20
19
  */
21
20
  underline?: boolean;
22
- /**
23
- * Customisable font weight
24
- *
25
- * @seeded from csc-ui — verify
26
- */
27
- weight?: number | string;
28
21
  }
29
22
  declare var __VLS_1: {};
30
23
  type __VLS_Slots = {} & {
@@ -34,7 +27,6 @@ declare const __VLS_base: import("vue").DefineComponent<CLinkProps, {}, {}, {},
34
27
  href: string;
35
28
  target: string;
36
29
  underline: boolean;
37
- weight: number | string;
38
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
31
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
40
32
  declare const _default: typeof __VLS_export;