toku-ui 4.0.0 → 4.2.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.
@@ -14,6 +14,7 @@ export declare const TDialog: import("vue").DefineComponent<import("vue").Extrac
14
14
  cancellable: PropType<TDialogProps["cancellable"]>;
15
15
  cancelText: PropType<TDialogProps["cancelText"]>;
16
16
  confirmText: PropType<TDialogProps["confirmText"]>;
17
+ size: PropType<TDialogProps["size"]>;
17
18
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
18
19
  [key: string]: any;
19
20
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "close" | "confirm")[], "cancel" | "close" | "confirm", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -30,6 +31,7 @@ export declare const TDialog: import("vue").DefineComponent<import("vue").Extrac
30
31
  cancellable: PropType<TDialogProps["cancellable"]>;
31
32
  cancelText: PropType<TDialogProps["cancelText"]>;
32
33
  confirmText: PropType<TDialogProps["confirmText"]>;
34
+ size: PropType<TDialogProps["size"]>;
33
35
  }>> & Readonly<{
34
36
  onCancel?: ((...args: any[]) => any) | undefined;
35
37
  onClose?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"TDialog.d.ts","sourceRoot":"","sources":["../../../src/components/TDialog/TDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAepD,eAAO,MAAM,OAAO;;cAUE,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;;;;cAI/B,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;;;WAGlC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;UAChC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;iB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,MAAM,CAAC,CAAC;;;;;cAZ5B,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;;;;cAI/B,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;;;WAGlC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;UAChC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;iBACtB,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;gBACvC,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;iBACnC,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;UAC5C,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oEAwEhD,CAAC"}
@@ -6,5 +6,6 @@ export interface TDialogProps {
6
6
  cancellable?: boolean;
7
7
  cancelText?: string;
8
8
  confirmText?: string;
9
+ size?: 'small' | 'medium' | 'large' | 'extra-large';
9
10
  }
10
11
  //# sourceMappingURL=TDialog.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/TDialog/TDialog.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EACF,SAAS,GACT,OAAO,GACP,SAAS,GACT,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"TDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/TDialog/TDialog.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EACF,SAAS,GACT,OAAO,GACP,SAAS,GACT,SAAS,GACT,YAAY,GACZ,iBAAiB,GACjB,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;CACrD"}
@@ -0,0 +1,13 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import TFileUpload from './TFileUpload.vue';
3
+ declare const meta: Meta<typeof TFileUpload>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof TFileUpload>;
6
+ export declare const playground: Story;
7
+ export declare const empty: Story;
8
+ export declare const hover: Story;
9
+ export declare const focus: Story;
10
+ export declare const loading: Story;
11
+ export declare const loaded: Story;
12
+ export declare const primaryFlow: Story;
13
+ //# sourceMappingURL=TFileUpload.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFileUpload.stories.d.ts","sourceRoot":"","sources":["../../../src/components/TFileUpload/TFileUpload.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAE5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAaC,CAAC;AAErC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAE,KAaxB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAUnB,CAAC;AASF,eAAO,MAAM,KAAK,EAAE,KAUnB,CAAC;AAYF,eAAO,MAAM,KAAK,EAAE,KAUnB,CAAC;AAaF,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AASF,eAAO,MAAM,MAAM,EAAE,KAapB,CAAC;AAUF,eAAO,MAAM,WAAW,EAAE,KA6BzB,CAAC"}
@@ -0,0 +1,155 @@
1
+ import type { AsTag } from 'reka-ui';
2
+ /**
3
+ * Reason emitted with the `'error'` event when an uploaded file fails internal
4
+ * validation against the `accept` extension list or `maxSizeBytes` size cap.
5
+ *
6
+ * - `'bad-format'`: the file's extension is not in the `accept` list.
7
+ * - `'too-large'`: the file's size exceeds `maxSizeBytes`.
8
+ */
9
+ export type TFileUploadErrorReason = 'bad-format' | 'too-large';
10
+ /**
11
+ * Props for the `TFileUpload` component.
12
+ *
13
+ * `TFileUpload` is a single-file upload control with three visual states
14
+ * (empty / loading / loaded) and built-in validation against an allow-list of
15
+ * extensions and an optional maximum size in bytes. The selected `File` (or
16
+ * `null`) is exposed via `v-model`; validation failures emit `'error'`
17
+ * **instead of** updating the model.
18
+ *
19
+ * All user-facing strings are passed in as props so the consumer owns i18n;
20
+ * the component does not import a translation function.
21
+ */
22
+ export interface TFileUploadProps {
23
+ /**
24
+ * Label shown above the upload box (e.g. `"Adjuntar archivo"`).
25
+ * When omitted, the label slot/element is not rendered.
26
+ */
27
+ label?: string;
28
+ /**
29
+ * Call-to-action text rendered inside the box while no file is attached
30
+ * (e.g. `"Subir archivo"`).
31
+ * @defaultValue 'Subir archivo'
32
+ */
33
+ ctaText?: string;
34
+ /**
35
+ * Text rendered inside the box while `loading` is `true`
36
+ * (e.g. `"Cargando archivo"`).
37
+ * @defaultValue 'Cargando archivo'
38
+ */
39
+ loadingText?: string;
40
+ /**
41
+ * Accessible label for the remove button shown in the loaded state.
42
+ * @defaultValue 'Quitar archivo'
43
+ */
44
+ removeLabel?: string;
45
+ /**
46
+ * Hint displayed beneath the box (bottom-left) listing accepted formats.
47
+ * Hidden in the loaded state.
48
+ */
49
+ formatsHint?: string;
50
+ /**
51
+ * Hint displayed beneath the box (bottom-right) describing the size limit.
52
+ * Hidden in the loaded state.
53
+ */
54
+ maxSizeHint?: string;
55
+ /**
56
+ * Accepted file extensions without the leading dot (e.g. `['csv', 'pdf']`).
57
+ * Used to build the native `accept` attribute and to validate the selected
58
+ * file. When omitted, no extension validation runs.
59
+ */
60
+ accept?: string[];
61
+ /**
62
+ * Maximum file size in bytes. Files larger than this emit
63
+ * `'error'` with reason `'too-large'` and the model is not updated.
64
+ * When omitted, no size validation runs.
65
+ */
66
+ maxSizeBytes?: number;
67
+ /**
68
+ * Controlled loading flag. When `true` the box renders the loading visual
69
+ * and the underlying `<input type="file">` is disabled so the user cannot
70
+ * pick another file mid-upload.
71
+ * @defaultValue false
72
+ */
73
+ loading?: boolean;
74
+ /**
75
+ * Optional id forwarded to the underlying `<input type="file">`. When
76
+ * omitted a stable auto-generated id is used.
77
+ */
78
+ id?: string;
79
+ /**
80
+ * Form field name forwarded to the underlying `<input type="file">`.
81
+ * Required for native form submission (the file is sent under this key).
82
+ */
83
+ name?: string;
84
+ /**
85
+ * Marks the input as required for native HTML5 form validation.
86
+ * @defaultValue false
87
+ */
88
+ required?: boolean;
89
+ /**
90
+ * Disables the picker. The native `<input>` is disabled and the box
91
+ * renders in a non-interactive visual state.
92
+ * @defaultValue false
93
+ */
94
+ disabled?: boolean;
95
+ /**
96
+ * `id` of the `<form>` this input belongs to. Use when the component
97
+ * lives outside the target form in the DOM.
98
+ */
99
+ form?: string;
100
+ /**
101
+ * Element the outer wrapper renders as. Useful for semantic nesting
102
+ * (e.g. `'li'` inside a `<ul>`).
103
+ * @defaultValue 'div'
104
+ */
105
+ as?: AsTag;
106
+ }
107
+ /**
108
+ * Events emitted by `TFileUpload`.
109
+ */
110
+ export interface TFileUploadEmits {
111
+ /**
112
+ * Fired when the selected file fails internal validation. The model is
113
+ * **not** updated in this case — consumers can surface the reason as they
114
+ * wish.
115
+ */
116
+ error: [reason: TFileUploadErrorReason];
117
+ }
118
+ /**
119
+ * Slots exposed by `TFileUpload`. Each slot defaults to rendering its
120
+ * matching text prop, so most consumers will not need them; provide a slot
121
+ * only when richer content (icons, formatting) is required.
122
+ */
123
+ export interface TFileUploadSlots {
124
+ /** Overrides the `label` prop. */
125
+ label: () => unknown;
126
+ /** Overrides the `ctaText` prop in the empty state. */
127
+ cta: () => unknown;
128
+ /** Overrides the `loadingText` prop in the loading state. */
129
+ loading: () => unknown;
130
+ /** Overrides the filename rendering in the loaded state. */
131
+ file: (props: {
132
+ file: File;
133
+ }) => unknown;
134
+ }
135
+ declare const _default: typeof __VLS_export;
136
+ export default _default;
137
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<TFileUploadProps & {
138
+ modelValue?: File | null;
139
+ }, {
140
+ inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
141
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
142
+ error: (reason: TFileUploadErrorReason) => any;
143
+ "update:modelValue": (value: File | null) => any;
144
+ }, string, import("vue").PublicProps, Readonly<TFileUploadProps & {
145
+ modelValue?: File | null;
146
+ }> & Readonly<{
147
+ onError?: ((reason: TFileUploadErrorReason) => any) | undefined;
148
+ "onUpdate:modelValue"?: ((value: File | null) => any) | undefined;
149
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, TFileUploadSlots>;
150
+ type __VLS_WithSlots<T, S> = T & {
151
+ new (): {
152
+ $slots: S;
153
+ };
154
+ };
155
+ //# sourceMappingURL=TFileUpload.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TFileUpload.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TFileUpload/TFileUpload.vue"],"names":[],"mappings":"AAieA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG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O,CAAC;CAC1C;wBACoB,OAAO,YAAY;AAAxC,wBAAyC;AACzC,QAAA,MAAM,YAAY;iBA4HL,IAAI,GAAG,IAAI;;;;;;;iBAAX,IAAI,GAAG,IAAI;;;;qGA4TpB,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as TFileUpload } from './TFileUpload.vue';
2
+ export type { TFileUploadEmits, TFileUploadErrorReason, TFileUploadProps, TFileUploadSlots, } from './TFileUpload.vue';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TFileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}
@@ -5,6 +5,7 @@ export * from './TCheckbox';
5
5
  export * from './TCombobox';
6
6
  export * from './TDialog';
7
7
  export * from './TDropdown';
8
+ export * from './TFileUpload';
8
9
  export * from './TIcon';
9
10
  export * from './TIconButton';
10
11
  export * from './TLink';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAA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