iryx-ui 0.2.0 → 0.4.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/README.md +200 -19
- package/dist/component-names.d.ts +1 -1
- package/dist/components/Alert.vue.d.ts +3 -3
- package/dist/components/Breadcrumb.vue.d.ts +45 -0
- package/dist/components/Button.vue.d.ts +8 -0
- package/dist/components/ButtonGroup.vue.d.ts +32 -0
- package/dist/components/ConfirmDialog.vue.d.ts +18 -0
- package/dist/components/Dialog.vue.d.ts +65 -0
- package/dist/components/DropdownMenu.vue.d.ts +49 -0
- package/dist/components/DropdownMenuItems.vue.d.ts +24 -0
- package/dist/components/EmptyState.vue.d.ts +46 -0
- package/dist/components/Icon.vue.d.ts +8 -0
- package/dist/components/NumberInput.vue.d.ts +63 -0
- package/dist/components/Pagination.vue.d.ts +57 -0
- package/dist/components/Progress.vue.d.ts +52 -0
- package/dist/components/Separator.vue.d.ts +36 -0
- package/dist/components/Skeleton.vue.d.ts +20 -0
- package/dist/components/Stat.vue.d.ts +57 -0
- package/dist/components/Stepper.vue.d.ts +61 -0
- package/dist/components/Tabs.vue.d.ts +63 -0
- package/dist/components/Toaster.vue.d.ts +28 -0
- package/dist/components/Tooltip.vue.d.ts +49 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/composables/button-group.d.ts +12 -0
- package/dist/composables/confirm.d.ts +36 -0
- package/dist/composables/decimal.d.ts +53 -0
- package/dist/composables/dropdown-menu.d.ts +22 -0
- package/dist/composables/icon.d.ts +10 -0
- package/dist/composables/toast.d.ts +42 -0
- package/dist/config.d.ts +9 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +67 -31
- package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +201 -0
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/components/HugeiconsIcon.vue.js +25 -0
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/components/HugeiconsIcon.vue2.js +63 -0
- package/dist/nuxt.js +1 -1
- package/dist/packages/iryx-ui/src/component-names.js +4 -0
- package/dist/packages/iryx-ui/src/components/Alert.vue_vue_type_script_setup_true_lang.js +75 -0
- package/dist/packages/iryx-ui/src/components/Breadcrumb.js +5 -0
- package/dist/packages/iryx-ui/src/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/packages/iryx-ui/src/components/Button.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/packages/iryx-ui/src/components/ButtonGroup.js +5 -0
- package/dist/packages/iryx-ui/src/components/ButtonGroup.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/packages/iryx-ui/src/components/Checkbox.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/packages/iryx-ui/src/components/ConfirmDialog.js +5 -0
- package/dist/packages/iryx-ui/src/components/ConfirmDialog.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/packages/iryx-ui/src/components/Dialog.js +5 -0
- package/dist/packages/iryx-ui/src/components/Dialog.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/packages/iryx-ui/src/components/DropdownMenu.js +5 -0
- package/dist/packages/iryx-ui/src/components/DropdownMenu.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/packages/iryx-ui/src/components/DropdownMenuItems.js +5 -0
- package/dist/packages/iryx-ui/src/components/DropdownMenuItems.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/packages/iryx-ui/src/components/EmptyState.js +5 -0
- package/dist/packages/iryx-ui/src/components/EmptyState.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/packages/iryx-ui/src/components/Icon.js +5 -0
- package/dist/packages/iryx-ui/src/components/Icon.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/packages/iryx-ui/src/components/NumberInput.js +5 -0
- package/dist/packages/iryx-ui/src/components/NumberInput.vue_vue_type_script_setup_true_lang.js +136 -0
- package/dist/packages/iryx-ui/src/components/Pagination.js +5 -0
- package/dist/packages/iryx-ui/src/components/Pagination.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/packages/iryx-ui/src/components/Progress.js +5 -0
- package/dist/packages/iryx-ui/src/components/Progress.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/packages/iryx-ui/src/components/Select.vue_vue_type_script_setup_true_lang.js +85 -0
- package/dist/packages/iryx-ui/src/components/Separator.js +5 -0
- package/dist/packages/iryx-ui/src/components/Separator.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/packages/iryx-ui/src/components/Skeleton.js +5 -0
- package/dist/packages/iryx-ui/src/components/Skeleton.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/packages/iryx-ui/src/components/Stat.js +5 -0
- package/dist/packages/iryx-ui/src/components/Stat.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/packages/iryx-ui/src/components/Stepper.js +5 -0
- package/dist/packages/iryx-ui/src/components/Stepper.vue_vue_type_script_setup_true_lang.js +89 -0
- package/dist/packages/iryx-ui/src/components/Tabs.js +5 -0
- package/dist/packages/iryx-ui/src/components/Tabs.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/packages/iryx-ui/src/components/Toaster.js +5 -0
- package/dist/packages/iryx-ui/src/components/Toaster.vue_vue_type_script_setup_true_lang.js +115 -0
- package/dist/packages/iryx-ui/src/components/Tooltip.js +5 -0
- package/dist/packages/iryx-ui/src/components/Tooltip.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/packages/iryx-ui/src/components/index.js +66 -0
- package/dist/{composables → packages/iryx-ui/src/composables}/appearance.js +11 -7
- package/dist/packages/iryx-ui/src/composables/button-group.js +8 -0
- package/dist/packages/iryx-ui/src/composables/confirm.js +25 -0
- package/dist/packages/iryx-ui/src/composables/decimal.js +79 -0
- package/dist/packages/iryx-ui/src/composables/dropdown-menu.js +9 -0
- package/dist/packages/iryx-ui/src/composables/icon.js +6 -0
- package/dist/packages/iryx-ui/src/composables/toast.js +38 -0
- package/dist/{theme → packages/iryx-ui/src/theme}/badge.js +3 -3
- package/dist/packages/iryx-ui/src/theme/breadcrumb.js +12 -0
- package/dist/packages/iryx-ui/src/theme/button-group.js +15 -0
- package/dist/packages/iryx-ui/src/theme/button.js +59 -0
- package/dist/packages/iryx-ui/src/theme/dialog.js +23 -0
- package/dist/packages/iryx-ui/src/theme/dropdown-menu.js +16 -0
- package/dist/packages/iryx-ui/src/theme/empty-state.js +34 -0
- package/dist/{theme → packages/iryx-ui/src/theme}/form.js +1 -1
- package/dist/packages/iryx-ui/src/theme/number-input.js +49 -0
- package/dist/packages/iryx-ui/src/theme/pagination.js +29 -0
- package/dist/packages/iryx-ui/src/theme/progress.js +33 -0
- package/dist/packages/iryx-ui/src/theme/separator.js +22 -0
- package/dist/packages/iryx-ui/src/theme/skeleton.js +13 -0
- package/dist/packages/iryx-ui/src/theme/stat.js +30 -0
- package/dist/packages/iryx-ui/src/theme/stepper.js +25 -0
- package/dist/packages/iryx-ui/src/theme/tabs.js +52 -0
- package/dist/packages/iryx-ui/src/theme/toast.js +53 -0
- package/dist/packages/iryx-ui/src/theme/tooltip.js +8 -0
- package/dist/theme/breadcrumb.d.ts +59 -0
- package/dist/theme/button-group.d.ts +29 -0
- package/dist/theme/button.d.ts +17 -2
- package/dist/theme/dialog.d.ts +74 -0
- package/dist/theme/dropdown-menu.d.ts +53 -0
- package/dist/theme/empty-state.d.ts +86 -0
- package/dist/theme/index.d.ts +15 -0
- package/dist/theme/number-input.d.ts +92 -0
- package/dist/theme/pagination.d.ts +71 -0
- package/dist/theme/progress.d.ts +143 -0
- package/dist/theme/separator.d.ts +50 -0
- package/dist/theme/skeleton.d.ts +23 -0
- package/dist/theme/stat.d.ts +110 -0
- package/dist/theme/stepper.d.ts +56 -0
- package/dist/theme/tabs.d.ts +104 -0
- package/dist/theme/toast.d.ts +176 -0
- package/dist/theme/tooltip.d.ts +32 -0
- package/package.json +4 -3
- package/theme.css +55 -0
- package/dist/component-names.js +0 -19
- package/dist/components/Alert.vue_vue_type_script_setup_true_lang.js +0 -74
- package/dist/components/Button.vue_vue_type_script_setup_true_lang.js +0 -54
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +0 -79
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +0 -84
- package/dist/components/index.js +0 -34
- package/dist/theme/button.js +0 -27
- /package/dist/{components → packages/iryx-ui/src/components}/Alert.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/App.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/App.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Badge.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Badge.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Button.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Card.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Card.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Checkbox.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Form.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Form.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/FormField.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/FormField.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Input.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Input.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Label.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Label.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/RadioGroup.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/RadioGroup.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Select.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Switch.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Switch.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Textarea.js +0 -0
- /package/dist/{components → packages/iryx-ui/src/components}/Textarea.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{composables → packages/iryx-ui/src/composables}/form.js +0 -0
- /package/dist/{config.js → packages/iryx-ui/src/config.js} +0 -0
- /package/dist/{plugin.js → packages/iryx-ui/src/plugin.js} +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/alert.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/card.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/checkbox.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/input.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/label.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/presets.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/radio-group.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/select.js +0 -0
- /package/dist/{theme → packages/iryx-ui/src/theme}/switch.js +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface NumberInputProps {
|
|
2
|
+
/** Smallest allowed value, as a decimal string. */
|
|
3
|
+
min?: string;
|
|
4
|
+
/** Largest allowed value, as a decimal string. */
|
|
5
|
+
max?: string;
|
|
6
|
+
/** Amount the stepper adds or subtracts, as a decimal string. */
|
|
7
|
+
step?: string;
|
|
8
|
+
/** Fixed decimal places. Values are rounded half-up to this scale. */
|
|
9
|
+
precision?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Locale used for the *display* only — `sl` shows `1.234,56`. The model
|
|
12
|
+
* stays canonical (`"1234.56"`) whatever the locale.
|
|
13
|
+
*/
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** Show the stacked increment/decrement controls. */
|
|
16
|
+
stepper?: boolean;
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Mark the field as invalid — styles the border and ring red. */
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
id?: string;
|
|
24
|
+
/** Accessible names for the stepper controls — override for non-English apps. */
|
|
25
|
+
incrementLabel?: string;
|
|
26
|
+
decrementLabel?: string;
|
|
27
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
28
|
+
unstyled?: boolean;
|
|
29
|
+
class?: string;
|
|
30
|
+
/** Override classes per slot, e.g. `{ step: 'px-2' }`. */
|
|
31
|
+
ui?: {
|
|
32
|
+
root?: string;
|
|
33
|
+
input?: string;
|
|
34
|
+
stepper?: string;
|
|
35
|
+
step?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
type __VLS_Props = NumberInputProps;
|
|
39
|
+
type __VLS_ModelProps = {
|
|
40
|
+
/**
|
|
41
|
+
* The model is a decimal **string**, never a number.
|
|
42
|
+
*
|
|
43
|
+
* Money in a finance app is computed with decimal arithmetic; coercing to a
|
|
44
|
+
* float here would silently lose precision before the value ever reached the
|
|
45
|
+
* caller. An empty string means "no value".
|
|
46
|
+
*/
|
|
47
|
+
modelValue?: string;
|
|
48
|
+
};
|
|
49
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
50
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
|
+
"update:modelValue": (value: string) => any;
|
|
52
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
53
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
unstyled: boolean;
|
|
56
|
+
step: string;
|
|
57
|
+
invalid: boolean;
|
|
58
|
+
stepper: boolean;
|
|
59
|
+
incrementLabel: string;
|
|
60
|
+
decrementLabel: string;
|
|
61
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
62
|
+
declare const _default: typeof __VLS_export;
|
|
63
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
/** Total number of records, not pages. */
|
|
3
|
+
total?: number;
|
|
4
|
+
itemsPerPage?: number;
|
|
5
|
+
/** How many pages to show either side of the current one. */
|
|
6
|
+
siblingCount?: number;
|
|
7
|
+
/** Keep the first and last page visible however far away they are. */
|
|
8
|
+
showEdges?: boolean;
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
/** Accessible names — override for non-English apps. */
|
|
11
|
+
prevLabel?: string;
|
|
12
|
+
nextLabel?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
15
|
+
unstyled?: boolean;
|
|
16
|
+
class?: string;
|
|
17
|
+
/** Override classes per slot, e.g. `{ item: 'rounded-full' }`. */
|
|
18
|
+
ui?: {
|
|
19
|
+
root?: string;
|
|
20
|
+
list?: string;
|
|
21
|
+
item?: string;
|
|
22
|
+
ellipsis?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
type __VLS_Props = PaginationProps;
|
|
26
|
+
type __VLS_ModelProps = {
|
|
27
|
+
'page'?: number;
|
|
28
|
+
};
|
|
29
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
30
|
+
declare var __VLS_20: {}, __VLS_45: {};
|
|
31
|
+
type __VLS_Slots = {} & {
|
|
32
|
+
prev?: (props: typeof __VLS_20) => any;
|
|
33
|
+
} & {
|
|
34
|
+
next?: (props: typeof __VLS_45) => any;
|
|
35
|
+
};
|
|
36
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
"update:page": (value: number) => any;
|
|
38
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
39
|
+
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
unstyled: boolean;
|
|
42
|
+
label: string;
|
|
43
|
+
total: number;
|
|
44
|
+
itemsPerPage: number;
|
|
45
|
+
siblingCount: number;
|
|
46
|
+
showEdges: boolean;
|
|
47
|
+
prevLabel: string;
|
|
48
|
+
nextLabel: string;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
51
|
+
declare const _default: typeof __VLS_export;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface ProgressProps {
|
|
2
|
+
/** Current value. `null` (or `indeterminate`) means unknown duration. */
|
|
3
|
+
modelValue?: number | null;
|
|
4
|
+
max?: number;
|
|
5
|
+
variant?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
/** Unknown duration — animates instead of tracking a value. */
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
/** Text shown above the track. */
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Show the value beside the label. Defaults to a percentage. */
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Format the displayed value and the accessible label. Override for
|
|
15
|
+
* non-percentage units or non-English locales.
|
|
16
|
+
*/
|
|
17
|
+
formatValue?: (value: number, max: number) => string;
|
|
18
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
19
|
+
unstyled?: boolean;
|
|
20
|
+
class?: string;
|
|
21
|
+
/** Override classes per slot, e.g. `{ track: 'h-4' }`. */
|
|
22
|
+
ui?: {
|
|
23
|
+
root?: string;
|
|
24
|
+
header?: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
value?: string;
|
|
27
|
+
track?: string;
|
|
28
|
+
indicator?: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare var __VLS_1: {}, __VLS_3: {
|
|
32
|
+
value: number | null;
|
|
33
|
+
percent: number;
|
|
34
|
+
formatted: string;
|
|
35
|
+
};
|
|
36
|
+
type __VLS_Slots = {} & {
|
|
37
|
+
label?: (props: typeof __VLS_1) => any;
|
|
38
|
+
} & {
|
|
39
|
+
value?: (props: typeof __VLS_3) => any;
|
|
40
|
+
};
|
|
41
|
+
declare const __VLS_base: import("vue").DefineComponent<ProgressProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProgressProps> & Readonly<{}>, {
|
|
42
|
+
unstyled: boolean;
|
|
43
|
+
max: number;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
49
|
+
new (): {
|
|
50
|
+
$slots: S;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface SeparatorProps {
|
|
2
|
+
orientation?: 'horizontal' | 'vertical';
|
|
3
|
+
/** Text shown in the middle of the rule. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Purely visual, so it is hidden from assistive tech. Set false when the
|
|
7
|
+
* rule genuinely divides sections of content.
|
|
8
|
+
*/
|
|
9
|
+
decorative?: boolean;
|
|
10
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
11
|
+
unstyled?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
/** Override classes per slot, e.g. `{ line: 'bg-primary' }`. */
|
|
14
|
+
ui?: {
|
|
15
|
+
root?: string;
|
|
16
|
+
line?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare var __VLS_6: {};
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
default?: (props: typeof __VLS_6) => any;
|
|
23
|
+
};
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
|
|
25
|
+
unstyled: boolean;
|
|
26
|
+
orientation: "horizontal" | "vertical";
|
|
27
|
+
decorative: boolean;
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SkeletonProps {
|
|
2
|
+
/** Render as a different element or component. */
|
|
3
|
+
as?: string;
|
|
4
|
+
variant?: 'text' | 'rect' | 'circle';
|
|
5
|
+
/** Repeat as stacked lines. Useful for paragraphs of placeholder copy. */
|
|
6
|
+
lines?: number;
|
|
7
|
+
/** Accessible description of what is loading. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
10
|
+
unstyled?: boolean;
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<SkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
|
|
14
|
+
as: string;
|
|
15
|
+
unstyled: boolean;
|
|
16
|
+
label: string;
|
|
17
|
+
lines: number;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface StatProps {
|
|
2
|
+
/** Render as a different element or component. */
|
|
3
|
+
as?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: string | number;
|
|
6
|
+
/** Change since the previous period. Sign picks the colour and the arrow. */
|
|
7
|
+
delta?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Override the colour of the delta. Useful when down is the good direction —
|
|
10
|
+
* falling costs, for example — since the sign alone cannot tell.
|
|
11
|
+
*/
|
|
12
|
+
trend?: 'up' | 'down' | 'neutral';
|
|
13
|
+
/** Secondary text under the value. */
|
|
14
|
+
hint?: string;
|
|
15
|
+
size?: 'sm' | 'md' | 'lg';
|
|
16
|
+
/**
|
|
17
|
+
* Format the delta. Defaults to a signed percentage; override for other
|
|
18
|
+
* units or locales.
|
|
19
|
+
*/
|
|
20
|
+
formatDelta?: (delta: number) => string;
|
|
21
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
22
|
+
unstyled?: boolean;
|
|
23
|
+
class?: string;
|
|
24
|
+
/** Override classes per slot, e.g. `{ value: 'text-4xl' }`. */
|
|
25
|
+
ui?: {
|
|
26
|
+
root?: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
value?: string;
|
|
29
|
+
delta?: string;
|
|
30
|
+
hint?: string;
|
|
31
|
+
row?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {
|
|
35
|
+
trend: "neutral" | "up" | "down";
|
|
36
|
+
}, __VLS_19: {};
|
|
37
|
+
type __VLS_Slots = {} & {
|
|
38
|
+
label?: (props: typeof __VLS_8) => any;
|
|
39
|
+
} & {
|
|
40
|
+
default?: (props: typeof __VLS_10) => any;
|
|
41
|
+
} & {
|
|
42
|
+
delta?: (props: typeof __VLS_12) => any;
|
|
43
|
+
} & {
|
|
44
|
+
hint?: (props: typeof __VLS_19) => any;
|
|
45
|
+
};
|
|
46
|
+
declare const __VLS_base: import("vue").DefineComponent<StatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<StatProps> & Readonly<{}>, {
|
|
47
|
+
as: string;
|
|
48
|
+
unstyled: boolean;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
51
|
+
declare const _default: typeof __VLS_export;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface StepperItemOption {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface StepperProps {
|
|
7
|
+
items?: (StepperItemOption | string)[];
|
|
8
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
|
+
/**
|
|
10
|
+
* Require steps to be completed in order.
|
|
11
|
+
*
|
|
12
|
+
* Off by default, because when on, a later step cannot be reached until the
|
|
13
|
+
* ones before it are marked complete — which makes plain `v-model`
|
|
14
|
+
* increments silently do nothing. Turn it on only if you are driving
|
|
15
|
+
* navigation through the stepper's own triggers.
|
|
16
|
+
*/
|
|
17
|
+
linear?: boolean;
|
|
18
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
19
|
+
unstyled?: boolean;
|
|
20
|
+
class?: string;
|
|
21
|
+
/** Override classes per slot, e.g. `{ indicator: 'size-10' }`. */
|
|
22
|
+
ui?: {
|
|
23
|
+
root?: string;
|
|
24
|
+
item?: string;
|
|
25
|
+
trigger?: string;
|
|
26
|
+
indicator?: string;
|
|
27
|
+
content?: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
separator?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
type __VLS_Props = StepperProps;
|
|
34
|
+
type __VLS_ModelProps = {
|
|
35
|
+
/** Steps are 1-indexed, matching how they read to a user. */
|
|
36
|
+
modelValue?: number;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
|
+
declare var __VLS_26: {
|
|
40
|
+
step: number;
|
|
41
|
+
item: StepperItemOption;
|
|
42
|
+
};
|
|
43
|
+
type __VLS_Slots = {} & {
|
|
44
|
+
indicator?: (props: typeof __VLS_26) => any;
|
|
45
|
+
};
|
|
46
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
"update:modelValue": (value: number) => any;
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
49
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
unstyled: boolean;
|
|
52
|
+
linear: boolean;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
55
|
+
declare const _default: typeof __VLS_export;
|
|
56
|
+
export default _default;
|
|
57
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { IconLike } from '../composables/icon';
|
|
2
|
+
export interface TabsItem {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Identifies the tab. Defaults to the label. */
|
|
5
|
+
value?: string;
|
|
6
|
+
icon?: IconLike;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface TabsProps {
|
|
10
|
+
items?: (TabsItem | string)[];
|
|
11
|
+
variant?: 'solid' | 'line';
|
|
12
|
+
orientation?: 'horizontal' | 'vertical';
|
|
13
|
+
/**
|
|
14
|
+
* Keep inactive panels mounted. Useful when a panel holds form state that
|
|
15
|
+
* should survive switching away.
|
|
16
|
+
*/
|
|
17
|
+
keepMounted?: boolean;
|
|
18
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
19
|
+
unstyled?: boolean;
|
|
20
|
+
class?: string;
|
|
21
|
+
/** Override classes per slot, e.g. `{ list: 'w-full' }`. */
|
|
22
|
+
ui?: {
|
|
23
|
+
root?: string;
|
|
24
|
+
list?: string;
|
|
25
|
+
indicator?: string;
|
|
26
|
+
trigger?: string;
|
|
27
|
+
content?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
type __VLS_Props = TabsProps;
|
|
31
|
+
type __VLS_ModelProps = {
|
|
32
|
+
modelValue?: string;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
35
|
+
declare var __VLS_19: {}, __VLS_27: {
|
|
36
|
+
item: TabsItem;
|
|
37
|
+
}, __VLS_34: {}, __VLS_43: string, __VLS_44: {
|
|
38
|
+
item: TabsItem;
|
|
39
|
+
};
|
|
40
|
+
type __VLS_Slots = {} & {
|
|
41
|
+
[K in NonNullable<typeof __VLS_43>]?: (props: typeof __VLS_44) => any;
|
|
42
|
+
} & {
|
|
43
|
+
list?: (props: typeof __VLS_19) => any;
|
|
44
|
+
} & {
|
|
45
|
+
trigger?: (props: typeof __VLS_27) => any;
|
|
46
|
+
} & {
|
|
47
|
+
default?: (props: typeof __VLS_34) => any;
|
|
48
|
+
};
|
|
49
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
50
|
+
"update:modelValue": (value: string) => any;
|
|
51
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
52
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
unstyled: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
58
|
+
export default _default;
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ToasterProps {
|
|
2
|
+
position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
3
|
+
/** Default milliseconds before auto-dismiss; a toast's own `duration` wins. */
|
|
4
|
+
duration?: number;
|
|
5
|
+
/** Accessible name for each dismiss button — override for non-English apps. */
|
|
6
|
+
closeLabel?: string;
|
|
7
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
8
|
+
unstyled?: boolean;
|
|
9
|
+
class?: string;
|
|
10
|
+
/** Override classes per slot, e.g. `{ viewport: 'sm:max-w-md' }`. */
|
|
11
|
+
ui?: {
|
|
12
|
+
viewport?: string;
|
|
13
|
+
root?: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
content?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
action?: string;
|
|
19
|
+
close?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
declare const __VLS_export: import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
23
|
+
closeLabel: string;
|
|
24
|
+
unstyled: boolean;
|
|
25
|
+
duration: number;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
/** Tooltip text. Ignored when the `content` slot is used. */
|
|
3
|
+
text?: string;
|
|
4
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
+
align?: 'start' | 'center' | 'end';
|
|
6
|
+
sideOffset?: number;
|
|
7
|
+
/** Milliseconds to hover before it opens. */
|
|
8
|
+
delay?: number;
|
|
9
|
+
/** Render the little pointer against the trigger. */
|
|
10
|
+
arrow?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
13
|
+
unstyled?: boolean;
|
|
14
|
+
class?: string;
|
|
15
|
+
/** Override classes per slot, e.g. `{ content: 'max-w-sm' }`. */
|
|
16
|
+
ui?: {
|
|
17
|
+
content?: string;
|
|
18
|
+
arrow?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
type __VLS_Props = TooltipProps;
|
|
22
|
+
type __VLS_ModelProps = {
|
|
23
|
+
'open'?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
26
|
+
declare var __VLS_20: {}, __VLS_34: {};
|
|
27
|
+
type __VLS_Slots = {} & {
|
|
28
|
+
trigger?: (props: typeof __VLS_20) => any;
|
|
29
|
+
} & {
|
|
30
|
+
content?: (props: typeof __VLS_34) => any;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:open": (value: boolean) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
unstyled: boolean;
|
|
38
|
+
side: "top" | "right" | "bottom" | "left";
|
|
39
|
+
sideOffset: number;
|
|
40
|
+
delay: number;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
export { default as Alert } from './Alert.vue';
|
|
2
2
|
export { default as App } from './App.vue';
|
|
3
3
|
export { default as Badge } from './Badge.vue';
|
|
4
|
+
export { default as Breadcrumb } from './Breadcrumb.vue';
|
|
4
5
|
export { default as Button } from './Button.vue';
|
|
6
|
+
export { default as ButtonGroup } from './ButtonGroup.vue';
|
|
5
7
|
export { default as Card } from './Card.vue';
|
|
6
8
|
export { default as Checkbox } from './Checkbox.vue';
|
|
9
|
+
export { default as ConfirmDialog } from './ConfirmDialog.vue';
|
|
10
|
+
export { default as Dialog } from './Dialog.vue';
|
|
11
|
+
export { default as DropdownMenu } from './DropdownMenu.vue';
|
|
12
|
+
export { default as EmptyState } from './EmptyState.vue';
|
|
7
13
|
export { default as Form } from './Form.vue';
|
|
8
14
|
export { default as FormField } from './FormField.vue';
|
|
9
15
|
export { default as Input } from './Input.vue';
|
|
10
16
|
export { default as Label } from './Label.vue';
|
|
17
|
+
export { default as NumberInput } from './NumberInput.vue';
|
|
18
|
+
export { default as Pagination } from './Pagination.vue';
|
|
19
|
+
export { default as Progress } from './Progress.vue';
|
|
11
20
|
export { default as RadioGroup } from './RadioGroup.vue';
|
|
12
21
|
export { default as Select } from './Select.vue';
|
|
22
|
+
export { default as Separator } from './Separator.vue';
|
|
23
|
+
export { default as Skeleton } from './Skeleton.vue';
|
|
24
|
+
export { default as Stat } from './Stat.vue';
|
|
25
|
+
export { default as Stepper } from './Stepper.vue';
|
|
13
26
|
export { default as Switch } from './Switch.vue';
|
|
27
|
+
export { default as Tabs } from './Tabs.vue';
|
|
14
28
|
export { default as Textarea } from './Textarea.vue';
|
|
29
|
+
export { default as Toaster } from './Toaster.vue';
|
|
30
|
+
export { default as Tooltip } from './Tooltip.vue';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
/** Context a `ButtonGroup` exposes to the buttons it wraps. */
|
|
4
|
+
export interface ButtonGroupContext {
|
|
5
|
+
size: ComputedRef<ButtonSize | undefined>;
|
|
6
|
+
}
|
|
7
|
+
export declare const buttonGroupContextKey: InjectionKey<ButtonGroupContext>;
|
|
8
|
+
/**
|
|
9
|
+
* Access the enclosing `ButtonGroup`, if any. Buttons use this to pick up a
|
|
10
|
+
* shared size, so it only has to be set once on the group.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useButtonGroup(): ButtonGroupContext | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface ConfirmOptions {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
/** Text for the confirming button. Supply your own for non-English apps. */
|
|
5
|
+
confirmLabel?: string;
|
|
6
|
+
/** Text for the dismissing button. Supply your own for non-English apps. */
|
|
7
|
+
cancelLabel?: string;
|
|
8
|
+
/** Style the confirming button as destructive. */
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** An open request, plus the resolver its promise is waiting on. */
|
|
12
|
+
export interface ConfirmRequest extends ConfirmOptions {
|
|
13
|
+
id: number;
|
|
14
|
+
resolve: (confirmed: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Internal: the request `<IConfirmDialog>` should currently render. */
|
|
17
|
+
export declare function useConfirmState(): import("vue").ShallowRef<ConfirmRequest | null, ConfirmRequest | null>;
|
|
18
|
+
/** Settle the open request and clear it. */
|
|
19
|
+
export declare function resolveConfirm(confirmed: boolean): void;
|
|
20
|
+
export interface ConfirmApi {
|
|
21
|
+
/** Resolves `true` if the user confirms, `false` if they cancel or dismiss. */
|
|
22
|
+
confirm: (options: ConfirmOptions | string) => Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Promise-based confirmation for destructive actions.
|
|
26
|
+
*
|
|
27
|
+
* Requires a single `<IConfirmDialog />` mounted somewhere in the app —
|
|
28
|
+
* typically just inside `<IApp>`.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const { confirm } = useConfirm()
|
|
32
|
+
* if (await confirm({ title: 'Delete draft?', danger: true }))
|
|
33
|
+
* await remove()
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function useConfirm(): ConfirmApi;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decimal-string arithmetic, exact by construction.
|
|
3
|
+
*
|
|
4
|
+
* Money is stored and computed as decimal strings — `0.1 + 0.2` in binary
|
|
5
|
+
* floating point is `0.30000000000000004`, which silently corrupts a total.
|
|
6
|
+
* Everything here scales to integers and uses `BigInt`, so a value only ever
|
|
7
|
+
* round-trips through `Number` if the caller asks for it.
|
|
8
|
+
*/
|
|
9
|
+
interface Decimal {
|
|
10
|
+
/** Unscaled value: `1234.56` at scale 2 is `123456n`. */
|
|
11
|
+
units: bigint;
|
|
12
|
+
/** Number of decimal places. */
|
|
13
|
+
scale: number;
|
|
14
|
+
}
|
|
15
|
+
/** Parse a canonical decimal string (`-1234.56`). Returns undefined if invalid. */
|
|
16
|
+
export declare function parseDecimal(value: string): Decimal | undefined;
|
|
17
|
+
/** Render a Decimal back to a canonical string. */
|
|
18
|
+
export declare function formatDecimal({ units, scale }: Decimal): string;
|
|
19
|
+
/** `-1` if a < b, `0` if equal, `1` if a > b. */
|
|
20
|
+
export declare function compareDecimals(a: string, b: string): number;
|
|
21
|
+
/** Exact addition. `addDecimals('0.1', '0.2')` is `'0.3'`, not `'0.30000000000000004'`. */
|
|
22
|
+
export declare function addDecimals(a: string, b: string): string | undefined;
|
|
23
|
+
/** Round half-up to a fixed number of decimal places. */
|
|
24
|
+
export declare function roundDecimal(value: string, precision: number): string | undefined;
|
|
25
|
+
/** Constrain a value to a range, comparing exactly. */
|
|
26
|
+
export declare function clampDecimal(value: string, min?: string, max?: string): string;
|
|
27
|
+
/** Whether a string is a well-formed decimal. */
|
|
28
|
+
export declare function isDecimal(value: string): boolean;
|
|
29
|
+
/** The separators a locale uses, e.g. `.`/`,` for `en`, `,`/`.` for `sl`. */
|
|
30
|
+
export declare function localeSeparators(locale: string): {
|
|
31
|
+
decimal: string;
|
|
32
|
+
group: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Render a canonical decimal for display, e.g. `"1234.56"` as `1.234,56` in
|
|
36
|
+
* `sl`. Formatting goes through the digits, never `Number`, so a value too
|
|
37
|
+
* large for a float still displays exactly.
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatForLocale(value: string, locale: string, precision?: number): string;
|
|
40
|
+
/**
|
|
41
|
+
* Render a canonical decimal for *editing*: the locale's decimal separator,
|
|
42
|
+
* but no grouping.
|
|
43
|
+
*
|
|
44
|
+
* Editing must not show the canonical `1234.56` in a locale where `.` groups
|
|
45
|
+
* digits — parsing that back would read it as `123456`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function toEditable(value: string, locale?: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Turn typed input into a canonical decimal, accepting the locale's
|
|
50
|
+
* separators. `1.234,56` in `sl` becomes `1234.56`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseFromLocale(input: string, locale: string): string | undefined;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IconLike } from './icon';
|
|
2
|
+
export interface DropdownMenuItemOption {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Leading icon component. */
|
|
5
|
+
icon?: IconLike;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Style the item as destructive. */
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
/** Run when the item is chosen. Omit on an entry that opens a submenu. */
|
|
10
|
+
onSelect?: () => void;
|
|
11
|
+
/** Nested entries. Turns this item into a submenu trigger. */
|
|
12
|
+
items?: DropdownMenuEntry[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One row of a menu.
|
|
16
|
+
*
|
|
17
|
+
* `'-'` renders a separator. An option with `items` opens a submenu, and one
|
|
18
|
+
* with neither `items` nor `onSelect` is a non-interactive group label.
|
|
19
|
+
*/
|
|
20
|
+
export type DropdownMenuEntry = DropdownMenuItemOption | '-';
|
|
21
|
+
export declare function isSeparator(entry: DropdownMenuEntry): entry is '-';
|
|
22
|
+
export declare function isSubmenu(entry: DropdownMenuItemOption): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IconArray } from '@hugeicons/vue';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Anything that can be rendered as an icon.
|
|
5
|
+
*
|
|
6
|
+
* Hugeicons ships icons as data arrays rather than components, so both forms
|
|
7
|
+
* are accepted: pass a Hugeicons export, or any component that renders an SVG.
|
|
8
|
+
*/
|
|
9
|
+
export type IconLike = Component | IconArray;
|
|
10
|
+
export declare function isIconArray(icon: IconLike): icon is IconArray;
|