iryx-ui 0.7.0 → 0.8.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 +51 -0
- package/dist/component-names.d.ts +1 -1
- package/dist/components/FileUpload.vue.d.ts +64 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43 -41
- package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +86 -7
- package/dist/packages/iryx-ui/src/component-names.js +1 -1
- package/dist/packages/iryx-ui/src/components/FileUpload.js +5 -0
- package/dist/packages/iryx-ui/src/components/FileUpload.vue_vue_type_script_setup_true_lang.js +209 -0
- package/dist/packages/iryx-ui/src/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/packages/iryx-ui/src/components/index.js +44 -42
- package/dist/packages/iryx-ui/src/theme/file-upload.js +29 -0
- package/dist/packages/iryx-ui/src/theme/password-input.js +1 -0
- package/dist/theme/file-upload.d.ts +143 -0
- package/dist/theme/form.d.ts +3 -3
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/password-input.d.ts +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -290,6 +290,7 @@ app.use(createIryxUi({ unstyled: true }))
|
|
|
290
290
|
| `IFormField` | Label, description, hint, help and error text around a control |
|
|
291
291
|
| `IInput` | Text field with `sm`/`md`/`lg` sizes, `invalid` state, `v-model`, `leading`/`trailing` slots, `clearable`, `loading`, `debounce` |
|
|
292
292
|
| `INumberInput` | Decimal-safe numeric field — the model is a **string**, with `min`/`max`/`step`, `precision` and locale-aware display |
|
|
293
|
+
| `IFileUpload` | Drag-and-drop file field with `accept` / `maxSize` / `maxFiles`, thumbnails and a remove action |
|
|
293
294
|
| `IDatePicker` | Calendar in a popover; the model is an ISO `YYYY-MM-DD` **string** |
|
|
294
295
|
| `IDateRangePicker` | Two-month range calendar; the model is `{ start, end }` ISO strings |
|
|
295
296
|
| `IPasswordInput` | Masked field with a show/hide toggle and an optional strength meter |
|
|
@@ -480,6 +481,56 @@ chrome; use `ui` to reach the parts (`root`, `input`, `leading`, `trailing`,
|
|
|
480
481
|
forwarded to the `<input>` itself. `ref` exposes the element as `.input` for
|
|
481
482
|
focus management.
|
|
482
483
|
|
|
484
|
+
#### Files
|
|
485
|
+
|
|
486
|
+
```vue
|
|
487
|
+
<script setup lang="ts">
|
|
488
|
+
import { ref } from 'vue'
|
|
489
|
+
|
|
490
|
+
const logo = ref<File[]>([])
|
|
491
|
+
</script>
|
|
492
|
+
|
|
493
|
+
<template>
|
|
494
|
+
<IFileUpload
|
|
495
|
+
v-model="logo"
|
|
496
|
+
accept="image/*"
|
|
497
|
+
:max-size="2 * 1024 * 1024"
|
|
498
|
+
label="Drag your logo here"
|
|
499
|
+
browse-label="Browse images"
|
|
500
|
+
hint="PNG, JPG or SVG up to 2 MB"
|
|
501
|
+
@reject="onReject"
|
|
502
|
+
/>
|
|
503
|
+
</template>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
The model is **always a `File[]`**, even without `multiple` — a `File | File[]`
|
|
507
|
+
union would make every caller narrow the type before touching it, and the
|
|
508
|
+
single case is just an array holding at most one. Without `multiple`, picking
|
|
509
|
+
again replaces rather than appends.
|
|
510
|
+
|
|
511
|
+
| Prop | Effect |
|
|
512
|
+
| --- | --- |
|
|
513
|
+
| `multiple` | Accept more than one file |
|
|
514
|
+
| `accept` | Native syntax: `image/*`, `.pdf`, `image/png` |
|
|
515
|
+
| `maxSize` | Largest accepted size, in bytes |
|
|
516
|
+
| `maxFiles` | Cap on how many files may be held at once |
|
|
517
|
+
| `label` | Prompt in the zone, above the hint |
|
|
518
|
+
| `browseLabel` | Text on the browse button |
|
|
519
|
+
| `hint` | Fine print under the prompt — the accepted types belong here |
|
|
520
|
+
|
|
521
|
+
Every string is a prop, including `removeLabel` and the three rejection
|
|
522
|
+
messages, so nothing bakes in English.
|
|
523
|
+
|
|
524
|
+
`accept` is enforced in the component as well as on the input, because a
|
|
525
|
+
dragged-in file bypasses the native filter entirely. Refused files raise
|
|
526
|
+
`@reject` with `{ file, reason }` — `'type'`, `'size'` or `'count'` — so you
|
|
527
|
+
can word your own message; the built-in text is available through the
|
|
528
|
+
`tooLargeText`, `wrongTypeText` and `tooManyText` props.
|
|
529
|
+
|
|
530
|
+
Image files get a thumbnail, anything else a placeholder of the same size so
|
|
531
|
+
rows stay aligned. The object URLs behind those thumbnails are revoked as soon
|
|
532
|
+
as a file leaves the list or the component unmounts.
|
|
533
|
+
|
|
483
534
|
#### Dates
|
|
484
535
|
|
|
485
536
|
The model is an ISO `YYYY-MM-DD` **string**, never a `Date`.
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Consumed by the Vue plugin (global registration) and the Nuxt module
|
|
4
4
|
* (auto-imports). Keep in sync with `src/components/index.ts`.
|
|
5
5
|
*/
|
|
6
|
-
export declare const componentNames: readonly ["Alert", "App", "Badge", "Banner", "Breadcrumb", "Button", "ButtonGroup", "Card", "Checkbox", "Combobox", "ConfirmDialog", "DatePicker", "DateRangePicker", "Dialog", "DropdownMenu", "EmptyState", "Form", "FormField", "Input", "Label", "NumberInput", "Pagination", "PasswordInput", "Progress", "RadioGroup", "Select", "Separator", "Skeleton", "Stat", "Stepper", "Switch", "Table", "Tabs", "Textarea", "Toaster", "Tooltip"];
|
|
6
|
+
export declare const componentNames: readonly ["Alert", "App", "Badge", "Banner", "Breadcrumb", "Button", "ButtonGroup", "Card", "Checkbox", "Combobox", "ConfirmDialog", "DatePicker", "DateRangePicker", "Dialog", "DropdownMenu", "EmptyState", "FileUpload", "Form", "FormField", "Input", "Label", "NumberInput", "Pagination", "PasswordInput", "Progress", "RadioGroup", "Select", "Separator", "Skeleton", "Stat", "Stepper", "Switch", "Table", "Tabs", "Textarea", "Toaster", "Tooltip"];
|
|
7
7
|
export type ComponentName = (typeof componentNames)[number];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Why a file was turned away, so the caller can word its own message. */
|
|
2
|
+
export interface FileRejection {
|
|
3
|
+
file: File;
|
|
4
|
+
reason: 'type' | 'size' | 'count';
|
|
5
|
+
}
|
|
6
|
+
export interface FileUploadProps {
|
|
7
|
+
/** Accept more than one file. The model is an array either way. */
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
/** Same syntax as the native attribute: `image/*`, `.pdf`, `image/png`. */
|
|
10
|
+
accept?: string;
|
|
11
|
+
/** Largest accepted size, in bytes. */
|
|
12
|
+
maxSize?: number;
|
|
13
|
+
/** Cap on how many files may be held at once. */
|
|
14
|
+
maxFiles?: number;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Mark the field as invalid — styles the border and ring red. */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Prompt inside the drop zone. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Secondary line under the prompt — good place for the accepted types. */
|
|
22
|
+
hint?: string;
|
|
23
|
+
/** Text on the browse button. */
|
|
24
|
+
browseLabel?: string;
|
|
25
|
+
/** Labels and messages — override for non-English apps. */
|
|
26
|
+
removeLabel?: string;
|
|
27
|
+
tooLargeText?: string;
|
|
28
|
+
wrongTypeText?: string;
|
|
29
|
+
tooManyText?: string;
|
|
30
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
31
|
+
unstyled?: boolean;
|
|
32
|
+
/** Applied to the outer wrapper, which stacks the zone above the list. */
|
|
33
|
+
class?: string;
|
|
34
|
+
/** Override classes per slot, e.g. `{ dropzone: 'py-10' }`. */
|
|
35
|
+
ui?: Partial<Record<'root' | 'dropzone' | 'input' | 'icon' | 'label' | 'browse' | 'hint' | 'list' | 'item' | 'thumbnail' | 'placeholder' | 'details' | 'name' | 'meta' | 'remove' | 'error', string>>;
|
|
36
|
+
}
|
|
37
|
+
type __VLS_Props = FileUploadProps;
|
|
38
|
+
type __VLS_ModelProps = {
|
|
39
|
+
/**
|
|
40
|
+
* Always an array, even when `multiple` is false — a `File | File[]` union
|
|
41
|
+
* would make every caller narrow the type before touching it, and the single
|
|
42
|
+
* case is just an array that holds at most one.
|
|
43
|
+
*/
|
|
44
|
+
modelValue?: File[];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
47
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
48
|
+
"update:modelValue": (value: File[]) => any;
|
|
49
|
+
reject: (rejections: FileRejection[]) => any;
|
|
50
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
51
|
+
"onUpdate:modelValue"?: ((value: File[]) => any) | undefined;
|
|
52
|
+
onReject?: ((rejections: FileRejection[]) => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
unstyled: boolean;
|
|
55
|
+
label: string;
|
|
56
|
+
invalid: boolean;
|
|
57
|
+
browseLabel: string;
|
|
58
|
+
removeLabel: string;
|
|
59
|
+
tooLargeText: string;
|
|
60
|
+
wrongTypeText: string;
|
|
61
|
+
tooManyText: string;
|
|
62
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
63
|
+
declare const _default: typeof __VLS_export;
|
|
64
|
+
export default _default;
|
|
@@ -14,6 +14,7 @@ export { default as DateRangePicker } from './DateRangePicker.vue';
|
|
|
14
14
|
export { default as Dialog } from './Dialog.vue';
|
|
15
15
|
export { default as DropdownMenu } from './DropdownMenu.vue';
|
|
16
16
|
export { default as EmptyState } from './EmptyState.vue';
|
|
17
|
+
export { default as FileUpload } from './FileUpload.vue';
|
|
17
18
|
export { default as Form } from './Form.vue';
|
|
18
19
|
export { default as FormField } from './FormField.vue';
|
|
19
20
|
export { default as Input } from './Input.vue';
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type { DateRange, DateRangePickerProps } from './components/DateRangePick
|
|
|
17
17
|
export type { DialogProps } from './components/Dialog.vue';
|
|
18
18
|
export type { DropdownMenuProps } from './components/DropdownMenu.vue';
|
|
19
19
|
export type { EmptyStateProps } from './components/EmptyState.vue';
|
|
20
|
+
export type { FileRejection, FileUploadProps } from './components/FileUpload.vue';
|
|
20
21
|
export type { FormProps } from './components/Form.vue';
|
|
21
22
|
export type { FormFieldProps } from './components/FormField.vue';
|
|
22
23
|
export type { InputProps } from './components/Input.vue';
|
package/dist/index.js
CHANGED
|
@@ -38,44 +38,46 @@ import { isSeparator as te, isSubmenu as ne } from "./packages/iryx-ui/src/compo
|
|
|
38
38
|
import re from "./packages/iryx-ui/src/components/DropdownMenu.js";
|
|
39
39
|
import { emptyStateTheme as ie } from "./packages/iryx-ui/src/theme/empty-state.js";
|
|
40
40
|
import ae from "./packages/iryx-ui/src/components/EmptyState.js";
|
|
41
|
-
import oe from "./packages/iryx-ui/src/
|
|
42
|
-
import
|
|
43
|
-
import ce from "./packages/iryx-ui/src/components/
|
|
44
|
-
import le from "./packages/iryx-ui/src/
|
|
45
|
-
import ue from "./packages/iryx-ui/src/components/
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import Ce from "./packages/iryx-ui/src/
|
|
49
|
-
import {
|
|
50
|
-
import Te from "./packages/iryx-ui/src/components/
|
|
51
|
-
import {
|
|
52
|
-
import De from "./packages/iryx-ui/src/components/
|
|
53
|
-
import {
|
|
54
|
-
import ke from "./packages/iryx-ui/src/components/
|
|
55
|
-
import {
|
|
56
|
-
import je from "./packages/iryx-ui/src/components/
|
|
57
|
-
import {
|
|
58
|
-
import Ne from "./packages/iryx-ui/src/components/
|
|
59
|
-
import {
|
|
60
|
-
import Fe from "./packages/iryx-ui/src/components/
|
|
61
|
-
import {
|
|
62
|
-
import Le from "./packages/iryx-ui/src/components/
|
|
63
|
-
import {
|
|
64
|
-
import ze from "./packages/iryx-ui/src/components/
|
|
65
|
-
import {
|
|
66
|
-
import Ve from "./packages/iryx-ui/src/components/
|
|
67
|
-
import {
|
|
68
|
-
import Ue from "./packages/iryx-ui/src/components/
|
|
69
|
-
import {
|
|
70
|
-
import
|
|
71
|
-
import qe from "./packages/iryx-ui/src/
|
|
72
|
-
import {
|
|
73
|
-
import Ye from "./packages/iryx-ui/src/components/
|
|
74
|
-
import Xe from "./packages/iryx-ui/src/
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import et from "./packages/iryx-ui/src/
|
|
78
|
-
import {
|
|
79
|
-
import nt from "./packages/iryx-ui/src/components/
|
|
80
|
-
import {
|
|
81
|
-
|
|
41
|
+
import { fileUploadTheme as oe } from "./packages/iryx-ui/src/theme/file-upload.js";
|
|
42
|
+
import se from "./packages/iryx-ui/src/components/FileUpload.js";
|
|
43
|
+
import ce from "./packages/iryx-ui/src/components/Form.js";
|
|
44
|
+
import { labelTheme as le } from "./packages/iryx-ui/src/theme/label.js";
|
|
45
|
+
import ue from "./packages/iryx-ui/src/components/Label.js";
|
|
46
|
+
import de from "./packages/iryx-ui/src/components/FormField.js";
|
|
47
|
+
import fe from "./packages/iryx-ui/src/components/Input.js";
|
|
48
|
+
import { addDecimals as pe, clampDecimal as me, compareDecimals as he, formatDecimal as ge, formatForLocale as _e, isDecimal as ve, localeSeparators as ye, parseDecimal as be, parseFromLocale as xe, roundDecimal as Se, toEditable as Ce } from "./packages/iryx-ui/src/composables/decimal.js";
|
|
49
|
+
import { numberInputTheme as we } from "./packages/iryx-ui/src/theme/number-input.js";
|
|
50
|
+
import Te from "./packages/iryx-ui/src/components/NumberInput.js";
|
|
51
|
+
import { paginationTheme as Ee } from "./packages/iryx-ui/src/theme/pagination.js";
|
|
52
|
+
import De from "./packages/iryx-ui/src/components/Pagination.js";
|
|
53
|
+
import { passwordInputTheme as Oe } from "./packages/iryx-ui/src/theme/password-input.js";
|
|
54
|
+
import ke from "./packages/iryx-ui/src/components/PasswordInput.js";
|
|
55
|
+
import { progressTheme as Ae } from "./packages/iryx-ui/src/theme/progress.js";
|
|
56
|
+
import je from "./packages/iryx-ui/src/components/Progress.js";
|
|
57
|
+
import { radioGroupTheme as Me } from "./packages/iryx-ui/src/theme/radio-group.js";
|
|
58
|
+
import Ne from "./packages/iryx-ui/src/components/RadioGroup.js";
|
|
59
|
+
import { selectTheme as Pe } from "./packages/iryx-ui/src/theme/select.js";
|
|
60
|
+
import Fe from "./packages/iryx-ui/src/components/Select.js";
|
|
61
|
+
import { separatorTheme as Ie } from "./packages/iryx-ui/src/theme/separator.js";
|
|
62
|
+
import Le from "./packages/iryx-ui/src/components/Separator.js";
|
|
63
|
+
import { skeletonTheme as Re } from "./packages/iryx-ui/src/theme/skeleton.js";
|
|
64
|
+
import ze from "./packages/iryx-ui/src/components/Skeleton.js";
|
|
65
|
+
import { statTheme as Be } from "./packages/iryx-ui/src/theme/stat.js";
|
|
66
|
+
import Ve from "./packages/iryx-ui/src/components/Stat.js";
|
|
67
|
+
import { stepperTheme as He } from "./packages/iryx-ui/src/theme/stepper.js";
|
|
68
|
+
import Ue from "./packages/iryx-ui/src/components/Stepper.js";
|
|
69
|
+
import { switchTheme as We } from "./packages/iryx-ui/src/theme/switch.js";
|
|
70
|
+
import Ge from "./packages/iryx-ui/src/components/Switch.js";
|
|
71
|
+
import { getRowValue as Ke, useDataTable as qe } from "./packages/iryx-ui/src/composables/data-table.js";
|
|
72
|
+
import { tableTheme as Je } from "./packages/iryx-ui/src/theme/table.js";
|
|
73
|
+
import Ye from "./packages/iryx-ui/src/components/Table.js";
|
|
74
|
+
import { tabsTheme as Xe } from "./packages/iryx-ui/src/theme/tabs.js";
|
|
75
|
+
import Ze from "./packages/iryx-ui/src/components/Tabs.js";
|
|
76
|
+
import Qe from "./packages/iryx-ui/src/components/Textarea.js";
|
|
77
|
+
import { useToast as $e, useToastState as et } from "./packages/iryx-ui/src/composables/toast.js";
|
|
78
|
+
import { toastTheme as tt } from "./packages/iryx-ui/src/theme/toast.js";
|
|
79
|
+
import nt from "./packages/iryx-ui/src/components/Toaster.js";
|
|
80
|
+
import { tooltipTheme as rt } from "./packages/iryx-ui/src/theme/tooltip.js";
|
|
81
|
+
import it from "./packages/iryx-ui/src/components/Tooltip.js";
|
|
82
|
+
import { IryxUi as at, createIryxUi as ot } from "./packages/iryx-ui/src/plugin.js";
|
|
83
|
+
export { a as Alert, d as App, p as Badge, h as Banner, _ as Breadcrumb, x as Button, C as ButtonGroup, K as CalendarDate, T as Card, D as Checkbox, z as Combobox, G as ConfirmDialog, Q as DatePicker, $ as DateRangePicker, W as Dialog, re as DropdownMenu, ae as EmptyState, se as FileUpload, ce as Form, de as FormField, fe as Input, at as IryxUi, ue as Label, Te as NumberInput, De as Pagination, ke as PasswordInput, je as Progress, Ne as RadioGroup, Fe as Select, Le as Separator, ze as Skeleton, Ve as Stat, Ue as Stepper, Ge as Switch, Ye as Table, Ze as Tabs, Qe as Textarea, nt as Toaster, it as Tooltip, pe as addDecimals, i as alertTheme, c as applyTheme, f as badgeTheme, m as bannerTheme, g as breadcrumbTheme, v as buttonGroupContextKey, S as buttonGroupTheme, b as buttonTheme, w as cardTheme, E as checkboxTheme, me as clampDecimal, l as clearTheme, R as comboboxTheme, he as compareDecimals, e as componentNames, ot as createIryxUi, Z as datePickerTheme, t as defaultConfig, U as dialogTheme, ee as dropdownMenuTheme, ie as emptyStateTheme, F as fieldBase, oe as fileUploadTheme, O as formContextKey, k as formFieldContextKey, ge as formatDecimal, _e as formatForLocale, q as formatIsoDate, A as getByPath, Ke as getRowValue, o as initAppearance, I as inputTheme, n as iryxUiConfigKey, ve as isDecimal, te as isSeparator, j as isStandardSchema, ne as isSubmenu, J as isoToday, M as issuePath, le as labelTheme, ye as localeSeparators, we as numberInputTheme, Ee as paginationTheme, be as parseDecimal, xe as parseFromLocale, Oe as passwordInputTheme, Ae as progressTheme, Me as radioGroupTheme, B as resolveConfirm, Se as roundDecimal, Pe as selectTheme, Ie as separatorTheme, Re as skeletonTheme, Be as statTheme, He as stepperTheme, We as switchTheme, Je as tableTheme, Xe as tabsTheme, L as textareaTheme, u as themes, Y as toCalendarDate, Ce as toEditable, X as toIsoDate, tt as toastTheme, rt as tooltipTheme, s as useAppearance, y as useButtonGroup, V as useConfirm, H as useConfirmState, qe as useDataTable, N as useForm, P as useFormField, r as useIryxUiConfig, $e as useToast, et as useToastState };
|
|
@@ -132,6 +132,60 @@ var e = [
|
|
|
132
132
|
strokeWidth: "1.5",
|
|
133
133
|
key: "1"
|
|
134
134
|
}]], l = [
|
|
135
|
+
["path", {
|
|
136
|
+
d: "M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",
|
|
137
|
+
stroke: "currentColor",
|
|
138
|
+
strokeLinecap: "round",
|
|
139
|
+
strokeWidth: "1.5",
|
|
140
|
+
key: "0"
|
|
141
|
+
}],
|
|
142
|
+
["path", {
|
|
143
|
+
d: "M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",
|
|
144
|
+
stroke: "currentColor",
|
|
145
|
+
strokeLinecap: "round",
|
|
146
|
+
strokeWidth: "1.5",
|
|
147
|
+
key: "1"
|
|
148
|
+
}],
|
|
149
|
+
["path", {
|
|
150
|
+
d: "M9.5 16.5L9.5 10.5",
|
|
151
|
+
stroke: "currentColor",
|
|
152
|
+
strokeLinecap: "round",
|
|
153
|
+
strokeWidth: "1.5",
|
|
154
|
+
key: "2"
|
|
155
|
+
}],
|
|
156
|
+
["path", {
|
|
157
|
+
d: "M14.5 16.5L14.5 10.5",
|
|
158
|
+
stroke: "currentColor",
|
|
159
|
+
strokeLinecap: "round",
|
|
160
|
+
strokeWidth: "1.5",
|
|
161
|
+
key: "3"
|
|
162
|
+
}]
|
|
163
|
+
], u = [
|
|
164
|
+
["path", {
|
|
165
|
+
d: "M8 7L16 7",
|
|
166
|
+
stroke: "currentColor",
|
|
167
|
+
strokeLinecap: "round",
|
|
168
|
+
strokeLinejoin: "round",
|
|
169
|
+
strokeWidth: "1.5",
|
|
170
|
+
key: "0"
|
|
171
|
+
}],
|
|
172
|
+
["path", {
|
|
173
|
+
d: "M8 11L12 11",
|
|
174
|
+
stroke: "currentColor",
|
|
175
|
+
strokeLinecap: "round",
|
|
176
|
+
strokeLinejoin: "round",
|
|
177
|
+
strokeWidth: "1.5",
|
|
178
|
+
key: "1"
|
|
179
|
+
}],
|
|
180
|
+
["path", {
|
|
181
|
+
d: "M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z",
|
|
182
|
+
stroke: "currentColor",
|
|
183
|
+
strokeLinecap: "round",
|
|
184
|
+
strokeLinejoin: "round",
|
|
185
|
+
strokeWidth: "1.5",
|
|
186
|
+
key: "2"
|
|
187
|
+
}]
|
|
188
|
+
], d = [
|
|
135
189
|
["circle", {
|
|
136
190
|
cx: "12",
|
|
137
191
|
cy: "12",
|
|
@@ -158,7 +212,7 @@ var e = [
|
|
|
158
212
|
strokeWidth: "1.5",
|
|
159
213
|
key: "2"
|
|
160
214
|
}]
|
|
161
|
-
],
|
|
215
|
+
], f = [
|
|
162
216
|
["path", {
|
|
163
217
|
d: "M12 3V6",
|
|
164
218
|
stroke: "currentColor",
|
|
@@ -215,21 +269,21 @@ var e = [
|
|
|
215
269
|
strokeWidth: "1.5",
|
|
216
270
|
key: "7"
|
|
217
271
|
}]
|
|
218
|
-
],
|
|
272
|
+
], p = [["path", {
|
|
219
273
|
d: "M20 12L4 12",
|
|
220
274
|
stroke: "currentColor",
|
|
221
275
|
strokeLinecap: "round",
|
|
222
276
|
strokeLinejoin: "round",
|
|
223
277
|
strokeWidth: "1.5",
|
|
224
278
|
key: "0"
|
|
225
|
-
}]],
|
|
279
|
+
}]], m = [["path", {
|
|
226
280
|
d: "M5 14L8.5 17.5L19 6.5",
|
|
227
281
|
stroke: "currentColor",
|
|
228
282
|
strokeLinecap: "round",
|
|
229
283
|
strokeLinejoin: "round",
|
|
230
284
|
strokeWidth: "1.5",
|
|
231
285
|
key: "0"
|
|
232
|
-
}]],
|
|
286
|
+
}]], h = [["path", {
|
|
233
287
|
d: "M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",
|
|
234
288
|
stroke: "currentColor",
|
|
235
289
|
strokeLinecap: "round",
|
|
@@ -243,7 +297,32 @@ var e = [
|
|
|
243
297
|
strokeLinejoin: "round",
|
|
244
298
|
strokeWidth: "1.5",
|
|
245
299
|
key: "1"
|
|
246
|
-
}]],
|
|
300
|
+
}]], g = [
|
|
301
|
+
["path", {
|
|
302
|
+
d: "M2.50006 13.5V6.5H21.5001V13.5C21.5001 17.2712 21.5001 19.1569 20.3285 20.3284C19.1569 21.5 17.2713 21.5 13.5001 21.5H10.5001C6.72883 21.5 4.84321 21.5 3.67163 20.3284C2.50006 19.1569 2.50006 17.2712 2.50006 13.5Z",
|
|
303
|
+
stroke: "currentColor",
|
|
304
|
+
strokeLinecap: "round",
|
|
305
|
+
strokeLinejoin: "round",
|
|
306
|
+
strokeWidth: "1.5",
|
|
307
|
+
key: "0"
|
|
308
|
+
}],
|
|
309
|
+
["path", {
|
|
310
|
+
d: "M2.50006 6.5L3.10006 5.7C4.27777 4.12972 4.86662 3.34458 5.71121 2.92229C6.55579 2.5 7.53721 2.5 9.50006 2.5H14.5001C16.4629 2.5 17.4443 2.5 18.2889 2.92229C19.1335 3.34458 19.7224 4.12972 20.9001 5.7L21.5001 6.5",
|
|
311
|
+
stroke: "currentColor",
|
|
312
|
+
strokeLinecap: "round",
|
|
313
|
+
strokeLinejoin: "round",
|
|
314
|
+
strokeWidth: "1.5",
|
|
315
|
+
key: "1"
|
|
316
|
+
}],
|
|
317
|
+
["path", {
|
|
318
|
+
d: "M15.0001 13.5C15.0001 13.5 12.7906 10.5 12 10.5C11.2095 10.5 9.00006 13.5 9.00006 13.5M12 11L12.0001 17.5",
|
|
319
|
+
stroke: "currentColor",
|
|
320
|
+
strokeLinecap: "round",
|
|
321
|
+
strokeLinejoin: "round",
|
|
322
|
+
strokeWidth: "1.5",
|
|
323
|
+
key: "2"
|
|
324
|
+
}]
|
|
325
|
+
], _ = [
|
|
247
326
|
["path", {
|
|
248
327
|
d: "M22 8C22 8 18 14 12 14C6 14 2 8 2 8",
|
|
249
328
|
stroke: "currentColor",
|
|
@@ -283,7 +362,7 @@ var e = [
|
|
|
283
362
|
strokeWidth: "1.5",
|
|
284
363
|
key: "4"
|
|
285
364
|
}]
|
|
286
|
-
],
|
|
365
|
+
], v = [["path", {
|
|
287
366
|
d: "M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z",
|
|
288
367
|
stroke: "currentColor",
|
|
289
368
|
strokeWidth: "1.5",
|
|
@@ -295,4 +374,4 @@ var e = [
|
|
|
295
374
|
key: "1"
|
|
296
375
|
}]];
|
|
297
376
|
//#endregion
|
|
298
|
-
export { e as Alert02Icon, t as AlertCircleIcon, n as ArrowDown01Icon, r as ArrowLeft01Icon, i as ArrowRight01Icon, a as ArrowUp01Icon, o as Calendar03Icon, s as Cancel01Icon, c as CheckmarkCircle02Icon, l as
|
|
377
|
+
export { e as Alert02Icon, t as AlertCircleIcon, n as ArrowDown01Icon, r as ArrowLeft01Icon, i as ArrowRight01Icon, a as ArrowUp01Icon, o as Calendar03Icon, s as Cancel01Icon, c as CheckmarkCircle02Icon, l as Delete02Icon, u as File01Icon, d as InformationCircleIcon, f as Loading03Icon, p as MinusSignIcon, m as Tick02Icon, h as UnfoldMoreIcon, g as Upload05Icon, v as ViewIcon, _ as ViewOffIcon };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/component-names.ts
|
|
2
|
-
var e = /* @__PURE__ */ "Alert.App.Badge.Banner.Breadcrumb.Button.ButtonGroup.Card.Checkbox.Combobox.ConfirmDialog.DatePicker.DateRangePicker.Dialog.DropdownMenu.EmptyState.Form.FormField.Input.Label.NumberInput.Pagination.PasswordInput.Progress.RadioGroup.Select.Separator.Skeleton.Stat.Stepper.Switch.Table.Tabs.Textarea.Toaster.Tooltip".split(".");
|
|
2
|
+
var e = /* @__PURE__ */ "Alert.App.Badge.Banner.Breadcrumb.Button.ButtonGroup.Card.Checkbox.Combobox.ConfirmDialog.DatePicker.DateRangePicker.Dialog.DropdownMenu.EmptyState.FileUpload.Form.FormField.Input.Label.NumberInput.Pagination.PasswordInput.Progress.RadioGroup.Select.Separator.Skeleton.Stat.Stepper.Switch.Table.Tabs.Textarea.Toaster.Tooltip".split(".");
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as componentNames };
|
package/dist/packages/iryx-ui/src/components/FileUpload.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Delete02Icon as e, File01Icon as t, Upload05Icon as n } from "../../../../node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js";
|
|
2
|
+
import { useIryxUiConfig as r } from "../config.js";
|
|
3
|
+
import i from "./Icon.js";
|
|
4
|
+
import a from "./Button.js";
|
|
5
|
+
import { useFormField as o } from "../composables/form.js";
|
|
6
|
+
import { fileUploadTheme as s } from "../theme/file-upload.js";
|
|
7
|
+
import { Fragment as c, computed as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, normalizeClass as _, onBeforeUnmount as v, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, useModel as w, watch as T, withCtx as E, withModifiers as D } from "vue";
|
|
8
|
+
//#region src/components/FileUpload.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var O = [
|
|
10
|
+
"id",
|
|
11
|
+
"multiple",
|
|
12
|
+
"accept",
|
|
13
|
+
"disabled",
|
|
14
|
+
"aria-invalid",
|
|
15
|
+
"aria-describedby"
|
|
16
|
+
], k = ["src"], A = [
|
|
17
|
+
"aria-label",
|
|
18
|
+
"disabled",
|
|
19
|
+
"onClick"
|
|
20
|
+
], j = /*@__PURE__*/ h({
|
|
21
|
+
__name: "FileUpload",
|
|
22
|
+
props: /*@__PURE__*/ g({
|
|
23
|
+
multiple: { type: Boolean },
|
|
24
|
+
accept: {},
|
|
25
|
+
maxSize: {},
|
|
26
|
+
maxFiles: {},
|
|
27
|
+
disabled: { type: Boolean },
|
|
28
|
+
invalid: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
id: {},
|
|
33
|
+
label: { default: "Drag and drop a file here" },
|
|
34
|
+
hint: {},
|
|
35
|
+
browseLabel: { default: "Browse files" },
|
|
36
|
+
removeLabel: { default: "Remove" },
|
|
37
|
+
tooLargeText: { default: "is too large" },
|
|
38
|
+
wrongTypeText: { default: "is not an accepted type" },
|
|
39
|
+
tooManyText: { default: "exceeds the file limit" },
|
|
40
|
+
unstyled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: void 0
|
|
43
|
+
},
|
|
44
|
+
class: {},
|
|
45
|
+
ui: {}
|
|
46
|
+
}, {
|
|
47
|
+
modelValue: { default: () => [] },
|
|
48
|
+
modelModifiers: {}
|
|
49
|
+
}),
|
|
50
|
+
emits: /*@__PURE__*/ g(["reject"], ["update:modelValue"]),
|
|
51
|
+
setup(h, { emit: g }) {
|
|
52
|
+
let j = h, ee = g, M = w(h, "modelValue"), N = o(), P = l(() => j.id ?? N?.id.value), F = l(() => j.invalid ?? N?.invalid.value ?? !1), I = r(), L = l(() => j.unstyled ?? I.unstyled), R = b([]);
|
|
53
|
+
function z(e) {
|
|
54
|
+
if (!j.accept) return !0;
|
|
55
|
+
let t = e.name.toLowerCase(), n = e.type.toLowerCase();
|
|
56
|
+
return j.accept.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean).some((e) => e.startsWith(".") ? t.endsWith(e) : e.endsWith("/*") ? n.startsWith(e.slice(0, -1)) : n === e);
|
|
57
|
+
}
|
|
58
|
+
function B(e) {
|
|
59
|
+
let t = [], n = [], r = j.multiple ? M.value : [];
|
|
60
|
+
for (let i of e) {
|
|
61
|
+
if (!z(i)) {
|
|
62
|
+
n.push({
|
|
63
|
+
file: i,
|
|
64
|
+
reason: "type"
|
|
65
|
+
});
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (j.maxSize != null && i.size > j.maxSize) {
|
|
69
|
+
n.push({
|
|
70
|
+
file: i,
|
|
71
|
+
reason: "size"
|
|
72
|
+
});
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
let e = j.multiple ? j.maxFiles : 1;
|
|
76
|
+
if (e != null && r.length + t.length >= e) {
|
|
77
|
+
n.push({
|
|
78
|
+
file: i,
|
|
79
|
+
reason: "count"
|
|
80
|
+
});
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
t.push(i);
|
|
84
|
+
}
|
|
85
|
+
R.value = n, n.length && ee("reject", n), t.length && (M.value = [...r, ...t]);
|
|
86
|
+
}
|
|
87
|
+
let V = b();
|
|
88
|
+
function H(e) {
|
|
89
|
+
let t = e.target;
|
|
90
|
+
B([...t.files ?? []]), t.value = "";
|
|
91
|
+
}
|
|
92
|
+
function U(e) {
|
|
93
|
+
M.value = M.value.filter((t, n) => n !== e);
|
|
94
|
+
}
|
|
95
|
+
let W = b(0), G = l(() => W.value > 0);
|
|
96
|
+
function K() {
|
|
97
|
+
j.disabled || W.value++;
|
|
98
|
+
}
|
|
99
|
+
function q() {
|
|
100
|
+
W.value > 0 && W.value--;
|
|
101
|
+
}
|
|
102
|
+
function J(e) {
|
|
103
|
+
W.value = 0, !j.disabled && B([...e.dataTransfer?.files ?? []]);
|
|
104
|
+
}
|
|
105
|
+
let Y = b(/* @__PURE__ */ new Map());
|
|
106
|
+
T(M, (e) => {
|
|
107
|
+
for (let [t, n] of Y.value) e.includes(t) || (URL.revokeObjectURL(n), Y.value.delete(t));
|
|
108
|
+
for (let t of e) t.type.startsWith("image/") && !Y.value.has(t) && Y.value.set(t, URL.createObjectURL(t));
|
|
109
|
+
}, {
|
|
110
|
+
immediate: !0,
|
|
111
|
+
deep: !0
|
|
112
|
+
}), v(() => {
|
|
113
|
+
for (let e of Y.value.values()) URL.revokeObjectURL(e);
|
|
114
|
+
});
|
|
115
|
+
function X(e) {
|
|
116
|
+
let t = [
|
|
117
|
+
"B",
|
|
118
|
+
"kB",
|
|
119
|
+
"MB",
|
|
120
|
+
"GB"
|
|
121
|
+
], n = e, r = 0;
|
|
122
|
+
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r++;
|
|
123
|
+
return `${r === 0 ? n : Math.round(n * 10) / 10} ${t[r]}`;
|
|
124
|
+
}
|
|
125
|
+
function Z(e) {
|
|
126
|
+
let t = e.reason === "size" ? j.tooLargeText : e.reason === "type" ? j.wrongTypeText : j.tooManyText;
|
|
127
|
+
return `${e.file.name} ${t}`;
|
|
128
|
+
}
|
|
129
|
+
let Q = l(() => s({
|
|
130
|
+
dragging: G.value,
|
|
131
|
+
invalid: F.value,
|
|
132
|
+
disabled: j.disabled
|
|
133
|
+
}));
|
|
134
|
+
function $(e, t) {
|
|
135
|
+
let n = j.ui?.[e];
|
|
136
|
+
return L.value ? [n, t] : Q.value[e]({ class: [n, t] });
|
|
137
|
+
}
|
|
138
|
+
let te = l(() => L.value ? j.ui?.browse : Q.value.browse({ class: j.ui?.browse }));
|
|
139
|
+
return (r, o) => (y(), d("div", { class: _($("root", j.class)) }, [
|
|
140
|
+
f("label", {
|
|
141
|
+
class: _($("dropzone")),
|
|
142
|
+
onDragenter: D(K, ["prevent"]),
|
|
143
|
+
onDragover: o[0] ||= D(() => {}, ["prevent"]),
|
|
144
|
+
onDragleave: D(q, ["prevent"]),
|
|
145
|
+
onDrop: D(J, ["prevent"])
|
|
146
|
+
}, [
|
|
147
|
+
f("input", {
|
|
148
|
+
id: P.value,
|
|
149
|
+
ref_key: "inputEl",
|
|
150
|
+
ref: V,
|
|
151
|
+
type: "file",
|
|
152
|
+
multiple: j.multiple,
|
|
153
|
+
accept: j.accept,
|
|
154
|
+
disabled: j.disabled,
|
|
155
|
+
"aria-invalid": F.value || void 0,
|
|
156
|
+
"aria-describedby": C(N)?.describedBy.value,
|
|
157
|
+
class: _($("input")),
|
|
158
|
+
onChange: H
|
|
159
|
+
}, null, 42, O),
|
|
160
|
+
f("span", { class: _($("icon")) }, [m(i, { icon: C(n) }, null, 8, ["icon"])], 2),
|
|
161
|
+
f("span", { class: _($("label")) }, S(j.label), 3),
|
|
162
|
+
j.hint ? (y(), d("span", {
|
|
163
|
+
key: 0,
|
|
164
|
+
class: _($("hint"))
|
|
165
|
+
}, S(j.hint), 3)) : u("", !0),
|
|
166
|
+
m(a, {
|
|
167
|
+
as: "span",
|
|
168
|
+
variant: "outline",
|
|
169
|
+
size: "sm",
|
|
170
|
+
class: _(te.value)
|
|
171
|
+
}, {
|
|
172
|
+
default: E(() => [p(S(j.browseLabel), 1)]),
|
|
173
|
+
_: 1
|
|
174
|
+
}, 8, ["class"])
|
|
175
|
+
], 34),
|
|
176
|
+
(y(!0), d(c, null, x(R.value, (e) => (y(), d("p", {
|
|
177
|
+
key: e.file.name,
|
|
178
|
+
class: _($("error"))
|
|
179
|
+
}, S(Z(e)), 3))), 128)),
|
|
180
|
+
M.value.length ? (y(), d("ul", {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: _($("list"))
|
|
183
|
+
}, [(y(!0), d(c, null, x(M.value, (n, r) => (y(), d("li", {
|
|
184
|
+
key: `${n.name}-${r}`,
|
|
185
|
+
class: _($("item"))
|
|
186
|
+
}, [
|
|
187
|
+
Y.value.get(n) ? (y(), d("img", {
|
|
188
|
+
key: 0,
|
|
189
|
+
src: Y.value.get(n),
|
|
190
|
+
alt: "",
|
|
191
|
+
class: _($("thumbnail"))
|
|
192
|
+
}, null, 10, k)) : (y(), d("span", {
|
|
193
|
+
key: 1,
|
|
194
|
+
class: _($("placeholder"))
|
|
195
|
+
}, [m(i, { icon: C(t) }, null, 8, ["icon"])], 2)),
|
|
196
|
+
f("span", { class: _($("details")) }, [f("span", { class: _($("name")) }, S(n.name), 3), f("span", { class: _($("meta")) }, S(X(n.size)), 3)], 2),
|
|
197
|
+
f("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
"aria-label": `${j.removeLabel} ${n.name}`,
|
|
200
|
+
disabled: j.disabled,
|
|
201
|
+
class: _($("remove")),
|
|
202
|
+
onClick: (e) => U(r)
|
|
203
|
+
}, [m(i, { icon: C(e) }, null, 8, ["icon"])], 10, A)
|
|
204
|
+
], 2))), 128))], 2)) : u("", !0)
|
|
205
|
+
], 2));
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
//#endregion
|
|
209
|
+
export { j as default };
|
package/dist/packages/iryx-ui/src/components/PasswordInput.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -52,12 +52,12 @@ var w = [
|
|
|
52
52
|
if (!e) return 0;
|
|
53
53
|
let t = 0;
|
|
54
54
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[a-z]/.test(e) && /[A-Z]/.test(e) && t++, /\d/.test(e) && t++, /[^\w\s]/.test(e) && t++, Math.max(1, Math.min(t, 4));
|
|
55
|
-
}), j = s(() => m.strength && E.value.length > 0), M = s(() => a({ score: A.value }));
|
|
56
|
-
function
|
|
55
|
+
}), j = s(() => m.strength && E.value.length > 0), M = s(() => a({ score: A.value })), N = s(() => O.value ? m.ui?.input : M.value.input({ class: m.ui?.input }));
|
|
56
|
+
function P(e, t) {
|
|
57
57
|
let n = m.ui?.[e];
|
|
58
58
|
return O.value ? [n, t] : M.value[e]({ class: [n, t] });
|
|
59
59
|
}
|
|
60
|
-
return (n, a) => (_(), l("div", { class: g(
|
|
60
|
+
return (n, a) => (_(), l("div", { class: g(P("root", m.class)) }, [f(i, h({
|
|
61
61
|
id: m.id,
|
|
62
62
|
modelValue: E.value,
|
|
63
63
|
"onUpdate:modelValue": a[1] ||= (e) => E.value = e,
|
|
@@ -68,7 +68,7 @@ var w = [
|
|
|
68
68
|
required: m.required,
|
|
69
69
|
invalid: m.invalid,
|
|
70
70
|
unstyled: m.unstyled,
|
|
71
|
-
ui: { input:
|
|
71
|
+
ui: { input: N.value },
|
|
72
72
|
autocomplete: "current-password"
|
|
73
73
|
}, n.$attrs), d({ _: 2 }, [m.toggle ? {
|
|
74
74
|
name: "trailing",
|
|
@@ -78,7 +78,7 @@ var w = [
|
|
|
78
78
|
"aria-label": k.value ? m.hideLabel : m.showLabel,
|
|
79
79
|
"aria-pressed": k.value,
|
|
80
80
|
disabled: m.disabled,
|
|
81
|
-
class: g(
|
|
81
|
+
class: g(P("toggle")),
|
|
82
82
|
onClick: a[0] ||= (e) => k.value = !k.value
|
|
83
83
|
}, [f(r, { icon: k.value ? x(t) : x(e) }, null, 8, ["icon"])], 10, w)]),
|
|
84
84
|
key: "0"
|
|
@@ -95,16 +95,16 @@ var w = [
|
|
|
95
95
|
"ui"
|
|
96
96
|
]), j.value ? (_(), l("div", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class: g(
|
|
98
|
+
class: g(P("meter"))
|
|
99
99
|
}, [u("div", {
|
|
100
|
-
class: g(
|
|
100
|
+
class: g(P("track")),
|
|
101
101
|
"aria-hidden": "true"
|
|
102
102
|
}, [(_(), l(o, null, y(4, (e) => u("span", {
|
|
103
103
|
key: e,
|
|
104
104
|
"data-filled": e <= A.value ? "" : void 0,
|
|
105
|
-
class: g(
|
|
105
|
+
class: g(P("segment"))
|
|
106
106
|
}, null, 10, T)), 64))], 2), u("span", {
|
|
107
|
-
class: g(
|
|
107
|
+
class: g(P("label")),
|
|
108
108
|
role: "status"
|
|
109
109
|
}, b(m.strengthLabels[A.value - 1]), 3)], 2)) : c("", !0)], 2));
|
|
110
110
|
}
|
|
@@ -15,28 +15,29 @@ import p from "./DatePicker.js";
|
|
|
15
15
|
import m from "./DateRangePicker.js";
|
|
16
16
|
import h from "./DropdownMenu.js";
|
|
17
17
|
import g from "./EmptyState.js";
|
|
18
|
-
import _ from "./
|
|
19
|
-
import v from "./
|
|
20
|
-
import y from "./
|
|
21
|
-
import b from "./
|
|
22
|
-
import x from "./
|
|
23
|
-
import S from "./
|
|
24
|
-
import C from "./
|
|
25
|
-
import w from "./
|
|
26
|
-
import T from "./
|
|
27
|
-
import E from "./
|
|
28
|
-
import D from "./
|
|
29
|
-
import O from "./
|
|
30
|
-
import k from "./
|
|
31
|
-
import A from "./
|
|
32
|
-
import j from "./
|
|
33
|
-
import M from "./
|
|
34
|
-
import N from "./
|
|
35
|
-
import P from "./
|
|
36
|
-
import F from "./
|
|
37
|
-
import I from "./
|
|
18
|
+
import _ from "./FileUpload.js";
|
|
19
|
+
import v from "./Form.js";
|
|
20
|
+
import y from "./Label.js";
|
|
21
|
+
import b from "./FormField.js";
|
|
22
|
+
import x from "./Input.js";
|
|
23
|
+
import S from "./NumberInput.js";
|
|
24
|
+
import C from "./Pagination.js";
|
|
25
|
+
import w from "./PasswordInput.js";
|
|
26
|
+
import T from "./Progress.js";
|
|
27
|
+
import E from "./RadioGroup.js";
|
|
28
|
+
import D from "./Select.js";
|
|
29
|
+
import O from "./Separator.js";
|
|
30
|
+
import k from "./Skeleton.js";
|
|
31
|
+
import A from "./Stat.js";
|
|
32
|
+
import j from "./Stepper.js";
|
|
33
|
+
import M from "./Switch.js";
|
|
34
|
+
import N from "./Table.js";
|
|
35
|
+
import P from "./Tabs.js";
|
|
36
|
+
import F from "./Textarea.js";
|
|
37
|
+
import I from "./Toaster.js";
|
|
38
|
+
import L from "./Tooltip.js";
|
|
38
39
|
//#region src/components/index.ts
|
|
39
|
-
var
|
|
40
|
+
var R = /* @__PURE__ */ e({
|
|
40
41
|
Alert: () => t,
|
|
41
42
|
App: () => n,
|
|
42
43
|
Badge: () => r,
|
|
@@ -53,26 +54,27 @@ var L = /* @__PURE__ */ e({
|
|
|
53
54
|
Dialog: () => d,
|
|
54
55
|
DropdownMenu: () => h,
|
|
55
56
|
EmptyState: () => g,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
57
|
+
FileUpload: () => _,
|
|
58
|
+
Form: () => v,
|
|
59
|
+
FormField: () => b,
|
|
60
|
+
Input: () => x,
|
|
61
|
+
Label: () => y,
|
|
62
|
+
NumberInput: () => S,
|
|
63
|
+
Pagination: () => C,
|
|
64
|
+
PasswordInput: () => w,
|
|
65
|
+
Progress: () => T,
|
|
66
|
+
RadioGroup: () => E,
|
|
67
|
+
Select: () => D,
|
|
68
|
+
Separator: () => O,
|
|
69
|
+
Skeleton: () => k,
|
|
70
|
+
Stat: () => A,
|
|
71
|
+
Stepper: () => j,
|
|
72
|
+
Switch: () => M,
|
|
73
|
+
Table: () => N,
|
|
74
|
+
Tabs: () => P,
|
|
75
|
+
Textarea: () => F,
|
|
76
|
+
Toaster: () => I,
|
|
77
|
+
Tooltip: () => L
|
|
76
78
|
});
|
|
77
79
|
//#endregion
|
|
78
|
-
export {
|
|
80
|
+
export { R as components_exports };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { tv as e } from "tailwind-variants";
|
|
2
|
+
//#region src/theme/file-upload.ts
|
|
3
|
+
var t = e({
|
|
4
|
+
slots: {
|
|
5
|
+
root: "flex w-full flex-col gap-3",
|
|
6
|
+
dropzone: "flex cursor-pointer flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-border bg-input px-4 py-6 text-center transition-colors focus-within:ring-2 focus-within:ring-primary/50 hover:border-primary/50",
|
|
7
|
+
input: "sr-only",
|
|
8
|
+
icon: "flex size-12 items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:size-5",
|
|
9
|
+
label: "text-sm text-foreground",
|
|
10
|
+
browse: "mt-2",
|
|
11
|
+
hint: "text-xs text-muted-foreground",
|
|
12
|
+
list: "flex flex-col gap-2",
|
|
13
|
+
item: "flex items-center gap-3 rounded-xl border border-border bg-input p-2",
|
|
14
|
+
thumbnail: "size-10 shrink-0 rounded-lg object-cover",
|
|
15
|
+
placeholder: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground [&_svg]:size-4",
|
|
16
|
+
details: "flex min-w-0 flex-1 flex-col",
|
|
17
|
+
name: "truncate text-sm text-foreground",
|
|
18
|
+
meta: "text-xs text-muted-foreground tabular-nums",
|
|
19
|
+
remove: "flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors outline-none hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-primary/50 [&_svg]:size-4",
|
|
20
|
+
error: "text-xs text-danger"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
dragging: { true: { dropzone: "border-primary bg-accent" } },
|
|
24
|
+
invalid: { true: { dropzone: "border-red-500 focus-within:ring-red-500/40" } },
|
|
25
|
+
disabled: { true: { dropzone: "pointer-events-none opacity-50" } }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { t as fileUploadTheme };
|
|
@@ -3,6 +3,7 @@ import { tv as e } from "tailwind-variants";
|
|
|
3
3
|
var t = e({
|
|
4
4
|
slots: {
|
|
5
5
|
root: "flex w-full flex-col gap-2",
|
|
6
|
+
input: "[&::-ms-clear]:hidden [&::-ms-reveal]:hidden",
|
|
6
7
|
toggle: "flex items-center rounded-md text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/50 [&_svg]:size-4",
|
|
7
8
|
meter: "flex items-center gap-2",
|
|
8
9
|
track: "flex h-1 flex-1 gap-1",
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
export declare const fileUploadTheme: import("tailwind-variants").TVReturnType<{
|
|
2
|
+
/** Held during a drag, so the target is unmistakable while dragging. */
|
|
3
|
+
dragging: {
|
|
4
|
+
true: {
|
|
5
|
+
dropzone: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
invalid: {
|
|
9
|
+
true: {
|
|
10
|
+
dropzone: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
disabled: {
|
|
14
|
+
true: {
|
|
15
|
+
dropzone: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
root: string;
|
|
20
|
+
/**
|
|
21
|
+
* A label, so a click anywhere on the zone opens the picker without any
|
|
22
|
+
* script — the `<input type="file">` inside stays the real control and
|
|
23
|
+
* keeps its native keyboard and screen-reader behaviour.
|
|
24
|
+
*/
|
|
25
|
+
dropzone: string;
|
|
26
|
+
/** Visually hidden rather than `display:none`, which drops it from the tab order. */
|
|
27
|
+
input: string;
|
|
28
|
+
/**
|
|
29
|
+
* A filled disc behind the glyph. A bare icon floating in the middle of a
|
|
30
|
+
* large dashed box reads as an artefact; the disc gives it enough weight
|
|
31
|
+
* to be the thing the zone is built around.
|
|
32
|
+
*/
|
|
33
|
+
icon: string;
|
|
34
|
+
label: string;
|
|
35
|
+
/** Spacing only — the look comes from Button, so it tracks the theme. */
|
|
36
|
+
browse: string;
|
|
37
|
+
hint: string;
|
|
38
|
+
list: string;
|
|
39
|
+
item: string;
|
|
40
|
+
thumbnail: string;
|
|
41
|
+
/** Stand-in for anything without a preview, so rows stay the same height. */
|
|
42
|
+
placeholder: string;
|
|
43
|
+
details: string;
|
|
44
|
+
name: string;
|
|
45
|
+
meta: string;
|
|
46
|
+
remove: string;
|
|
47
|
+
error: string;
|
|
48
|
+
}, undefined, {
|
|
49
|
+
/** Held during a drag, so the target is unmistakable while dragging. */
|
|
50
|
+
dragging: {
|
|
51
|
+
true: {
|
|
52
|
+
dropzone: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
invalid: {
|
|
56
|
+
true: {
|
|
57
|
+
dropzone: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
disabled: {
|
|
61
|
+
true: {
|
|
62
|
+
dropzone: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}, {
|
|
66
|
+
root: string;
|
|
67
|
+
/**
|
|
68
|
+
* A label, so a click anywhere on the zone opens the picker without any
|
|
69
|
+
* script — the `<input type="file">` inside stays the real control and
|
|
70
|
+
* keeps its native keyboard and screen-reader behaviour.
|
|
71
|
+
*/
|
|
72
|
+
dropzone: string;
|
|
73
|
+
/** Visually hidden rather than `display:none`, which drops it from the tab order. */
|
|
74
|
+
input: string;
|
|
75
|
+
/**
|
|
76
|
+
* A filled disc behind the glyph. A bare icon floating in the middle of a
|
|
77
|
+
* large dashed box reads as an artefact; the disc gives it enough weight
|
|
78
|
+
* to be the thing the zone is built around.
|
|
79
|
+
*/
|
|
80
|
+
icon: string;
|
|
81
|
+
label: string;
|
|
82
|
+
/** Spacing only — the look comes from Button, so it tracks the theme. */
|
|
83
|
+
browse: string;
|
|
84
|
+
hint: string;
|
|
85
|
+
list: string;
|
|
86
|
+
item: string;
|
|
87
|
+
thumbnail: string;
|
|
88
|
+
/** Stand-in for anything without a preview, so rows stay the same height. */
|
|
89
|
+
placeholder: string;
|
|
90
|
+
details: string;
|
|
91
|
+
name: string;
|
|
92
|
+
meta: string;
|
|
93
|
+
remove: string;
|
|
94
|
+
error: string;
|
|
95
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
96
|
+
/** Held during a drag, so the target is unmistakable while dragging. */
|
|
97
|
+
dragging: {
|
|
98
|
+
true: {
|
|
99
|
+
dropzone: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
invalid: {
|
|
103
|
+
true: {
|
|
104
|
+
dropzone: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
disabled: {
|
|
108
|
+
true: {
|
|
109
|
+
dropzone: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}, {
|
|
113
|
+
root: string;
|
|
114
|
+
/**
|
|
115
|
+
* A label, so a click anywhere on the zone opens the picker without any
|
|
116
|
+
* script — the `<input type="file">` inside stays the real control and
|
|
117
|
+
* keeps its native keyboard and screen-reader behaviour.
|
|
118
|
+
*/
|
|
119
|
+
dropzone: string;
|
|
120
|
+
/** Visually hidden rather than `display:none`, which drops it from the tab order. */
|
|
121
|
+
input: string;
|
|
122
|
+
/**
|
|
123
|
+
* A filled disc behind the glyph. A bare icon floating in the middle of a
|
|
124
|
+
* large dashed box reads as an artefact; the disc gives it enough weight
|
|
125
|
+
* to be the thing the zone is built around.
|
|
126
|
+
*/
|
|
127
|
+
icon: string;
|
|
128
|
+
label: string;
|
|
129
|
+
/** Spacing only — the look comes from Button, so it tracks the theme. */
|
|
130
|
+
browse: string;
|
|
131
|
+
hint: string;
|
|
132
|
+
list: string;
|
|
133
|
+
item: string;
|
|
134
|
+
thumbnail: string;
|
|
135
|
+
/** Stand-in for anything without a preview, so rows stay the same height. */
|
|
136
|
+
placeholder: string;
|
|
137
|
+
details: string;
|
|
138
|
+
name: string;
|
|
139
|
+
meta: string;
|
|
140
|
+
remove: string;
|
|
141
|
+
error: string;
|
|
142
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
143
|
+
export type FileUploadSlots = keyof ReturnType<typeof fileUploadTheme>;
|
package/dist/theme/form.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare const formFieldTheme: import("tailwind-variants").TVReturnType<{
|
|
|
5
5
|
description?: import("tailwind-variants").ClassValue;
|
|
6
6
|
label?: import("tailwind-variants").ClassValue;
|
|
7
7
|
header?: import("tailwind-variants").ClassValue;
|
|
8
|
-
error?: import("tailwind-variants").ClassValue;
|
|
9
8
|
hint?: import("tailwind-variants").ClassValue;
|
|
9
|
+
error?: import("tailwind-variants").ClassValue;
|
|
10
10
|
control?: import("tailwind-variants").ClassValue;
|
|
11
11
|
help?: import("tailwind-variants").ClassValue;
|
|
12
12
|
};
|
|
@@ -18,8 +18,8 @@ export declare const formFieldTheme: import("tailwind-variants").TVReturnType<{
|
|
|
18
18
|
description?: import("tailwind-variants").ClassValue;
|
|
19
19
|
label?: import("tailwind-variants").ClassValue;
|
|
20
20
|
header?: import("tailwind-variants").ClassValue;
|
|
21
|
-
error?: import("tailwind-variants").ClassValue;
|
|
22
21
|
hint?: import("tailwind-variants").ClassValue;
|
|
22
|
+
error?: import("tailwind-variants").ClassValue;
|
|
23
23
|
control?: import("tailwind-variants").ClassValue;
|
|
24
24
|
help?: import("tailwind-variants").ClassValue;
|
|
25
25
|
};
|
|
@@ -40,8 +40,8 @@ export declare const formFieldTheme: import("tailwind-variants").TVReturnType<{
|
|
|
40
40
|
description?: import("tailwind-variants").ClassValue;
|
|
41
41
|
label?: import("tailwind-variants").ClassValue;
|
|
42
42
|
header?: import("tailwind-variants").ClassValue;
|
|
43
|
-
error?: import("tailwind-variants").ClassValue;
|
|
44
43
|
hint?: import("tailwind-variants").ClassValue;
|
|
44
|
+
error?: import("tailwind-variants").ClassValue;
|
|
45
45
|
control?: import("tailwind-variants").ClassValue;
|
|
46
46
|
help?: import("tailwind-variants").ClassValue;
|
|
47
47
|
};
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ export declare const passwordInputTheme: import("tailwind-variants").TVReturnTyp
|
|
|
21
21
|
};
|
|
22
22
|
}, {
|
|
23
23
|
root: string;
|
|
24
|
+
/**
|
|
25
|
+
* Edge draws its own reveal eye on `input[type=password]`, and its own
|
|
26
|
+
* clear cross once the field is revealed to `type=text`. Both would sit
|
|
27
|
+
* beside ours, so the field shows two of each in that browser only.
|
|
28
|
+
*/
|
|
29
|
+
input: string;
|
|
24
30
|
toggle: string;
|
|
25
31
|
meter: string;
|
|
26
32
|
track: string;
|
|
@@ -45,6 +51,12 @@ export declare const passwordInputTheme: import("tailwind-variants").TVReturnTyp
|
|
|
45
51
|
};
|
|
46
52
|
}, {
|
|
47
53
|
root: string;
|
|
54
|
+
/**
|
|
55
|
+
* Edge draws its own reveal eye on `input[type=password]`, and its own
|
|
56
|
+
* clear cross once the field is revealed to `type=text`. Both would sit
|
|
57
|
+
* beside ours, so the field shows two of each in that browser only.
|
|
58
|
+
*/
|
|
59
|
+
input: string;
|
|
48
60
|
toggle: string;
|
|
49
61
|
meter: string;
|
|
50
62
|
track: string;
|
|
@@ -69,6 +81,12 @@ export declare const passwordInputTheme: import("tailwind-variants").TVReturnTyp
|
|
|
69
81
|
};
|
|
70
82
|
}, {
|
|
71
83
|
root: string;
|
|
84
|
+
/**
|
|
85
|
+
* Edge draws its own reveal eye on `input[type=password]`, and its own
|
|
86
|
+
* clear cross once the field is revealed to `type=text`. Both would sit
|
|
87
|
+
* beside ours, so the field shows two of each in that browser only.
|
|
88
|
+
*/
|
|
89
|
+
input: string;
|
|
72
90
|
toggle: string;
|
|
73
91
|
meter: string;
|
|
74
92
|
track: string;
|