@fiscozen/checkbox 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,240 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- modelValue: {
3
- required: true;
4
- type: import('vue').PropType<(string | number | boolean)[]>;
5
- };
6
- label: {
7
- type: import('vue').PropType<string>;
8
- required: true;
9
- };
10
- title: {
11
- type: import('vue').PropType<string>;
12
- required: true;
13
- };
14
- value: {
15
- type: import('vue').PropType<string | number>;
16
- };
17
- error: {
18
- type: import('vue').PropType<boolean>;
19
- };
20
- size: {
21
- type: import('vue').PropType<"sm" | "md">;
22
- };
23
- disabled: {
24
- type: import('vue').PropType<boolean>;
25
- };
26
- name: {
27
- type: import('vue').PropType<string>;
28
- };
29
- variant: {
30
- type: import('vue').PropType<"horizontal">;
31
- default: string;
32
- };
33
- required: {
34
- type: import('vue').PropType<boolean>;
35
- };
36
- tooltip: {
37
- type: import('vue').PropType<string>;
38
- };
39
- emphasis: {
40
- type: import('vue').PropType<boolean>;
41
- };
42
- subtitle: {
43
- type: import('vue').PropType<string>;
44
- };
45
- imageAlt: {
46
- type: import('vue').PropType<string>;
47
- };
48
- tooltipStatus: {
49
- type: import('vue').PropType<import('@fiscozen/tooltip').FzTooltipStatus>;
50
- };
51
- hasCheckbox: {
52
- type: import('vue').PropType<boolean>;
53
- default: boolean;
54
- };
55
- imageUrl: {
56
- type: import('vue').PropType<string>;
57
- };
58
- } | {
59
- modelValue: {
60
- required: true;
61
- type: import('vue').PropType<(string | number | boolean)[]>;
62
- };
63
- label: {
64
- type: import('vue').PropType<string>;
65
- required: true;
66
- };
67
- title: {
68
- type: import('vue').PropType<string>;
69
- required: true;
70
- };
71
- value: {
72
- type: import('vue').PropType<string | number>;
73
- };
74
- error: {
75
- type: import('vue').PropType<boolean>;
76
- };
77
- size: {
78
- type: import('vue').PropType<"sm" | "md">;
79
- };
80
- disabled: {
81
- type: import('vue').PropType<boolean>;
82
- };
83
- name: {
84
- type: import('vue').PropType<string>;
85
- };
86
- variant: {
87
- type: import('vue').PropType<"vertical">;
88
- required: true;
89
- default: string;
90
- };
91
- required: {
92
- type: import('vue').PropType<boolean>;
93
- };
94
- tooltip: {
95
- type: import('vue').PropType<string>;
96
- };
97
- emphasis: {
98
- type: import('vue').PropType<boolean>;
99
- };
100
- subtitle: {
101
- type: import('vue').PropType<string>;
102
- };
103
- imageAlt: {
104
- type: import('vue').PropType<string>;
105
- };
106
- tooltipStatus: {
107
- type: import('vue').PropType<import('@fiscozen/tooltip').FzTooltipStatus>;
108
- };
109
- hasCheckbox: {
110
- type: import('vue').PropType<boolean>;
111
- default: boolean;
112
- };
113
- imageUrl: {
114
- type: import('vue').PropType<string>;
115
- required: true;
116
- };
117
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
118
- modelValue: {
119
- required: true;
120
- type: import('vue').PropType<(string | number | boolean)[]>;
121
- };
122
- label: {
123
- type: import('vue').PropType<string>;
124
- required: true;
125
- };
126
- title: {
127
- type: import('vue').PropType<string>;
128
- required: true;
129
- };
130
- value: {
131
- type: import('vue').PropType<string | number>;
132
- };
133
- error: {
134
- type: import('vue').PropType<boolean>;
135
- };
136
- size: {
137
- type: import('vue').PropType<"sm" | "md">;
138
- };
139
- disabled: {
140
- type: import('vue').PropType<boolean>;
141
- };
142
- name: {
143
- type: import('vue').PropType<string>;
144
- };
145
- variant: {
146
- type: import('vue').PropType<"horizontal">;
147
- default: string;
148
- };
149
- required: {
150
- type: import('vue').PropType<boolean>;
151
- };
152
- tooltip: {
153
- type: import('vue').PropType<string>;
154
- };
155
- emphasis: {
156
- type: import('vue').PropType<boolean>;
157
- };
158
- subtitle: {
159
- type: import('vue').PropType<string>;
160
- };
161
- imageAlt: {
162
- type: import('vue').PropType<string>;
163
- };
164
- tooltipStatus: {
165
- type: import('vue').PropType<import('@fiscozen/tooltip').FzTooltipStatus>;
166
- };
167
- hasCheckbox: {
168
- type: import('vue').PropType<boolean>;
169
- default: boolean;
170
- };
171
- imageUrl: {
172
- type: import('vue').PropType<string>;
173
- };
174
- } | {
175
- modelValue: {
176
- required: true;
177
- type: import('vue').PropType<(string | number | boolean)[]>;
178
- };
179
- label: {
180
- type: import('vue').PropType<string>;
181
- required: true;
182
- };
183
- title: {
184
- type: import('vue').PropType<string>;
185
- required: true;
186
- };
187
- value: {
188
- type: import('vue').PropType<string | number>;
189
- };
190
- error: {
191
- type: import('vue').PropType<boolean>;
192
- };
193
- size: {
194
- type: import('vue').PropType<"sm" | "md">;
195
- };
196
- disabled: {
197
- type: import('vue').PropType<boolean>;
198
- };
199
- name: {
200
- type: import('vue').PropType<string>;
201
- };
202
- variant: {
203
- type: import('vue').PropType<"vertical">;
204
- required: true;
205
- default: string;
206
- };
207
- required: {
208
- type: import('vue').PropType<boolean>;
209
- };
210
- tooltip: {
211
- type: import('vue').PropType<string>;
212
- };
213
- emphasis: {
214
- type: import('vue').PropType<boolean>;
215
- };
216
- subtitle: {
217
- type: import('vue').PropType<string>;
218
- };
219
- imageAlt: {
220
- type: import('vue').PropType<string>;
221
- };
222
- tooltipStatus: {
223
- type: import('vue').PropType<import('@fiscozen/tooltip').FzTooltipStatus>;
224
- };
225
- hasCheckbox: {
226
- type: import('vue').PropType<boolean>;
227
- default: boolean;
228
- };
229
- imageUrl: {
230
- type: import('vue').PropType<string>;
231
- required: true;
232
- };
233
- }>> & Readonly<{}>, {
234
- variant: "horizontal";
235
- hasCheckbox: boolean;
236
- } | {
237
- variant: "vertical";
238
- hasCheckbox: boolean;
239
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import('vue').DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import('vue').PublicProps>;
240
2
  export default _default;
@@ -1,75 +1,32 @@
1
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- modelValue: {
3
- required: true;
4
- type: import('vue').PropType<(string | number | boolean)[]>;
5
- };
6
- label: {
7
- type: import('vue').PropType<string>;
8
- required: true;
9
- };
10
- size: {
11
- type: import('vue').PropType<"sm" | "md">;
12
- };
13
- options: {
14
- type: import('vue').PropType<import('./types').ParentCheckbox[]>;
15
- };
16
- emphasis: {
17
- type: import('vue').PropType<boolean>;
18
- };
19
- disabled: {
20
- type: import('vue').PropType<boolean>;
21
- };
22
- error: {
23
- type: import('vue').PropType<boolean>;
24
- };
25
- required: {
26
- type: import('vue').PropType<boolean>;
27
- };
28
- horizontal: {
29
- type: import('vue').PropType<boolean>;
30
- };
31
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
32
- modelValue: {
33
- required: true;
34
- type: import('vue').PropType<(string | number | boolean)[]>;
35
- };
36
- label: {
37
- type: import('vue').PropType<string>;
38
- required: true;
39
- };
40
- size: {
41
- type: import('vue').PropType<"sm" | "md">;
42
- };
43
- options: {
44
- type: import('vue').PropType<import('./types').ParentCheckbox[]>;
45
- };
46
- emphasis: {
47
- type: import('vue').PropType<boolean>;
48
- };
49
- disabled: {
50
- type: import('vue').PropType<boolean>;
51
- };
52
- error: {
53
- type: import('vue').PropType<boolean>;
54
- };
55
- required: {
56
- type: import('vue').PropType<boolean>;
57
- };
58
- horizontal: {
59
- type: import('vue').PropType<boolean>;
60
- };
61
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
62
- help?(_: {}): any;
63
- default?(_: {
64
- checkboxGroupProps: {
65
- disabled: boolean;
66
- error: boolean;
67
- emphasis: boolean;
68
- required: boolean;
69
- };
70
- }): any;
71
- error?(_: {}): any;
72
- }>;
1
+ import { FzCheckboxGroupProps } from './types';
2
+ type __VLS_Props = FzCheckboxGroupProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue: (string | number | boolean)[];
5
+ } & __VLS_Props;
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ help?(_: {}): any;
10
+ default?(_: {
11
+ checkboxGroupProps: {
12
+ disabled: boolean;
13
+ error: boolean;
14
+ emphasis: boolean;
15
+ required: boolean;
16
+ };
17
+ }): any;
18
+ error?(_: {}): any;
19
+ };
20
+ refs: {};
21
+ rootEl: any;
22
+ };
23
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
25
+ "update:modelValue": (value: (string | number | boolean)[]) => any;
26
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
27
+ "onUpdate:modelValue"?: ((value: (string | number | boolean)[]) => any) | undefined;
28
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
73
30
  export default _default;
