@khsura/sui 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/components/avatar/index.d.ts +2 -0
- package/@types/components/avatar/sAvatar.vue.d.ts +13 -0
- package/@types/components/avatar/sAvatarGroup.vue.d.ts +16 -0
- package/@types/components/cards/sCardText.vue.d.ts +2 -2
- package/@types/components/datePicker/sDatePickerSwitch.vue.d.ts +2 -0
- package/@types/components/form/index.d.ts +2 -0
- package/@types/components/form/radio/sRadio.vue.d.ts +3 -0
- package/@types/components/form/sFormRow.vue.d.ts +18 -0
- package/@types/components/form/sInput.vue.d.ts +1 -0
- package/@types/components/form/sNumberInput.vue.d.ts +29 -0
- package/@types/components/form/sSelect.vue.d.ts +10 -3
- package/@types/components/index.d.ts +5 -0
- package/@types/components/layout/sNavigationDrawer.vue.d.ts +6 -6
- package/@types/components/progress/sProgressCircular.vue.d.ts +1 -0
- package/@types/components/progress/sProgressLinear.vue.d.ts +1 -0
- package/@types/components/sAutocomplete.vue.d.ts +11 -1
- package/@types/components/sEmptyState.vue.d.ts +26 -0
- package/@types/components/sFileInput.vue.d.ts +35 -0
- package/@types/components/sPagination.vue.d.ts +21 -0
- package/@types/components/sSkeletonLoader.vue.d.ts +19 -0
- package/@types/components/slideGroup/sSlideGroup.vue.d.ts +4 -1
- package/@types/components/table/sTable.vue.d.ts +2 -0
- package/@types/components/tabs/sTabs.vue.d.ts +2 -2
- package/@types/components/toggleButtonGroup/sToggleButtonGroup.vue.d.ts +2 -0
- package/@types/configs/app.d.ts +4 -0
- package/@types/configs/fileInput.d.ts +5 -0
- package/@types/configs/i18n.d.ts +3 -0
- package/@types/configs/index.d.ts +2 -0
- package/@types/configs/provider.d.ts +2 -0
- package/@types/configs/skeletonLoader.d.ts +57 -0
- package/@types/constants/avatar.d.ts +3 -0
- package/@types/constants/color.d.ts +15 -0
- package/@types/constants/cssVariables.d.ts +4 -0
- package/@types/constants/datePicker.d.ts +7 -0
- package/@types/constants/fileInput.d.ts +31 -0
- package/@types/constants/i18n.d.ts +3 -0
- package/@types/constants/index.d.ts +8 -0
- package/@types/constants/keyboard.d.ts +12 -0
- package/@types/constants/layout.d.ts +2 -0
- package/@types/constants/listbox.d.ts +1 -0
- package/@types/constants/numberInput.d.ts +22 -0
- package/@types/constants/overlay.d.ts +5 -0
- package/@types/constants/pagination.d.ts +20 -0
- package/@types/constants/skeletonLoader.d.ts +33 -0
- package/@types/constants/tabs.d.ts +10 -0
- package/@types/definitions/props/core/propsLink.d.ts +2 -2
- package/@types/definitions/props/index.d.ts +7 -0
- package/@types/definitions/props/propsAutocomplete.d.ts +8 -0
- package/@types/definitions/props/propsAvatar.d.ts +13 -0
- package/@types/definitions/props/propsAvatarGroup.d.ts +8 -0
- package/@types/definitions/props/propsEmptyState.d.ts +17 -0
- package/@types/definitions/props/propsFileInput.d.ts +41 -0
- package/@types/definitions/props/propsInput.d.ts +1 -0
- package/@types/definitions/props/propsLink.d.ts +2 -2
- package/@types/definitions/props/propsNumberInput.d.ts +46 -0
- package/@types/definitions/props/propsPagination.d.ts +32 -0
- package/@types/definitions/props/propsProgressCircular.d.ts +2 -0
- package/@types/definitions/props/propsProgressLinear.d.ts +2 -0
- package/@types/definitions/props/propsRow.d.ts +1 -0
- package/@types/definitions/props/propsSelect.d.ts +6 -0
- package/@types/definitions/props/propsSkeletonLoader.d.ts +18 -0
- package/@types/definitions/props/propsSlideGroup.d.ts +4 -0
- package/@types/definitions/props/propsTable.d.ts +1 -0
- package/@types/definitions/props/propsTabs.d.ts +4 -0
- package/@types/definitions/props/propsTextarea.d.ts +3 -0
- package/@types/helpers/colorHelpers.d.ts +1 -1
- package/@types/helpers/createAppStore.d.ts +4 -0
- package/@types/helpers/fileInputRules.d.ts +18 -0
- package/@types/helpers/index.d.ts +1 -0
- package/@types/lib/color.d.ts +21 -2
- package/@types/lib/escapeHtml.d.ts +2 -0
- package/@types/lib/flattenVNodes.d.ts +2 -0
- package/@types/lib/index.d.ts +7 -0
- package/@types/lib/linkLocation.d.ts +9 -0
- package/@types/lib/numberInput.d.ts +23 -0
- package/@types/lib/overlayPlacement.d.ts +11 -0
- package/@types/lib/revealInScroller.d.ts +25 -0
- package/@types/lib/safeArea.d.ts +3 -0
- package/@types/playwright.visual.config.d.ts +3 -0
- package/@types/services/appBarService.d.ts +14 -0
- package/@types/services/backgroundScrollService.d.ts +8 -2
- package/@types/services/core/layoutCoreService.d.ts +4 -0
- package/@types/services/datePicker/datePickerItemDateService.d.ts +1 -0
- package/@types/services/dialogService.d.ts +4 -8
- package/@types/services/fieldLayoutService.d.ts +19 -0
- package/@types/services/formInputService.d.ts +6 -0
- package/@types/services/index.d.ts +9 -0
- package/@types/services/layoutProviderService.d.ts +6 -0
- package/@types/services/layoutService.d.ts +4 -0
- package/@types/services/linkService.d.ts +11 -1
- package/@types/services/listboxNavigationService.d.ts +20 -0
- package/@types/services/menuService.d.ts +2 -0
- package/@types/services/overlayFocusService.d.ts +10 -0
- package/@types/services/paginationService.d.ts +39 -0
- package/@types/services/routerLinkService.d.ts +19 -0
- package/@types/services/scrollableFocusService.d.ts +10 -0
- package/@types/services/skeletonLoaderService.d.ts +22 -0
- package/@types/services/surfaceTextColorService.d.ts +8 -0
- package/@types/services/tabsService.d.ts +14 -0
- package/@types/store/index.d.ts +1 -0
- package/@types/store/scrollLockStore.d.ts +1 -0
- package/@types/tests/visual/constants/a11yAudit.d.ts +4 -0
- package/@types/tests/visual/constants/index.d.ts +4 -0
- package/@types/tests/visual/constants/resizeScroll.d.ts +10 -0
- package/@types/tests/visual/constants/storyRender.d.ts +5 -0
- package/@types/tests/visual/constants/visualMatrix.d.ts +20 -0
- package/@types/tests/visual/schemas/index.d.ts +1 -0
- package/@types/tests/visual/schemas/storyIndex.d.ts +17 -0
- package/@types/tests/visual/types/a11yAudit.d.ts +2 -0
- package/@types/tests/visual/types/index.d.ts +2 -0
- package/@types/tests/visual/types/visualStory.d.ts +8 -0
- package/@types/types/app.d.ts +2 -0
- package/@types/types/breadcrumbs.d.ts +2 -2
- package/@types/types/emits.d.ts +12 -0
- package/@types/types/fileInput.d.ts +28 -0
- package/@types/types/index.d.ts +6 -0
- package/@types/types/link.d.ts +20 -0
- package/@types/types/menu.d.ts +17 -0
- package/@types/types/numberInput.d.ts +12 -0
- package/@types/types/pagination.d.ts +17 -0
- package/@types/types/safeArea.d.ts +1 -0
- package/@types/types/skeletonLoader.d.ts +16 -0
- package/@types/vite.config.d.ts +1 -0
- package/README.md +12 -0
- package/dist/base.css.map +1 -1
- package/dist/s-ui.css +1 -1
- package/dist/s-ui.js +4792 -3038
- package/dist/s-ui.umd.cjs +1 -1
- package/dist/styles/components/avatar/_variables.scss +17 -0
- package/dist/styles/components/avatar/index.scss +1 -0
- package/dist/styles/components/button/mixins.scss +5 -0
- package/dist/styles/components/form/_variables.scss +11 -0
- package/dist/styles/components/form/index.scss +1 -0
- package/dist/styles/components/index.scss +2 -0
- package/dist/styles/mixins/_app.scss +7 -0
- package/dist/styles/tools/_safeArea.scss +8 -0
- package/dist/styles/tools/index.scss +1 -0
- package/dist/sui-api.json +1295 -212
- package/package.json +15 -4
- package/sui-plugin/.claude-plugin/plugin.json +1 -1
- package/sui-plugin/skills/sui-component/SKILL.md +21 -6
- package/sui-plugin/skills/sui-component/references/autocomplete.md +54 -46
- package/sui-plugin/skills/sui-component/references/avatar-group.md +66 -0
- package/sui-plugin/skills/sui-component/references/avatar.md +76 -0
- package/sui-plugin/skills/sui-component/references/badge.md +4 -4
- package/sui-plugin/skills/sui-component/references/breadcrumbs.md +3 -2
- package/sui-plugin/skills/sui-component/references/button.md +13 -13
- package/sui-plugin/skills/sui-component/references/calendar.md +1 -1
- package/sui-plugin/skills/sui-component/references/cards.md +12 -12
- package/sui-plugin/skills/sui-component/references/carousel.md +9 -9
- package/sui-plugin/skills/sui-component/references/chip.md +1 -1
- package/sui-plugin/skills/sui-component/references/date-picker.md +14 -13
- package/sui-plugin/skills/sui-component/references/dialog.md +11 -10
- package/sui-plugin/skills/sui-component/references/droppable.md +8 -8
- package/sui-plugin/skills/sui-component/references/empty-state.md +104 -0
- package/sui-plugin/skills/sui-component/references/expansion-panels.md +1 -1
- package/sui-plugin/skills/sui-component/references/file-input.md +106 -0
- package/sui-plugin/skills/sui-component/references/form.md +155 -105
- package/sui-plugin/skills/sui-component/references/image.md +11 -10
- package/sui-plugin/skills/sui-component/references/layout.md +53 -49
- package/sui-plugin/skills/sui-component/references/list.md +6 -3
- package/sui-plugin/skills/sui-component/references/menu.md +12 -9
- package/sui-plugin/skills/sui-component/references/number-input.md +102 -0
- package/sui-plugin/skills/sui-component/references/pagination.md +83 -0
- package/sui-plugin/skills/sui-component/references/progress.md +20 -18
- package/sui-plugin/skills/sui-component/references/sheet.md +8 -8
- package/sui-plugin/skills/sui-component/references/skeleton-loader.md +75 -0
- package/sui-plugin/skills/sui-component/references/slide-group.md +14 -12
- package/sui-plugin/skills/sui-component/references/snackbar.md +7 -5
- package/sui-plugin/skills/sui-component/references/split-view.md +2 -2
- package/sui-plugin/skills/sui-component/references/table.md +10 -3
- package/sui-plugin/skills/sui-component/references/tabs.md +19 -13
- package/sui-plugin/skills/sui-component/references/toggle-button-group.md +5 -4
- package/sui-plugin/skills/sui-component/references/toolbar.md +5 -5
- package/sui-plugin/skills/sui-component/references/tooltip.md +10 -9
- package/sui-plugin/skills/sui-component/references/window.md +6 -1
- package/sui-plugin/skills/sui-form/SKILL.md +25 -17
- package/sui-plugin/skills/sui-getting-started/SKILL.md +32 -7
- package/sui-plugin/skills/sui-layout/SKILL.md +3 -1
- package/sui-plugin/skills/sui-utilities/docs/classes.md +1 -1
|
@@ -13,7 +13,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsChip.d.ts`
|
|
|
13
13
|
|
|
14
14
|
| Prop | Type | Default | Required | Values |
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
|
-
| `borderRadius` | `` number \| "
|
|
16
|
+
| `borderRadius` | `` number \| "rounded" \| "tile" \| `${number}%` \| `${number}em` \| `${number}px` \| `${number}rem` \| `${number}vh` \| `${number}vw` \| null `` | — | no | — |
|
|
17
17
|
| `closable` | `boolean` | — | no | — |
|
|
18
18
|
| `color` | `string` | — | no | — |
|
|
19
19
|
| `colorThreshold` | `number` | — | no | — |
|
|
@@ -18,21 +18,21 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDatePicker.d.ts`
|
|
|
18
18
|
| `dateFormat` | `string` | `datePickerDisplayFormat.date` | no | — |
|
|
19
19
|
| `dense` | `boolean` | — | no | — |
|
|
20
20
|
| `disabled` | `boolean` | — | no | — |
|
|
21
|
-
| `height` | `
|
|
21
|
+
| `height` | `number \| string \| null` | — | no | — |
|
|
22
22
|
| `hideTitle` | `boolean` | — | no | — |
|
|
23
23
|
| `max` | `string` | — | no | — |
|
|
24
|
-
| `maxHeight` | `
|
|
25
|
-
| `maxWidth` | `
|
|
24
|
+
| `maxHeight` | `number \| string \| null` | — | no | — |
|
|
25
|
+
| `maxWidth` | `number \| string \| null` | — | no | — |
|
|
26
26
|
| `min` | `string` | — | no | — |
|
|
27
|
-
| `minHeight` | `
|
|
28
|
-
| `minWidth` | `
|
|
27
|
+
| `minHeight` | `number \| string \| null` | — | no | — |
|
|
28
|
+
| `minWidth` | `number \| string \| null` | — | no | — |
|
|
29
29
|
| `modelValue` | `string \| null` | — | no | — |
|
|
30
30
|
| `monthFormat` | `string` | `datePickerDisplayFormat.month` | no | — |
|
|
31
31
|
| `readonly` | `boolean` | — | no | — |
|
|
32
32
|
| `theme` | `AppThemeType` | — | no | `dark`, `light` |
|
|
33
33
|
| `today` | `string` | `dayjs().format("YYYY-MM-DD")` | no | — |
|
|
34
34
|
| `type` | `DatePickerTypeType` | `"date"` | yes | `date`, `month`, `year` |
|
|
35
|
-
| `width` | `
|
|
35
|
+
| `width` | `number \| string \| null` | — | no | — |
|
|
36
36
|
| `yearFormat` | `string` | `datePickerDisplayFormat.year` | no | — |
|
|
37
37
|
|
|
38
38
|
**SDatePicker slots**
|
|
@@ -136,18 +136,18 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDatePickerInput.d
|
|
|
136
136
|
| `dirty` | `boolean` | — | no | — | — |
|
|
137
137
|
| `disabled` | `boolean` | — | no | — | — |
|
|
138
138
|
| `error` | `boolean` | — | no | — | — |
|
|
139
|
-
| `height` | `
|
|
139
|
+
| `height` | `number \| string \| null` | — | no | — | — |
|
|
140
140
|
| `hideDetails` | `boolean` | — | no | — | — |
|
|
141
141
|
| `hideError` | `boolean` | — | no | — | — |
|
|
142
142
|
| `hideTitle` | `boolean` | — | no | — | — |
|
|
143
143
|
| `id` | `string` | — | no | — | — |
|
|
144
144
|
| `label` | `string \| null` | — | no | — | — |
|
|
145
145
|
| `max` | `string` | — | no | — | — |
|
|
146
|
-
| `maxHeight` | `
|
|
147
|
-
| `maxWidth` | `
|
|
146
|
+
| `maxHeight` | `number \| string \| null` | — | no | — | — |
|
|
147
|
+
| `maxWidth` | `number \| string \| null` | — | no | — | — |
|
|
148
148
|
| `min` | `string` | — | no | — | — |
|
|
149
|
-
| `minHeight` | `
|
|
150
|
-
| `minWidth` | `
|
|
149
|
+
| `minHeight` | `number \| string \| null` | — | no | — | — |
|
|
150
|
+
| `minWidth` | `number \| string \| null` | — | no | — | — |
|
|
151
151
|
| `modelValue` | `string \| null` | — | no | — | — |
|
|
152
152
|
| `monthFormat` | `string` | `datePickerDisplayFormat.month` | no | — | — |
|
|
153
153
|
| `placeholder` | `string \| null` | — | no | — | — |
|
|
@@ -159,7 +159,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDatePickerInput.d
|
|
|
159
159
|
| `tile` | `boolean` | — | no | — | — |
|
|
160
160
|
| `today` | `string` | `dayjs().format("YYYY-MM-DD")` | no | — | — |
|
|
161
161
|
| `type` | `DatePickerTypeType` | `"date"` | yes | `date`, `month`, `year` | — |
|
|
162
|
-
| `width` | `
|
|
162
|
+
| `width` | `number \| string \| null` | — | no | — | — |
|
|
163
163
|
| `yearFormat` | `string` | `datePickerDisplayFormat.year` | no | — | — |
|
|
164
164
|
|
|
165
165
|
**SDatePickerInput slots**
|
|
@@ -186,13 +186,14 @@ None.
|
|
|
186
186
|
- `min` / `max`: Bounds for the popup and carousel buttons (default: ±5 years around `today` (picker))
|
|
187
187
|
- `rules`: Validation rules
|
|
188
188
|
- `hideDetails`: Hide label and error area
|
|
189
|
+
- Model: `''` and `null` both mean no date (before 1.20.0 `''` opened the picker on "Invalid date"; use `null` there). The picker stays 8px inside the viewport: above the field near the bottom, shifted left near the right edge
|
|
189
190
|
- `hideError`: Hide the error message
|
|
190
191
|
- `id`: Input id (default: auto)
|
|
191
192
|
- `disabled` / `readonly`: Native input states; disable carousel buttons
|
|
192
193
|
- `size`: Field size (font never below 16px)
|
|
193
194
|
- `simple`: Borderless field
|
|
194
195
|
- `tile`: Square corners
|
|
195
|
-
- `block`: Stretch to container width (otherwise hugs the value)
|
|
196
|
+
- `block`: Stretch to container width (otherwise hugs the value). Never wider than its container: in a narrow column it shrinks like `SInput`, keeps the calendar button and ends the value in an ellipsis
|
|
196
197
|
- `width` / `maxWidth` / `minWidth`: Field size; the popup stays 280px wide
|
|
197
198
|
- `carousel`: Prev/next buttons stepping one day / month / year
|
|
198
199
|
- `carouselPrevIcon` / `carouselNextIcon`: Button icons (default: `'mdi-chevron-left'` / `'mdi-chevron-right'`)
|
|
@@ -13,18 +13,18 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDialog.d.ts`
|
|
|
13
13
|
|
|
14
14
|
| Prop | Type | Default | Required | Values |
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
|
-
| `activator` | `string \|
|
|
16
|
+
| `activator` | `string \| ComponentPublicInstance \| HTMLElement \| null` | — | no | — |
|
|
17
17
|
| `borderless` | `boolean` | — | no | — |
|
|
18
18
|
| `closeOnClick` | `boolean` | — | no | — |
|
|
19
19
|
| `disabled` | `boolean \| null` | — | no | — |
|
|
20
|
-
| `elevation` | `"" \|
|
|
20
|
+
| `elevation` | `"" \| "1" \| "2" \| "3" \| "4" \| "5" \| "6" \| "7" \| "8" \| "9" \| "10" \| "11" \| "12" \| "13" \| "14" \| "15" \| "16" \| "17" \| "18" \| "19" \| "20" \| "21" \| "22" \| "23" \| "24" \| 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13 \| 14 \| 15 \| 16 \| 17 \| 18 \| 19 \| 20 \| 21 \| 22 \| 23 \| 24 \| null` | — | no | — |
|
|
21
21
|
| `fullscreen` | `boolean` | — | no | — |
|
|
22
|
-
| `height` | `
|
|
22
|
+
| `height` | `number \| string \| null` | — | no | — |
|
|
23
23
|
| `location` | `LocationRaw` | — | no | — |
|
|
24
|
-
| `maxHeight` | `
|
|
25
|
-
| `maxWidth` | `
|
|
26
|
-
| `minHeight` | `
|
|
27
|
-
| `minWidth` | `
|
|
24
|
+
| `maxHeight` | `number \| string \| null` | — | no | — |
|
|
25
|
+
| `maxWidth` | `number \| string \| null` | — | no | — |
|
|
26
|
+
| `minHeight` | `number \| string \| null` | — | no | — |
|
|
27
|
+
| `minWidth` | `number \| string \| null` | — | no | — |
|
|
28
28
|
| `modelValue` | `boolean` | — | no | — |
|
|
29
29
|
| `offsetX` | `number \| null` | — | no | — |
|
|
30
30
|
| `offsetY` | `number \| null` | — | no | — |
|
|
@@ -33,7 +33,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDialog.d.ts`
|
|
|
33
33
|
| `readonly` | `boolean \| null` | — | no | — |
|
|
34
34
|
| `scrollable` | `boolean` | — | no | — |
|
|
35
35
|
| `scrollableBackground` | `boolean` | — | no | — |
|
|
36
|
-
| `width` | `
|
|
36
|
+
| `width` | `number \| string \| null` | — | no | — |
|
|
37
37
|
| `zIndex` | `number` | — | no | — |
|
|
38
38
|
|
|
39
39
|
**SDialog slots**
|
|
@@ -61,7 +61,7 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDialog.d.ts`
|
|
|
61
61
|
- `zIndex`: z-index of the overlay layer
|
|
62
62
|
- `disabled`: Passed to the activator via `attrs` (disables the trigger)
|
|
63
63
|
- `width` / `height`: Content dimensions
|
|
64
|
-
- `maxWidth` / `maxHeight` / `minWidth` / `minHeight`: Constraints (max-height defaults to 90% when not fullscreen)
|
|
64
|
+
- `maxWidth` / `maxHeight` / `minWidth` / `minHeight`: Constraints (max-height defaults to 90% when not fullscreen). `width`, `maxWidth` and `maxHeight` are capped at the viewport, so `:max-width="420"` still leaves a 12px gutter on a phone
|
|
65
65
|
- `activator` (slot): Trigger. Bind **both** `v-on="on"` and `v-bind="attrs"`
|
|
66
66
|
- `default` (slot): Dialog content
|
|
67
67
|
|
|
@@ -116,5 +116,6 @@ None — use `v-model`.
|
|
|
116
116
|
| `persistent` with no close button | Always provide an explicit close action |
|
|
117
117
|
|
|
118
118
|
- The app must be wrapped in `<SApp>`: dialogs teleport into the overlay container `SApp` renders.
|
|
119
|
-
-
|
|
119
|
+
- Keyboard and screen readers are handled: the content has `role="dialog"` and `aria-modal="true"`, focus moves into the dialog on open, Tab stays inside it, Esc closes it (not when `persistent`), and focus returns to the activator on close. Esc with a menu open inside the dialog closes only the menu. There is no `close` event — watch `v-model`.
|
|
120
|
+
- A `fullscreen` dialog pads by the iPhone safe-area insets on all sides and fills them with the card colour (needs `viewport-fit=cover`, see the getting-started skill). Don't add your own `env(safe-area-inset-*)` padding to it.
|
|
120
121
|
- `borderless`, `scrollableBackground` and `closeOnClick` appear in the prop types but currently have no effect — do not rely on them.
|
|
@@ -14,13 +14,13 @@ Types: `node_modules/@khsura/sui/@types/definitions/props/propsDroppable.d.ts`
|
|
|
14
14
|
| Prop | Type | Default | Required | Values |
|
|
15
15
|
| --- | --- | --- | --- | --- |
|
|
16
16
|
| `disabled` | `boolean \| null` | — | no | — |
|
|
17
|
-
| `height` | `
|
|
18
|
-
| `maxHeight` | `
|
|
19
|
-
| `maxWidth` | `
|
|
20
|
-
| `minHeight` | `
|
|
21
|
-
| `minWidth` | `
|
|
17
|
+
| `height` | `number \| string \| null` | — | no | — |
|
|
18
|
+
| `maxHeight` | `number \| string \| null` | — | no | — |
|
|
19
|
+
| `maxWidth` | `number \| string \| null` | — | no | — |
|
|
20
|
+
| `minHeight` | `number \| string \| null` | — | no | — |
|
|
21
|
+
| `minWidth` | `number \| string \| null` | — | no | — |
|
|
22
22
|
| `readonly` | `boolean \| null` | — | no | — |
|
|
23
|
-
| `width` | `
|
|
23
|
+
| `width` | `number \| string \| null` | — | no | — |
|
|
24
24
|
|
|
25
25
|
**SDroppable slots**
|
|
26
26
|
|
|
@@ -84,5 +84,5 @@ const handleDrop = (event: DragEvent) => {
|
|
|
84
84
|
|
|
85
85
|
- The drop zone has no built-in look: draw the border/background yourself. While dragging over it, the root gets class `s_droppable--drag` (opacity 0.6).
|
|
86
86
|
- `drop` gives the raw `DragEvent`; read `event.dataTransfer?.files`. Default browser handling (opening the file) is already prevented.
|
|
87
|
-
-
|
|
88
|
-
-
|
|
87
|
+
- For **file uploads** use `<SFileInput variant="dropzone">` (see [file-input.md](file-input.md)): it adds click-to-browse, keyboard, `accept` filtering, a label, `rules` and the chosen file names. Use SDroppable for other dragged content.
|
|
88
|
+
- SDroppable itself has no click-to-upload and no `accept`/file-type filtering: validate files in your `drop` handler.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# SEmptyState
|
|
2
|
+
|
|
3
|
+
**Import:** `import { SEmptyState } from '@khsura/sui'`
|
|
4
|
+
|
|
5
|
+
The "nothing here yet" block: a decorative icon or illustration, a short title, a supporting sentence and an optional action button, centred in a column. It is a plain `<div class="s_emptyState">` (no role, no Tab stop of its own) that takes the full width of its parent and wraps instead of overflowing, also at 375 px. Use it on an empty page or card, and in the `#noData` slot of `STable`, `SSelect` and `SAutocomplete`.
|
|
6
|
+
|
|
7
|
+
Types: `node_modules/@khsura/sui/@types/definitions/props/propsEmptyState.d.ts`
|
|
8
|
+
|
|
9
|
+
Docs: https://sui.surakh.com/?path=/docs/ui-components-emptystate--docs
|
|
10
|
+
|
|
11
|
+
<!-- generated:api:start SEmptyState -->
|
|
12
|
+
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
13
|
+
|
|
14
|
+
**SEmptyState props**
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- | --- |
|
|
18
|
+
| `actionText` | `string` | — | no | — | Label of the built-in action button. The button is shown only when this is set; clicking it emits `action`. |
|
|
19
|
+
| `color` | `string \| null` | — | no | — | Colour of the icon only (preset name or CSS colour), not a background: an empty state has no background of its own. |
|
|
20
|
+
| `icon` | `string` | — | no | — | Material Design icon shown above the title, such as `mdi-inbox-outline`. Ignored when `image` is set. Decorative: hidden from screen readers. |
|
|
21
|
+
| `image` | `string` | — | no | — | Illustration URL shown above the title. Wins over `icon`. Decorative (`alt=""`): put the meaning in `title` and `text`. |
|
|
22
|
+
| `size` | `SizePropertyType` | — | no | `default`, `extra`, `large`, `mini`, `small` | — |
|
|
23
|
+
| `text` | `string` | — | no | — | Supporting sentence under the title that says why it is empty or what to do next. |
|
|
24
|
+
| `theme` | `AppThemeType` | — | no | `dark`, `light` | — |
|
|
25
|
+
| `title` | `string` | — | no | — | Short headline, such as `No orders yet`. Rendered as text, not as a heading element. |
|
|
26
|
+
|
|
27
|
+
**SEmptyState slots**
|
|
28
|
+
|
|
29
|
+
| Slot | Slot props | Description |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| `actions` | `any` | Replaces the built-in action button, such as two SButtons or a link. |
|
|
32
|
+
| `default` | `any` | Extra content between the text and the actions. |
|
|
33
|
+
| `media` | `any` | Replaces the icon or image, such as an illustration component. Keep it decorative. |
|
|
34
|
+
| `text` | `any` | Replaces the `text` sentence. |
|
|
35
|
+
| `title` | `any` | Replaces the `title` text. |
|
|
36
|
+
|
|
37
|
+
**SEmptyState events**
|
|
38
|
+
|
|
39
|
+
| Event | Payload |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `action` | `[event: Event]` |
|
|
42
|
+
|
|
43
|
+
<!-- generated:api:end SEmptyState -->
|
|
44
|
+
|
|
45
|
+
**SEmptyState notes**
|
|
46
|
+
|
|
47
|
+
- Each part renders only when its prop or slot is set; `actionText` alone adds a primary `SButton` that emits `action`.
|
|
48
|
+
- `image` wins over `icon`. Both are decorative (`aria-hidden` / `alt=""`): the meaning goes in `title` and `text`.
|
|
49
|
+
- `color` colours the **icon only**; there is no background colour.
|
|
50
|
+
- `size` scales padding, icon, image, title, text and the action button. Use `size="small"` in a table cell and `size="mini"` in a select or autocomplete menu.
|
|
51
|
+
- The title is plain text, not a heading. For a page-level heading use `<template #title><h2>…</h2></template>`.
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<SEmptyState
|
|
57
|
+
icon="mdi-inbox-outline"
|
|
58
|
+
title="No orders yet"
|
|
59
|
+
text="Orders you create appear here."
|
|
60
|
+
action-text="Create order"
|
|
61
|
+
@action="openNewOrder"
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<!-- Several actions or a link: the actions slot -->
|
|
65
|
+
<SEmptyState icon="mdi-account-multiple-outline" title="No members">
|
|
66
|
+
<template #actions>
|
|
67
|
+
<SButton color="primary" @click="invite">Invite</SButton>
|
|
68
|
+
<SButton variant="text" to="/help/members">Learn more</SButton>
|
|
69
|
+
</template>
|
|
70
|
+
</SEmptyState>
|
|
71
|
+
|
|
72
|
+
<!-- STable: without the slot the row keeps its plain noDataText -->
|
|
73
|
+
<STable :headers="headers" :items="orders">
|
|
74
|
+
<template #noData>
|
|
75
|
+
<SEmptyState size="small" icon="mdi-cart-outline" title="No orders yet" />
|
|
76
|
+
</template>
|
|
77
|
+
</STable>
|
|
78
|
+
|
|
79
|
+
<!-- SSelect / SAutocomplete: opt-in, an empty menu stays blank without noDataText or the slot -->
|
|
80
|
+
<SSelect label="Warehouse" :items="warehouses">
|
|
81
|
+
<template #noData>
|
|
82
|
+
<SEmptyState size="mini" icon="mdi-warehouse" title="No warehouses" />
|
|
83
|
+
</template>
|
|
84
|
+
</SSelect>
|
|
85
|
+
<SAutocomplete :items="fruits">
|
|
86
|
+
<template #noData="{ query }">
|
|
87
|
+
<SEmptyState size="mini" icon="mdi-magnify" :title="`Nothing matches “${query}”`" />
|
|
88
|
+
</template>
|
|
89
|
+
</SAutocomplete>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
|
|
94
|
+
| ❌ | ✅ |
|
|
95
|
+
|----|----|
|
|
96
|
+
| `<SEmptyState headline="…" />` (Vuetify) | `title="…"` (there is no `headline`) |
|
|
97
|
+
| `<SEmptyState bg-color="grey" />` or expecting `color` to fill a background | `color` colours the icon; put the background on the parent |
|
|
98
|
+
| `<SEmptyState action-text="Go" href="/new" />` / `:to` | `<template #actions><SButton to="/new">Go</SButton></template>` |
|
|
99
|
+
| `@click:action="…"` (Vuetify event name) | `@action="…"` |
|
|
100
|
+
| `action-text` without `@action` (a button that does nothing) | Add `@action`, or use the `actions` slot |
|
|
101
|
+
| `<img>` or `<SIcon>` in the default slot | `image="…"` / `icon="…"`, or the `media` slot |
|
|
102
|
+
| A hand-made `<div class="text-center"><SIcon …/><p>No data</p></div>` in `#noData` | `<SEmptyState size="small" icon="…" title="…" />` |
|
|
103
|
+
| `<SSelect :items="[]" no-data-text="…">` expected to show without opening | The message shows in the **open** menu only |
|
|
104
|
+
| An `SEmptyState` inside the default slot of `SSelect` / `SAutocomplete` | The `#noData` slot |
|
|
@@ -81,7 +81,7 @@ None.
|
|
|
81
81
|
|
|
82
82
|
## SExpansionPanelHeader
|
|
83
83
|
|
|
84
|
-
Clickable row that toggles its panel.
|
|
84
|
+
Clickable row that toggles its panel. Its text starts at the same 16px inset as `SExpansionPanelContent`, and the chevron sits 16px from the right edge, so header and content line up without extra padding classes. (Older versions indented the header text 8px more than the content.)
|
|
85
85
|
|
|
86
86
|
<!-- generated:api:start SExpansionPanelHeader -->
|
|
87
87
|
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# SFileInput
|
|
2
|
+
|
|
3
|
+
**Import:** `import { SFileInput, getFileInputRules } from '@khsura/sui'`
|
|
4
|
+
|
|
5
|
+
A file picker built like SInput (label, field box, error line, `rules`) over a real, invisible `<input type="file">`. Shows the chosen files as names, chips or a count. `variant="dropzone"` makes a large drop area that also takes dragged files.
|
|
6
|
+
|
|
7
|
+
Types: `node_modules/@khsura/sui/@types/definitions/props/propsFileInput.d.ts`
|
|
8
|
+
|
|
9
|
+
Docs: https://sui.surakh.com/?path=/docs/ui-components-fileinput--docs
|
|
10
|
+
|
|
11
|
+
<!-- generated:api:start SFileInput -->
|
|
12
|
+
<!-- Generated from sui-api.json by `yarn sync:skills` (packages/app). Do not edit by hand. -->
|
|
13
|
+
|
|
14
|
+
**SFileInput props**
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Default | Required | Values | Description |
|
|
17
|
+
| --- | --- | --- | --- | --- | --- |
|
|
18
|
+
| `accept` | `string` | — | no | — | Allowed types in the native format: `.csv,.xlsx`, `image/*`, `application/pdf`. Dropped files that do not match are rejected (the `reject` event). |
|
|
19
|
+
| `ariaLabel` | `string` | — | no | — | Accessible name when there is no visible `label`; wins over `label`. |
|
|
20
|
+
| `ariaLabelledby` | `string` | — | no | — | Id of the element that names the file input. |
|
|
21
|
+
| `clearAriaLabel` | `string` | `"Clear"` | no | — | Accessible name of the clear button. |
|
|
22
|
+
| `clearable` | `boolean` | — | no | — | Show a button that clears the chosen files. |
|
|
23
|
+
| `countText` | `string` | `"{count} files"` | no | — | The `count` display text for several files; `{count}` is replaced by the number. |
|
|
24
|
+
| `dense` | `boolean` | — | no | — | Smaller paddings, as SInput's `dense`. |
|
|
25
|
+
| `dirty` | `boolean` | — | no | — | — |
|
|
26
|
+
| `disabled` | `boolean \| null` | — | no | — | — |
|
|
27
|
+
| `display` | `"chips" \| "count" \| "names"` | `"names"` | no | `chips`, `count`, `names` | How the chosen files are shown: their names, one chip each, or a count such as `3 files`. |
|
|
28
|
+
| `dropText` | `string` | `"Drop files here or click to browse"` | no | — | The `dropzone` variant's call to action. |
|
|
29
|
+
| `error` | `boolean` | — | no | — | — |
|
|
30
|
+
| `hideDetails` | `boolean` | — | no | — | — |
|
|
31
|
+
| `hideError` | `boolean` | — | no | — | — |
|
|
32
|
+
| `icon` | `string` | — | no | — | Material Design icon before the selection (`input`) or above the text (`dropzone`); `''` hides it. |
|
|
33
|
+
| `id` | `string` | — | no | — | — |
|
|
34
|
+
| `label` | `string` | — | no | — | Visible label above the field, tied to the file input. With `hideDetails` it is hidden and becomes the `aria-label`, as in SInput. |
|
|
35
|
+
| `loading` | `boolean` | — | no | — | Show a spinner and block picking, e.g. while the chosen file uploads or is parsed. |
|
|
36
|
+
| `loadingAriaLabel` | `string` | `"Loading"` | no | — | Accessible name of the loading spinner. |
|
|
37
|
+
| `modelValue` | `File[] \| null` | — | no | — | — |
|
|
38
|
+
| `multiple` | `boolean` | — | no | — | Allow several files. The model is always a `File[]` (or `null` when empty), even for one file. |
|
|
39
|
+
| `name` | `string` | — | no | — | The native input's `name`, so a plain `<form>` submit sends the files. |
|
|
40
|
+
| `placeholder` | `string` | — | no | — | Text shown in the field while no file is chosen. |
|
|
41
|
+
| `readonly` | `boolean \| null` | — | no | — | — |
|
|
42
|
+
| `rules` | `FormInputModelValueRule[]` | — | no | — | — |
|
|
43
|
+
| `showSize` | `boolean` | — | no | — | Show each file's size next to its name. |
|
|
44
|
+
| `size` | `SizePropertyType` | — | no | `default`, `extra`, `large`, `mini`, `small` | — |
|
|
45
|
+
| `variant` | `"dropzone" \| "input"` | `"input"` | no | `dropzone`, `input` | `input`: a text-field box. `dropzone`: a large area that also takes dragged files. |
|
|
46
|
+
|
|
47
|
+
**SFileInput slots**
|
|
48
|
+
|
|
49
|
+
None.
|
|
50
|
+
|
|
51
|
+
**SFileInput events**
|
|
52
|
+
|
|
53
|
+
| Event | Payload |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `change` | `[File[] \| null]` |
|
|
56
|
+
| `clear` | `[]` |
|
|
57
|
+
| `reject` | `[File[]]` |
|
|
58
|
+
| `update:dirty` | `[boolean]` |
|
|
59
|
+
| `update:error` | `[boolean]` |
|
|
60
|
+
| `update:errors` | `[string[]]` |
|
|
61
|
+
| `update:modelValue` | `[value: File[] \| null \| undefined]` |
|
|
62
|
+
|
|
63
|
+
<!-- generated:api:end SFileInput -->
|
|
64
|
+
|
|
65
|
+
**SFileInput notes**
|
|
66
|
+
|
|
67
|
+
- `v-model`: always `File[] | null` — an array even without `multiple`, `null` after clearing. Read `files?.[0]` for one file.
|
|
68
|
+
- `change` (event): passes the files (`File[] | null`), not a DOM event.
|
|
69
|
+
- `reject` (event): dropped files that do not match `accept`, or the extra files without `multiple`.
|
|
70
|
+
- `rules`: build them with `getFileInputRules({ required, maxSize, accept, maxFiles, messages })`; `maxSize` is in bytes.
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { ref } from 'vue'
|
|
77
|
+
import { SFileInput, getFileInputRules } from '@khsura/sui'
|
|
78
|
+
|
|
79
|
+
const accept = '.csv,.xlsx'
|
|
80
|
+
const workbook = ref<File[] | null>(null)
|
|
81
|
+
const rules = getFileInputRules({ required: true, accept, maxSize: 5 * 1024 * 1024 })
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<SFileInput v-model="workbook" label="Employee workbook" :accept="accept" :rules="rules" show-size clearable />
|
|
86
|
+
|
|
87
|
+
<SFileInput v-model="workbook" variant="dropzone" label="Employee workbook" :accept="accept" :rules="rules" />
|
|
88
|
+
|
|
89
|
+
<!-- act right after picking -->
|
|
90
|
+
<SFileInput label="Attendance sheet" :accept="accept" :loading="previewing" @change="(files) => preview(files?.[0])" />
|
|
91
|
+
</template>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Gotchas
|
|
95
|
+
|
|
96
|
+
| ❌ | ✅ |
|
|
97
|
+
|----|----|
|
|
98
|
+
| `<input ref="file" type="file" class="hidden">` + `<SButton @click="file?.click()">` | `<SFileInput v-model="files" label="…" accept="…" />` — labelled, keyboard-reachable, runs `rules`, shows the file name |
|
|
99
|
+
| `<SInput type="file">` | `<SFileInput>` |
|
|
100
|
+
| `<SDroppable>` + your own hidden input for an upload area | `<SFileInput variant="dropzone">` |
|
|
101
|
+
| `@change="upload($event.target.files[0])"` | `@change="(files) => upload(files?.[0])"` or `v-model="files"` |
|
|
102
|
+
| `const file = ref<File \| null>(null)` + `v-model="file"` | `const files = ref<File[] \| null>(null)`, then `files.value?.[0]` |
|
|
103
|
+
| Vuetify `chips` / `counter` / `prepend-icon` / `show-size` | `display="chips"` / `display="count"` / `icon` / `show-size` |
|
|
104
|
+
| `:rules="[(f) => f.size < max]"` (the value is an array) | `getFileInputRules({ maxSize: max })` |
|
|
105
|
+
| Relying on `accept` to block other types | `accept` filters the picker and drops; still add `getFileInputRules({ accept })` and check on the server |
|
|
106
|
+
| A preview image inside the field | Keep the preview outside (`SAvatar` / `SImage` with `URL.createObjectURL(files[0])`) |
|