@urbicon-ui/blocks 6.21.1 → 6.21.3
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/dist/components/NumberInput/NumberInput.svelte +197 -0
- package/dist/components/NumberInput/NumberInput.svelte.d.ts +4 -0
- package/dist/components/NumberInput/index.d.ts +55 -0
- package/dist/components/NumberInput/index.js +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/primitives/Avatar/avatar.variants.d.ts +6 -6
- package/dist/primitives/Badge/Badge.svelte +18 -8
- package/dist/primitives/Badge/index.d.ts +26 -6
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +11 -6
- package/dist/primitives/Breadcrumb/index.d.ts +2 -2
- package/dist/primitives/Button/button.variants.d.ts +4 -4
- package/dist/primitives/ButtonGroup/index.d.ts +1 -1
- package/dist/primitives/Card/card.variants.d.ts +5 -5
- package/dist/primitives/Checkbox/Checkbox.svelte +3 -3
- package/dist/primitives/Combobox/Combobox.svelte +478 -104
- package/dist/primitives/Combobox/combobox.variants.d.ts +89 -17
- package/dist/primitives/Combobox/combobox.variants.js +94 -13
- package/dist/primitives/Combobox/index.d.ts +166 -51
- package/dist/primitives/ConfirmDialog/index.d.ts +19 -0
- package/dist/primitives/Dialog/Dialog.svelte +74 -0
- package/dist/primitives/Dialog/dialog.variants.d.ts +9 -9
- package/dist/primitives/Dialog/index.d.ts +12 -1
- package/dist/primitives/Drawer/Drawer.svelte +2 -1
- package/dist/primitives/Drawer/drawer.variants.d.ts +8 -0
- package/dist/primitives/Drawer/drawer.variants.js +45 -10
- package/dist/primitives/Drawer/index.d.ts +13 -4
- package/dist/primitives/FormField/FormField.svelte +6 -6
- package/dist/primitives/FormField/index.d.ts +13 -4
- package/dist/primitives/Input/Input.svelte +8 -4
- package/dist/primitives/Input/input.variants.d.ts +9 -9
- package/dist/primitives/Menu/Menu.svelte +66 -4
- package/dist/primitives/Menu/index.d.ts +25 -0
- package/dist/primitives/Pagination/Pagination.svelte +28 -13
- package/dist/primitives/Pagination/index.d.ts +44 -0
- package/dist/primitives/Popover/Popover.svelte +34 -3
- package/dist/primitives/Popover/index.d.ts +3 -3
- package/dist/primitives/RadioGroup/RadioGroup.svelte +3 -3
- package/dist/primitives/Select/Select.svelte +21 -11
- package/dist/primitives/Select/index.d.ts +7 -0
- package/dist/primitives/Select/select.variants.d.ts +17 -17
- package/dist/primitives/Select/select.variants.js +18 -0
- package/dist/primitives/Skeleton/skeleton.variants.d.ts +3 -3
- package/dist/primitives/Slider/Slider.svelte +4 -8
- package/dist/primitives/Spinner/spinner.variants.d.ts +16 -16
- package/dist/primitives/Textarea/Textarea.svelte +13 -5
- package/dist/primitives/Textarea/textarea.variants.d.ts +7 -7
- package/dist/primitives/Textarea/textarea.variants.js +5 -2
- package/dist/primitives/Toast/Toaster.svelte +42 -2
- package/dist/primitives/Toast/index.d.ts +30 -0
- package/dist/primitives/Toast/toast.store.svelte.d.ts +25 -1
- package/dist/primitives/Toast/toast.store.svelte.js +91 -1
- package/dist/primitives/Toast/toast.variants.d.ts +18 -0
- package/dist/primitives/Toast/toast.variants.js +15 -0
- package/dist/primitives/Toggle/Toggle.svelte +17 -3
- package/dist/primitives/Toggle/index.d.ts +8 -2
- package/dist/primitives/Toggle/toggle.variants.d.ts +7 -0
- package/dist/primitives/Toggle/toggle.variants.js +26 -0
- package/dist/primitives/Toolbar/toolbar.variants.d.ts +6 -6
- package/dist/primitives/Tooltip/Tooltip.svelte +47 -21
- package/dist/primitives/Tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/primitives/Tooltip/index.d.ts +31 -3
- package/dist/primitives/Tooltip/tooltip.variants.d.ts +4 -4
- package/dist/primitives/Tooltip/tooltip.variants.js +2 -2
- package/dist/primitives/index.d.ts +3 -3
- package/dist/style/semantic.css +55 -29
- package/dist/translations/de.d.ts +3 -0
- package/dist/translations/de.js +4 -1
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +4 -1
- package/dist/utils/figma-token-export.d.ts +13 -0
- package/dist/utils/figma-token-export.js +99 -26
- package/dist/utils/guide.svelte.d.ts +8 -2
- package/dist/utils/guide.svelte.js +86 -5
- package/dist/utils/use-form-field.svelte.d.ts +9 -9
- package/dist/utils/use-form-field.svelte.js +12 -12
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `useFormField` — Single source of truth for the ARIA wiring that every
|
|
3
|
-
* Form primitive duplicates: error/
|
|
4
|
-
* `aria-invalid`, and the mutually-exclusive error-over-
|
|
3
|
+
* Form primitive duplicates: error/helper id derivation, `aria-describedby`,
|
|
4
|
+
* `aria-invalid`, and the mutually-exclusive error-over-helper convention.
|
|
5
5
|
*
|
|
6
|
-
* Layout (label position, error/
|
|
6
|
+
* Layout (label position, error/helper placement, required marker) stays
|
|
7
7
|
* component-specific because real Form primitives differ in shape — Input
|
|
8
8
|
* stacks the label on top, Checkbox/Toggle put it inline, RadioGroup and
|
|
9
9
|
* SegmentGroup have a group caption + per-item labels. The hook does not
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
* ```svelte
|
|
24
24
|
* <script lang="ts">
|
|
25
25
|
* import { useFormField } from './index.js';
|
|
26
|
-
* let { id: idProp,
|
|
26
|
+
* let { id: idProp, helper, error, required, disabled, label } = $props();
|
|
27
27
|
* const propsId = $props.id();
|
|
28
28
|
* const ff = useFormField(() => ({
|
|
29
29
|
* fieldId: idProp ?? `field-${propsId}`,
|
|
30
|
-
*
|
|
30
|
+
* helper,
|
|
31
31
|
* error,
|
|
32
32
|
* required,
|
|
33
33
|
* disabled
|
|
@@ -47,8 +47,8 @@ export interface UseFormFieldInputs {
|
|
|
47
47
|
/** The DOM id to apply to the field element. Compute once in the caller via `$props.id()`. */
|
|
48
48
|
fieldId: string;
|
|
49
49
|
/** Helper text shown below the field when no error is set. */
|
|
50
|
-
|
|
51
|
-
/** Error message — when truthy, replaces `
|
|
50
|
+
helper?: string;
|
|
51
|
+
/** Error message — when truthy, replaces `helper` and flags the field invalid. */
|
|
52
52
|
error?: string;
|
|
53
53
|
/** Required flag — exposed verbatim for the caller's label markup. */
|
|
54
54
|
required?: boolean;
|
|
@@ -60,8 +60,8 @@ export interface UseFormFieldReturn {
|
|
|
60
60
|
readonly fieldId: string;
|
|
61
61
|
/** Id of the error description, or undefined when no error is set. */
|
|
62
62
|
readonly errorId: string | undefined;
|
|
63
|
-
/** Id of the
|
|
64
|
-
readonly
|
|
63
|
+
/** Id of the helper description, or undefined when error is set or no helper is given. */
|
|
64
|
+
readonly helperId: string | undefined;
|
|
65
65
|
/** Concatenation suitable for `aria-describedby` (`undefined` when both are unset). */
|
|
66
66
|
readonly describedBy: string | undefined;
|
|
67
67
|
/** `true` iff `error` is truthy. Use for `aria-invalid={ff.invalid || undefined}`. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `useFormField` — Single source of truth for the ARIA wiring that every
|
|
3
|
-
* Form primitive duplicates: error/
|
|
4
|
-
* `aria-invalid`, and the mutually-exclusive error-over-
|
|
3
|
+
* Form primitive duplicates: error/helper id derivation, `aria-describedby`,
|
|
4
|
+
* `aria-invalid`, and the mutually-exclusive error-over-helper convention.
|
|
5
5
|
*
|
|
6
|
-
* Layout (label position, error/
|
|
6
|
+
* Layout (label position, error/helper placement, required marker) stays
|
|
7
7
|
* component-specific because real Form primitives differ in shape — Input
|
|
8
8
|
* stacks the label on top, Checkbox/Toggle put it inline, RadioGroup and
|
|
9
9
|
* SegmentGroup have a group caption + per-item labels. The hook does not
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
* ```svelte
|
|
24
24
|
* <script lang="ts">
|
|
25
25
|
* import { useFormField } from './index.js';
|
|
26
|
-
* let { id: idProp,
|
|
26
|
+
* let { id: idProp, helper, error, required, disabled, label } = $props();
|
|
27
27
|
* const propsId = $props.id();
|
|
28
28
|
* const ff = useFormField(() => ({
|
|
29
29
|
* fieldId: idProp ?? `field-${propsId}`,
|
|
30
|
-
*
|
|
30
|
+
* helper,
|
|
31
31
|
* error,
|
|
32
32
|
* required,
|
|
33
33
|
* disabled
|
|
@@ -51,20 +51,20 @@
|
|
|
51
51
|
export function computeFormFieldAria(input) {
|
|
52
52
|
const fieldId = input.fieldId;
|
|
53
53
|
const errorId = input.error ? `${fieldId}-error` : undefined;
|
|
54
|
-
//
|
|
54
|
+
// Helper is suppressed when an error is present — the error message is
|
|
55
55
|
// the more important description at that point. This is the same
|
|
56
56
|
// exclusive convention as Material / Carbon / Polaris.
|
|
57
|
-
const
|
|
58
|
-
// Error first,
|
|
57
|
+
const helperId = !input.error && input.helper ? `${fieldId}-helper` : undefined;
|
|
58
|
+
// Error first, helper second — error is the more semantically urgent
|
|
59
59
|
// description and should reach assistive tech first.
|
|
60
|
-
const describedBy = [errorId,
|
|
60
|
+
const describedBy = [errorId, helperId].filter(Boolean).join(' ') || undefined;
|
|
61
61
|
const invalid = !!input.error;
|
|
62
62
|
const required = !!input.required;
|
|
63
63
|
const disabled = !!input.disabled;
|
|
64
64
|
return {
|
|
65
65
|
fieldId,
|
|
66
66
|
errorId,
|
|
67
|
-
|
|
67
|
+
helperId,
|
|
68
68
|
describedBy,
|
|
69
69
|
invalid,
|
|
70
70
|
required,
|
|
@@ -80,8 +80,8 @@ export function useFormField(inputs) {
|
|
|
80
80
|
get errorId() {
|
|
81
81
|
return result.errorId;
|
|
82
82
|
},
|
|
83
|
-
get
|
|
84
|
-
return result.
|
|
83
|
+
get helperId() {
|
|
84
|
+
return result.helperId;
|
|
85
85
|
},
|
|
86
86
|
get describedBy() {
|
|
87
87
|
return result.describedBy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbicon-ui/blocks",
|
|
3
|
-
"version": "6.21.
|
|
3
|
+
"version": "6.21.3",
|
|
4
4
|
"description": "Svelte 5 UI component library with Tailwind CSS 4, OKLCH design tokens and zero runtime dependencies",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"@sveltejs/package": "^2.5.8",
|
|
92
92
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
93
93
|
"@tailwindcss/vite": "^4.3.1",
|
|
94
|
-
"@urbicon-ui/i18n": "6.21.
|
|
95
|
-
"@urbicon-ui/shared-types": "6.21.
|
|
94
|
+
"@urbicon-ui/i18n": "6.21.3",
|
|
95
|
+
"@urbicon-ui/shared-types": "6.21.3",
|
|
96
96
|
"prettier": "^3.8.4",
|
|
97
97
|
"prettier-plugin-svelte": "^4.1.1",
|
|
98
98
|
"prettier-plugin-tailwindcss": "^0.8.0",
|