74
31
  type __VLS_WithTemplateSlots<T, S> = T & {
75
32
  new (): {
@@ -1,5 +1,4 @@
1
1
  import { ComputedRef, InjectionKey, Ref } from 'vue';
2
-
3
2
  /**
4
3
  * Maps checkbox size variants to corresponding Tailwind CSS text size classes.
5
4
  *
@@ -30,5 +29,11 @@ export interface CheckedSetProvision {
30
29
  * Provided by FzCheckboxGroup so child cards/checkboxes can do O(1) membership
31
30
  * checks instead of O(N) Array.includes scans — but only when the group's
32
31
  * model and the child's model reference the same array.
32
+ *
33
+ * Uses a namespaced primitive string rather than `Symbol(...)` so the key
34
+ * stays value-equal across module instances. This matters in Vite dev mode
35
+ * when consuming apps exclude `@fiscozen/*` packages from optimizeDeps and
36
+ * the same `.ts` file may be loaded as multiple module instances. The cast
37
+ * preserves the typed `InjectionKey<T>` API at provide/inject call sites.
33
38
  */
34
39
  export declare const CHECKED_SET_KEY: InjectionKey<CheckedSetProvision>;
@@ -1,4 +1,4 @@
1
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
1
+ type __VLS_Props = {
2
2
  /**
3
3
  * Unique ID for the error alert element.
4
4
  * Used for aria-describedby relationships.
@@ -6,27 +6,19 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
6
6
  * @example "checkbox-123-error"
7
7
  */
8
8
  id: string;
9
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
- /**
11
- * Unique ID for the error alert element.
12
- * Used for aria-describedby relationships.
13
- *
14
- * @example "checkbox-123-error"
15
- */
16
- id: string;
17
- }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
18
- default?(_: {}): any;
19
- }>;
20
- export default _default;
21
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
22
- type __VLS_TypePropsToRuntimeProps<T> = {
23
- [K in keyof T]-?: {} extends Pick<T, K> ? {
24
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
25
- } : {
26
- type: import('vue').PropType<T[K]>;
27
- required: true;
9
+ };
10
+ declare function __VLS_template(): {
11
+ attrs: Partial<{}>;
12
+ slots: {
13
+ default?(_: {}): any;
28
14
  };
15
+ refs: {};
16
+ rootEl: any;
29
17
  };
18
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
+ export default _default;
30
22
  type __VLS_WithTemplateSlots<T, S> = T & {
31
23
  new (): {
32
24
  $slots: S;
@@ -1,86 +1,11 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- modelValue: {
3
- required: true;
4
- type: import('vue').PropType<(string | number | boolean)[]>;
5
- };
6
- label: {
7
- type: import('vue').PropType<string>;
8
- required: true;
9
- };
10
- value: {
11
- type: import('vue').PropType<string | number | boolean>;
12
- };
13
- error: {
14
- type: import('vue').PropType<boolean>;
15
- };
16
- disabled: {
17
- type: import('vue').PropType<boolean>;
18
- };
19
- required: {
20
- type: import('vue').PropType<boolean>;
21
- };
22
- tooltip: {
23
- type: import('vue').PropType<import('@fiscozen/tooltip').FzTooltipProps>;
24
- };
25
- indeterminate: {
26
- type: import('vue').PropType<boolean>;
27
- };
28
- emphasis: {
29
- type: import('vue').PropType<boolean>;
30
- };
31
- standalone: {
32
- type: import('vue').PropType<boolean>;
33
- };
34
- ariaOwns: {
35
- type: import('vue').PropType<string>;
36
- };
37
- checkboxId: {
38
- type: import('vue').PropType<string>;
39
- };
40
- children: {
41
- type: import('vue').PropType<import('../types').ChildCheckbox[]>;
42
- };
43
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
44
- modelValue: {
45
- required: true;
46
- type: import('vue').PropType<(string | number | boolean)[]>;
47
- };
48
- label: {
49
- type: import('vue').PropType<string>;
50
- required: true;
51
- };
52
- value: {
53
- type: import('vue').PropType<string | number | boolean>;
54
- };
55
- error: {
56
- type: import('vue').PropType<boolean>;
57
- };
58
- disabled: {
59
- type: import('vue').PropType<boolean>;
60
- };
61
- required: {
62
- type: import('vue').PropType<boolean>;
63
- };
64
- tooltip: {
65
- type: import('vue').PropType<import('@fiscozen/tooltip').FzTooltipProps>;
66
- };
67
- indeterminate: {
68
- type: import('vue').PropType<boolean>;
69
- };
70
- emphasis: {
71
- type: import('vue').PropType<boolean>;
72
- };
73
- standalone: {
74
- type: import('vue').PropType<boolean>;
75
- };
76
- ariaOwns: {
77
- type: import('vue').PropType<string>;
78
- };
79
- checkboxId: {
80
- type: import('vue').PropType<string>;
81
- };
82
- children: {
83
- type: import('vue').PropType<import('../types').ChildCheckbox[]>;
84
- };
85
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ import { ParentCheckbox } from '../types';
2
+ type __VLS_Props = ParentCheckbox;
3
+ type __VLS_PublicProps = {
4
+ modelValue: (string | number | boolean)[];
5
+ } & __VLS_Props;
6
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update:modelValue": (value: (string | number | boolean)[]) => any;
8
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
9
+ "onUpdate:modelValue"?: ((value: (string | number | boolean)[]) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
86
11
  export default _default;
@@ -1,5 +1,4 @@
1
1
  import { FzTooltipProps, FzTooltipStatus } from '@fiscozen/tooltip';
2
-
3
2
  /**
4
3
  * Props for the FzCheckbox component.
5
4
  *
package/package.json CHANGED
@@ -1,38 +1,38 @@
1
1
  {
2
2
  "name": "@fiscozen/checkbox",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Design System Checkbox and Checkbox Group component",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
7
7
  "keywords": [],
8
8
  "author": "Cristian Barraco",
9
9
  "dependencies": {
10
- "@fiscozen/composables": "1.0.3",
11
- "@fiscozen/alert": "3.0.0",
10
+ "@fiscozen/alert": "3.0.1",
12
11
  "@fiscozen/badge": "3.0.0",
13
- "@fiscozen/tooltip": "3.0.1"
12
+ "@fiscozen/composables": "1.0.3",
13
+ "@fiscozen/tooltip": "3.0.2"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "tailwindcss": "^3.4.1",
17
17
  "vue": "^3.4.13",
18
- "@fiscozen/icons": "^1.0.0"
18
+ "@fiscozen/icons": "^1.0.4"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rushstack/eslint-patch": "^1.3.3",
22
22
  "@types/jsdom": "^21.1.6",
23
23
  "@types/node": "^18.19.3",
24
- "@vitejs/plugin-vue": "^4.5.2",
25
- "@vitest/coverage-v8": "^1.2.1",
24
+ "@vitejs/plugin-vue": "^6.0.5",
25
+ "@vitest/coverage-v8": "^4.1.1",
26
26
  "@vue/test-utils": "^2.4.3",
27
27
  "@vue/tsconfig": "^0.5.0",
28
28
  "eslint": "^8.49.0",
29
29
  "jsdom": "^23.0.1",
30
30
  "prettier": "^3.0.3",
31
- "typescript": "~5.3.0",
32
- "vite": "^5.0.10",
33
- "vite-plugin-dts": "^3.8.3",
34
- "vitest": "^1.2.0",
35
- "vue-tsc": "^1.8.25",
31
+ "typescript": "~5.7.0",
32
+ "vite": "^8.0.0",
33
+ "vite-plugin-dts": "^4.5.0",
34
+ "vitest": "^4.1.1",
35
+ "vue-tsc": "^2.2.12",
36
36
  "@fiscozen/eslint-config": "^0.1.0",
37
37
  "@fiscozen/prettier-config": "^0.1.0",
38
38
  "@fiscozen/tsconfig": "^0.1.0"
@@ -69,7 +69,7 @@ const computedIconColor = computed<string>(() => {
69
69
 
70
70
  const showImage = computed(() => props.variant === "vertical" || !!props.imageUrl);
71
71
 
72
- const staticInputClass: string = "w-0 h-0 peer fz-hidden-input";
72
+ const staticInputClass: string = "peer h-0 w-0 absolute fz-hidden-input";
73
73
 
74
74
  const labelClass = computed(() => ({
75
75
  "flex-col": props.variant === "vertical",
@@ -91,7 +91,7 @@ const staticLabeldClass: string = "flex flex-col";
91
91
  const staticContainerClass: string = "flex flex-col gap-10";
92
92
 
93
93
  /** Base layout for the checkboxes container */
94
- const staticSlotContainerClass: string = "flex items-start";
94
+ const staticSlotContainerClass: string = "flex self-stretch";
95
95
 
96
96
  /** Dynamic label classes based on spacing and disabled state */
97
97
  const computedLabelClass = computed<string[]>(() => [
@@ -19,13 +19,11 @@ const createWrapper = (
19
19
 
20
20
  describe("FzCheckboxCard", () => {
21
21
  beforeEach(() => {
22
- const mockIntersectionObserver = vi.fn();
23
- mockIntersectionObserver.mockReturnValue({
24
- observe: () => null,
25
- unobserve: () => null,
26
- disconnect: () => null,
22
+ window.IntersectionObserver = vi.fn().mockImplementation(function (this: any) {
23
+ this.observe = vi.fn();
24
+ this.unobserve = vi.fn();
25
+ this.disconnect = vi.fn();
27
26
  });
28
- window.IntersectionObserver = mockIntersectionObserver;
29
27
 
30
28
  window.matchMedia = vi.fn().mockImplementation((query: string) => ({
31
29
  matches: false,
@@ -524,7 +524,7 @@ describe("FzCheckboxGroup", () => {
524
524
  await wrapper.vm.$nextTick();
525
525
  const container = wrapper.find("[role='group']");
526
526
  expect(container.classes()).toContain("flex");
527
- expect(container.classes()).toContain("items-start");
527
+ expect(container.classes()).toContain("self-stretch");
528
528
  });
529
529
 
530
530
  it("should apply horizontal layout classes when horizontal is true", async () => {