@frontile/forms 0.17.0-alpha.9 → 0.17.0-beta.10
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/addon-main.js +0 -33
- package/declarations/components/checkbox-group.d.ts +41 -0
- package/declarations/components/checkbox-group.d.ts.map +1 -0
- package/declarations/components/checkbox.d.ts +39 -0
- package/declarations/components/checkbox.d.ts.map +1 -0
- package/declarations/components/form-control.d.ts +47 -0
- package/declarations/components/form-control.d.ts.map +1 -0
- package/declarations/components/form-description.d.ts +19 -0
- package/declarations/components/form-description.d.ts.map +1 -0
- package/declarations/components/form-feedback.d.ts +23 -0
- package/declarations/components/form-feedback.d.ts.map +1 -0
- package/declarations/components/form.d.ts +19 -0
- package/declarations/components/form.d.ts.map +1 -0
- package/declarations/components/icons.d.ts +8 -0
- package/declarations/components/icons.d.ts.map +1 -0
- package/declarations/components/input.d.ts +140 -0
- package/declarations/components/input.d.ts.map +1 -0
- package/declarations/components/label.d.ts +41 -0
- package/declarations/components/label.d.ts.map +1 -0
- package/declarations/components/native-select.d.ts +96 -21
- package/declarations/components/native-select.d.ts.map +1 -1
- package/declarations/components/radio-group.d.ts +44 -0
- package/declarations/components/radio-group.d.ts.map +1 -0
- package/declarations/components/radio.d.ts +40 -0
- package/declarations/components/radio.d.ts.map +1 -0
- package/declarations/components/select.d.ts +240 -16
- package/declarations/components/select.d.ts.map +1 -1
- package/declarations/components/switch.d.ts +148 -0
- package/declarations/components/switch.d.ts.map +1 -0
- package/declarations/components/textarea.d.ts +68 -0
- package/declarations/components/textarea.d.ts.map +1 -0
- package/declarations/index.d.ts +13 -2
- package/declarations/index.d.ts.map +1 -1
- package/declarations/template-registry.d.ts +13 -30
- package/declarations/template-registry.d.ts.map +1 -1
- package/declarations/test-support.d.ts +3 -0
- package/declarations/test-support.d.ts.map +1 -0
- package/declarations/utils/index.d.ts +3 -0
- package/declarations/utils/index.d.ts.map +1 -0
- package/dist/_app_/components/checkbox-group.js +1 -0
- package/dist/_app_/components/checkbox.js +1 -0
- package/dist/_app_/components/form-control.js +1 -0
- package/dist/_app_/components/form-description.js +1 -0
- package/dist/_app_/components/form-feedback.js +1 -0
- package/dist/_app_/components/form.js +1 -0
- package/dist/_app_/components/icons.js +1 -0
- package/dist/_app_/components/input.js +1 -0
- package/dist/_app_/components/label.js +1 -0
- package/dist/_app_/components/radio-group.js +1 -0
- package/dist/_app_/components/radio.js +1 -0
- package/dist/_app_/components/switch.js +1 -0
- package/dist/_app_/components/textarea.js +1 -0
- package/dist/components/checkbox-group.js +29 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.js +44 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/form-control.js +61 -0
- package/dist/components/form-control.js.map +1 -0
- package/dist/components/form-description.js +24 -0
- package/dist/components/form-description.js.map +1 -0
- package/dist/components/form-feedback.js +36 -0
- package/dist/components/form-feedback.js.map +1 -0
- package/dist/components/form.js +43 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/icons.js +13 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/input.js +100 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.js +23 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/native-select.js +60 -56
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/radio-group.js +29 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/radio.js +43 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/select.js +131 -78
- package/dist/components/select.js.map +1 -1
- package/dist/components/switch.js +60 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/textarea.js +47 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/index-CeaQc-U7.js +23 -0
- package/dist/index-CeaQc-U7.js.map +1 -0
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/runtime-BPCpkOf1-YDR_IEBR.js +67 -0
- package/dist/runtime-BPCpkOf1-YDR_IEBR.js.map +1 -0
- package/dist/test-support.js +1337 -0
- package/dist/test-support.js.map +1 -0
- package/package.json +69 -72
- package/declarations/components/form-checkbox-group.d.ts +0 -50
- package/declarations/components/form-checkbox-group.d.ts.map +0 -1
- package/declarations/components/form-checkbox.d.ts +0 -49
- package/declarations/components/form-checkbox.d.ts.map +0 -1
- package/declarations/components/form-field/checkbox.d.ts +0 -19
- package/declarations/components/form-field/checkbox.d.ts.map +0 -1
- package/declarations/components/form-field/feedback.d.ts +0 -21
- package/declarations/components/form-field/feedback.d.ts.map +0 -1
- package/declarations/components/form-field/hint.d.ts +0 -17
- package/declarations/components/form-field/hint.d.ts.map +0 -1
- package/declarations/components/form-field/input.d.ts +0 -21
- package/declarations/components/form-field/input.d.ts.map +0 -1
- package/declarations/components/form-field/label.d.ts +0 -17
- package/declarations/components/form-field/label.d.ts.map +0 -1
- package/declarations/components/form-field/radio.d.ts +0 -20
- package/declarations/components/form-field/radio.d.ts.map +0 -1
- package/declarations/components/form-field/select.d.ts +0 -38
- package/declarations/components/form-field/select.d.ts.map +0 -1
- package/declarations/components/form-field/textarea.d.ts +0 -19
- package/declarations/components/form-field/textarea.d.ts.map +0 -1
- package/declarations/components/form-field.d.ts +0 -38
- package/declarations/components/form-field.d.ts.map +0 -1
- package/declarations/components/form-input.d.ts +0 -64
- package/declarations/components/form-input.d.ts.map +0 -1
- package/declarations/components/form-radio-group.d.ts +0 -48
- package/declarations/components/form-radio-group.d.ts.map +0 -1
- package/declarations/components/form-radio.d.ts +0 -54
- package/declarations/components/form-radio.d.ts.map +0 -1
- package/declarations/components/form-select.d.ts +0 -51
- package/declarations/components/form-select.d.ts.map +0 -1
- package/declarations/components/form-textarea.d.ts +0 -17
- package/declarations/components/form-textarea.d.ts.map +0 -1
- package/dist/_app_/components/form-checkbox-group.js +0 -1
- package/dist/_app_/components/form-checkbox.js +0 -1
- package/dist/_app_/components/form-field/checkbox.js +0 -1
- package/dist/_app_/components/form-field/feedback.js +0 -1
- package/dist/_app_/components/form-field/hint.js +0 -1
- package/dist/_app_/components/form-field/input.js +0 -1
- package/dist/_app_/components/form-field/label.js +0 -1
- package/dist/_app_/components/form-field/radio.js +0 -1
- package/dist/_app_/components/form-field/textarea.js +0 -1
- package/dist/_app_/components/form-field.js +0 -1
- package/dist/_app_/components/form-input.js +0 -1
- package/dist/_app_/components/form-radio-group.js +0 -1
- package/dist/_app_/components/form-radio.js +0 -1
- package/dist/_app_/components/form-select.js +0 -1
- package/dist/_app_/components/form-textarea.js +0 -1
- package/dist/components/form-checkbox-group.js +0 -77
- package/dist/components/form-checkbox-group.js.map +0 -1
- package/dist/components/form-checkbox.js +0 -59
- package/dist/components/form-checkbox.js.map +0 -1
- package/dist/components/form-field/checkbox.js +0 -38
- package/dist/components/form-field/checkbox.js.map +0 -1
- package/dist/components/form-field/feedback.js +0 -36
- package/dist/components/form-field/feedback.js.map +0 -1
- package/dist/components/form-field/hint.js +0 -24
- package/dist/components/form-field/hint.js.map +0 -1
- package/dist/components/form-field/input.js +0 -44
- package/dist/components/form-field/input.js.map +0 -1
- package/dist/components/form-field/label.js +0 -24
- package/dist/components/form-field/label.js.map +0 -1
- package/dist/components/form-field/radio.js +0 -37
- package/dist/components/form-field/radio.js.map +0 -1
- package/dist/components/form-field/textarea.js +0 -38
- package/dist/components/form-field/textarea.js.map +0 -1
- package/dist/components/form-field.js +0 -44
- package/dist/components/form-field.js.map +0 -1
- package/dist/components/form-input.js +0 -89
- package/dist/components/form-input.js.map +0 -1
- package/dist/components/form-radio-group.js +0 -77
- package/dist/components/form-radio-group.js.map +0 -1
- package/dist/components/form-radio.js +0 -63
- package/dist/components/form-radio.js.map +0 -1
- package/dist/components/form-select.js +0 -124
- package/dist/components/form-select.js.map +0 -1
- package/dist/components/form-textarea.js +0 -48
- package/dist/components/form-textarea.js.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { Radio, type RadioSignature } from './radio';
|
|
3
|
+
import { type FormControlSharedArgs } from './form-control';
|
|
4
|
+
import { type RadioGroupSlots, type RadioVariants, type SlotsToClasses } from '@frontile/theme';
|
|
5
|
+
import type { WithBoundArgs } from '@glint/template';
|
|
6
|
+
interface Args<T> extends FormControlSharedArgs {
|
|
7
|
+
name?: string;
|
|
8
|
+
value?: T;
|
|
9
|
+
onChange?: RadioSignature<T>['Args']['onChange'];
|
|
10
|
+
size?: RadioVariants['size'];
|
|
11
|
+
classes?: SlotsToClasses<RadioGroupSlots>;
|
|
12
|
+
orientation?: 'horizontal' | 'vertical';
|
|
13
|
+
}
|
|
14
|
+
interface RadioGroupSignature<T> {
|
|
15
|
+
Args: Args<T>;
|
|
16
|
+
Blocks: {
|
|
17
|
+
default: [
|
|
18
|
+
Radio: WithBoundArgs<typeof Radio, 'name' | 'onChange' | 'checkedValue'>
|
|
19
|
+
];
|
|
20
|
+
};
|
|
21
|
+
Element: HTMLDivElement;
|
|
22
|
+
}
|
|
23
|
+
declare class RadioGroup<T extends string | number | boolean> extends Component<RadioGroupSignature<T>> {
|
|
24
|
+
get classes(): {
|
|
25
|
+
base: (slotProps?: ({
|
|
26
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
27
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
28
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
29
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
30
|
+
optionsContainer: (slotProps?: ({
|
|
31
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
32
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
33
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
34
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
35
|
+
label: (slotProps?: ({
|
|
36
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
37
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | ({
|
|
38
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
39
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
40
|
+
} & {} & {};
|
|
41
|
+
}
|
|
42
|
+
export { RadioGroup, type RadioGroupSignature };
|
|
43
|
+
export default RadioGroup;
|
|
44
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/components/radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAe,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,UAAU,IAAI,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAM1C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC;AAED,UAAU,mBAAmB,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,aAAa,CAAC,OAAO,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,cAAc,CAAC;SACzE,CAAC;KACH,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,CAAE,SAAQ,SAAS,CACrE,mBAAmB,CAAC,CAAC,CAAC,CACvB;IACC,IAAI,OAAO;;;;;;;;;;;;;;;;gBAKV;CA+BF;AAED,OAAO,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type FormControlSharedArgs } from './form-control';
|
|
3
|
+
import { type SlotsToClasses, type RadioVariants, type RadioSlots } from '@frontile/theme';
|
|
4
|
+
interface Args<T> extends FormControlSharedArgs {
|
|
5
|
+
value: T;
|
|
6
|
+
checkedValue?: T | undefined | null;
|
|
7
|
+
name?: string;
|
|
8
|
+
size?: RadioVariants['size'];
|
|
9
|
+
classes?: SlotsToClasses<RadioSlots>;
|
|
10
|
+
onChange?: (value: T, event: Event) => void;
|
|
11
|
+
}
|
|
12
|
+
interface RadioSignature<T> {
|
|
13
|
+
Args: Args<T>;
|
|
14
|
+
Element: HTMLInputElement;
|
|
15
|
+
}
|
|
16
|
+
declare class Radio<T extends string | boolean | number> extends Component<RadioSignature<T>> {
|
|
17
|
+
get isChecked(): boolean;
|
|
18
|
+
handleChange(event: Event): void;
|
|
19
|
+
get classes(): {
|
|
20
|
+
base: (slotProps?: ({
|
|
21
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
22
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
23
|
+
input: (slotProps?: ({
|
|
24
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
25
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
26
|
+
labelContainer: (slotProps?: ({
|
|
27
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
28
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
29
|
+
label: (slotProps?: ({
|
|
30
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
31
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
32
|
+
} & {
|
|
33
|
+
input: (slotProps?: ({
|
|
34
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
35
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
36
|
+
} & {};
|
|
37
|
+
}
|
|
38
|
+
export { Radio, type RadioSignature };
|
|
39
|
+
export default Radio;
|
|
40
|
+
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/components/radio.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAe,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,IAAI,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IAC7C,KAAK,EAAE,CAAC,CAAC;IACT,YAAY,CAAC,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAGrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC7C;AAED,UAAU,cAAc,CAAC,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,cAAM,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,OAAO,GAAG,MAAM,CAAE,SAAQ,SAAS,CAChE,cAAc,CAAC,CAAC,CAAC,CAClB;IACC,IAAI,SAAS,IAAI,OAAO,CAEvB;IAEO,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAQxC,IAAI,OAAO;;;;;;;;;;;;;;;;;WAKV;CA+DF;AAED,OAAO,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { type ListItem } from './native-select';
|
|
3
3
|
import { type ListboxSignature } from '@frontile/collections';
|
|
4
|
+
import { type SelectSlots, type SelectVariants, type SlotsToClasses } from '@frontile/theme';
|
|
4
5
|
import { type PopoverSignature, type ContentSignature } from '@frontile/overlays';
|
|
5
|
-
|
|
6
|
+
import { type FormControlSharedArgs } from './form-control';
|
|
7
|
+
interface SelectArgs<T> extends Pick<PopoverSignature['Args'], 'placement' | 'flipOptions' | 'middleware' | 'shiftOptions' | 'offsetOptions' | 'strategy' | 'didClose'>, Pick<ListboxSignature<T>['Args'], 'appearance' | 'intent' | 'selectedKeys' | 'disabledKeys' | 'allowEmpty' | 'onSelectionChange' | 'items' | 'onAction'>, Pick<ContentSignature['Args'], 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'transition'>, FormControlSharedArgs {
|
|
8
|
+
/**
|
|
9
|
+
* Determines the selection mode of the select component.
|
|
10
|
+
* - 'single': Only one item can be selected at a time.
|
|
11
|
+
* - 'multiple': Allows multiple selections.
|
|
12
|
+
* @defaultValue 'single'
|
|
13
|
+
*/
|
|
6
14
|
selectionMode?: 'single' | 'multiple';
|
|
15
|
+
/**
|
|
16
|
+
* The unique identifier for the select component.
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Defines the input size of the select.
|
|
21
|
+
*/
|
|
22
|
+
inputSize?: SelectVariants['size'];
|
|
23
|
+
/**
|
|
24
|
+
* Defines the size of the popover dropdown.
|
|
25
|
+
* - 'sm': Small
|
|
26
|
+
* - 'md': Medium
|
|
27
|
+
* - 'lg': Large
|
|
28
|
+
* 'trigger': Same size as the trigger
|
|
29
|
+
* @defaultValue 'trigger'
|
|
30
|
+
*/
|
|
31
|
+
popoverSize?: 'sm' | 'md' | 'lg' | 'trigger';
|
|
32
|
+
/**
|
|
33
|
+
* Custom classes to style different slots within the select component.
|
|
34
|
+
*/
|
|
35
|
+
classes?: SlotsToClasses<SelectSlots>;
|
|
7
36
|
/**
|
|
8
37
|
* Whether the select should close upon selecting an item.
|
|
9
38
|
*
|
|
@@ -11,40 +40,235 @@ interface SelectArgs<T = unknown> extends Pick<PopoverSignature['Args'], 'placem
|
|
|
11
40
|
*/
|
|
12
41
|
closeOnItemSelect?: boolean;
|
|
13
42
|
/**
|
|
43
|
+
* Whether scrolling should be blocked when the select dropdown is open.
|
|
44
|
+
*
|
|
14
45
|
* @defaultValue true
|
|
15
46
|
*/
|
|
16
47
|
blockScroll?: boolean;
|
|
17
48
|
/**
|
|
18
|
-
*
|
|
49
|
+
* Whether the focus trap should be disabled when the dropdown is open.
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue true
|
|
19
52
|
*/
|
|
20
53
|
disableFocusTrap?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The placeholder text displayed when no option is selected.
|
|
56
|
+
*/
|
|
21
57
|
placeholder?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the select should be disabled, preventing user interaction.
|
|
60
|
+
*/
|
|
22
61
|
isDisabled?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Allows filtering of the items in the select dropdown.
|
|
64
|
+
* If true, a search input is displayed for filtering.
|
|
65
|
+
*
|
|
66
|
+
* @defaultValue false
|
|
67
|
+
*/
|
|
68
|
+
isFilterable?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Function to filter the items in the select.
|
|
71
|
+
* The default implementation performs a case-insensitive search.
|
|
72
|
+
*
|
|
73
|
+
* @param itemValue - The value of an item in the dropdown.
|
|
74
|
+
* @param filterValue - The user's input in the filter/search box.
|
|
75
|
+
* @returns A boolean indicating whether the item should be shown.
|
|
76
|
+
*/
|
|
77
|
+
filter?: (itemValue: string, filterValue: string) => boolean;
|
|
78
|
+
/**
|
|
79
|
+
* If true, the select will show a loading spinner instead of the dropdown icon.
|
|
80
|
+
*/
|
|
81
|
+
isLoading?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The name attribute for the select component, useful for form submissions.
|
|
84
|
+
*/
|
|
23
85
|
name?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Whether to include a clear button in the select component.
|
|
88
|
+
* If enabled, this allows users to clear the selection.
|
|
89
|
+
* This option ignores the `allowEmpty` setting.
|
|
90
|
+
*
|
|
91
|
+
* @defaultValue false
|
|
92
|
+
*/
|
|
93
|
+
isClearable?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Controls pointer-events property of startContent.
|
|
96
|
+
* If you want to pass the click event to the input, set it to `none`.
|
|
97
|
+
*
|
|
98
|
+
* @defaultValue 'auto'
|
|
99
|
+
*/
|
|
100
|
+
startContentPointerEvents?: 'none' | 'auto';
|
|
101
|
+
/**
|
|
102
|
+
* Controls pointer-events property of endContent.
|
|
103
|
+
* Defauled to `none` to pass the click event to the input. If your content
|
|
104
|
+
* needs to capture events, consider adding `pointer-events-auto` class to that
|
|
105
|
+
* element only.
|
|
106
|
+
*
|
|
107
|
+
* @defaultValue 'none'
|
|
108
|
+
*/
|
|
109
|
+
endContentPointerEvents?: 'none' | 'auto';
|
|
110
|
+
/**
|
|
111
|
+
* If true, hides the empty content when there are no options available.
|
|
112
|
+
*
|
|
113
|
+
* @defaultValue false
|
|
114
|
+
*/
|
|
115
|
+
hideEmptyContent?: boolean;
|
|
24
116
|
}
|
|
25
|
-
interface SelectSignature {
|
|
26
|
-
Args: SelectArgs
|
|
117
|
+
interface SelectSignature<T> {
|
|
118
|
+
Args: SelectArgs<T>;
|
|
27
119
|
Element: HTMLDivElement;
|
|
28
|
-
Blocks: ListboxSignature['Blocks']
|
|
120
|
+
Blocks: ListboxSignature<T>['Blocks'] & {
|
|
121
|
+
/**
|
|
122
|
+
* Content to display at the **beginning** of the select component.
|
|
123
|
+
* This can be an icon, a label, or any custom UI element.
|
|
124
|
+
*
|
|
125
|
+
* Example: A search icon or a custom label.
|
|
126
|
+
*/
|
|
127
|
+
startContent: [];
|
|
128
|
+
/**
|
|
129
|
+
* Content to display at the **end** of the select component.
|
|
130
|
+
* This can be an icon, a button, or any custom UI element.
|
|
131
|
+
*
|
|
132
|
+
* Example: A clear button or a dropdown arrow.
|
|
133
|
+
*/
|
|
134
|
+
endContent: [];
|
|
135
|
+
/**
|
|
136
|
+
* The content to display when there are no available options.
|
|
137
|
+
* If `hideEmptyContent` argument is true, this content will not be shown.
|
|
138
|
+
*/
|
|
139
|
+
emptyContent: [];
|
|
140
|
+
};
|
|
29
141
|
}
|
|
30
|
-
declare class Select extends Component<SelectSignature
|
|
142
|
+
declare class Select<T = unknown> extends Component<SelectSignature<T>> {
|
|
31
143
|
nodes: ListItem[];
|
|
32
144
|
isOpen: boolean;
|
|
145
|
+
_selectedKeys: string[];
|
|
146
|
+
filterValue?: string;
|
|
147
|
+
containerRef: {
|
|
148
|
+
readonly element: HTMLDivElement | undefined;
|
|
149
|
+
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
150
|
+
Args: {
|
|
151
|
+
Positional: unknown[];
|
|
152
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
153
|
+
};
|
|
154
|
+
Element: HTMLDivElement;
|
|
155
|
+
}>;
|
|
156
|
+
};
|
|
157
|
+
triggerRef: {
|
|
158
|
+
readonly element: HTMLInputElement | HTMLButtonElement | undefined;
|
|
159
|
+
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
160
|
+
Args: {
|
|
161
|
+
Positional: unknown[];
|
|
162
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
163
|
+
};
|
|
164
|
+
Element: HTMLInputElement | HTMLButtonElement;
|
|
165
|
+
}>;
|
|
166
|
+
};
|
|
167
|
+
onSelectionChange: (keys: string[]) => void;
|
|
33
168
|
onOpenChange: (isOpen: boolean) => void;
|
|
169
|
+
onFilterChange: (event: Event) => void;
|
|
170
|
+
get selectedKeys(): string[];
|
|
34
171
|
get blockScroll(): boolean;
|
|
35
172
|
get disableFocusTrap(): boolean;
|
|
36
173
|
onAction: (key: string) => void;
|
|
37
|
-
|
|
38
|
-
onItemsChange: (nodes: ListItem[], _:
|
|
174
|
+
clearSelectedKeys: (event: Event) => void;
|
|
175
|
+
onItemsChange: (nodes: ListItem[], _: "add" | "remove") => void;
|
|
176
|
+
didClose: () => void;
|
|
177
|
+
get selectedText(): string;
|
|
39
178
|
get selectedTextValue(): string;
|
|
40
|
-
get backdrop(): "
|
|
41
|
-
get
|
|
42
|
-
base:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
179
|
+
get backdrop(): "blur" | "none" | "transparent" | "faded";
|
|
180
|
+
get classes(): {
|
|
181
|
+
base: (slotProps?: ({
|
|
182
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
183
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
184
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
185
|
+
hasStartContent?: boolean | undefined;
|
|
186
|
+
hasEndContent?: boolean | undefined;
|
|
187
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
188
|
+
innerContainer: (slotProps?: ({
|
|
189
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
190
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
191
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
192
|
+
hasStartContent?: boolean | undefined;
|
|
193
|
+
hasEndContent?: boolean | undefined;
|
|
194
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
195
|
+
startContent: (slotProps?: ({
|
|
196
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
197
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
198
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
199
|
+
hasStartContent?: boolean | undefined;
|
|
200
|
+
hasEndContent?: boolean | undefined;
|
|
201
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
202
|
+
endContent: (slotProps?: ({
|
|
203
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
204
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
205
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
206
|
+
hasStartContent?: boolean | undefined;
|
|
207
|
+
hasEndContent?: boolean | undefined;
|
|
208
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
209
|
+
input: (slotProps?: ({
|
|
210
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
211
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
212
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
213
|
+
hasStartContent?: boolean | undefined;
|
|
214
|
+
hasEndContent?: boolean | undefined;
|
|
215
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
216
|
+
} & {
|
|
217
|
+
base: (slotProps?: ({
|
|
218
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
219
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
220
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
221
|
+
hasStartContent?: boolean | undefined;
|
|
222
|
+
hasEndContent?: boolean | undefined;
|
|
223
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
224
|
+
placeholder: (slotProps?: ({
|
|
225
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
226
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
227
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
228
|
+
hasStartContent?: boolean | undefined;
|
|
229
|
+
hasEndContent?: boolean | undefined;
|
|
230
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
231
|
+
listbox: (slotProps?: ({
|
|
232
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
233
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
234
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
235
|
+
hasStartContent?: boolean | undefined;
|
|
236
|
+
hasEndContent?: boolean | undefined;
|
|
237
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
238
|
+
icon: (slotProps?: ({
|
|
239
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
240
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
241
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
242
|
+
hasStartContent?: boolean | undefined;
|
|
243
|
+
hasEndContent?: boolean | undefined;
|
|
244
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
245
|
+
clearButton: (slotProps?: ({
|
|
246
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
247
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
248
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
249
|
+
hasStartContent?: boolean | undefined;
|
|
250
|
+
hasEndContent?: boolean | undefined;
|
|
251
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
252
|
+
input: (slotProps?: ({
|
|
253
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
254
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
255
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
256
|
+
hasStartContent?: boolean | undefined;
|
|
257
|
+
hasEndContent?: boolean | undefined;
|
|
258
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
259
|
+
emptyContent: (slotProps?: ({
|
|
260
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
261
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
262
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
263
|
+
hasStartContent?: boolean | undefined;
|
|
264
|
+
hasEndContent?: boolean | undefined;
|
|
265
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
266
|
+
} & {};
|
|
267
|
+
get isClearable(): boolean | undefined;
|
|
268
|
+
get filterFieldValue(): string;
|
|
269
|
+
get filteredItems(): T[] | undefined;
|
|
270
|
+
get showEmptyContent(): boolean;
|
|
271
|
+
get autoActivateMode(): 'first' | 'selected';
|
|
48
272
|
}
|
|
49
273
|
export { Select, type SelectSignature };
|
|
50
274
|
export default Select;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CA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E,MAAM,CAAC;IAE9B,YAAY;;;;;8BAzN0B,mCACtC;;;;MAwNqC;IACrC,UAAU;;;;;8BA1N4B,mCACtC;;;;MAyNyD;IAEzD,iBAAiB,SAAU,MAAM,EAAE,UASjC;IAEF,YAAY,WAAY,OAAO,UAE7B;IAEF,cAAc,UAAW,KAAK,UAG5B;IAEF,IAAI,YAAY,IAAI,MAAM,EAAE,CAS3B;IAED,IAAI,WAAW,YAKd;IAED,IAAI,gBAAgB,YAKnB;IAED,QAAQ,QAAS,MAAM,UAWrB;IAEF,iBAAiB,UAAW,KAAK,UAG/B;IAEF,aAAa,UAAW,QAAQ,EAAE,KAAK,KAAK,GAAG,QAAQ,UAErD;IAEF,QAAQ,aAKN;IAEF,IAAI,YAAY,WAEf;IAED,IAAI,iBAAiB,IAAI,MAAM,CAQ9B;IAED,IAAI,QAAQ,8CAKX;IAED,IAAI,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAKV;IAED,IAAI,WAAW,wBAId;IAED,IAAI,gBAAgB,WAKnB;IAED,IAAI,aAAa,oBAahB;IAED,IAAI,gBAAgB,YAEnB;IAED,IAAI,gBAAgB,IAAI,OAAO,GAAG,UAAU,CAK3C;CAuNF;AAID,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type FormControlSharedArgs } from './form-control';
|
|
3
|
+
import { type SwitchVariants, type SwitchSlots, type SlotsToClasses } from '@frontile/theme';
|
|
4
|
+
import type Owner from '@ember/owner';
|
|
5
|
+
interface Args extends FormControlSharedArgs {
|
|
6
|
+
/**
|
|
7
|
+
* Controls the current selected state of the Switch.
|
|
8
|
+
* When provided a boolean value, the component operates in a controlled mode.
|
|
9
|
+
*/
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the initial selected state of the Switch when used in uncontrolled mode.
|
|
13
|
+
* @defaultValue false
|
|
14
|
+
*/
|
|
15
|
+
defaultSelected?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The name attribute for the input element.
|
|
18
|
+
* Useful for form submissions.
|
|
19
|
+
*/
|
|
20
|
+
name?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The size of the Switch.
|
|
23
|
+
*/
|
|
24
|
+
size?: SwitchVariants['size'];
|
|
25
|
+
/**
|
|
26
|
+
* The visual intent (e.g., color or style) of the Switch.
|
|
27
|
+
* @defaultValue 'primary'
|
|
28
|
+
*/
|
|
29
|
+
intent?: SwitchVariants['intent'];
|
|
30
|
+
/**
|
|
31
|
+
* Custom classes to style different slots of the Switch component.
|
|
32
|
+
*/
|
|
33
|
+
classes?: SlotsToClasses<SwitchSlots>;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the Switch is disabled.
|
|
36
|
+
* When true, user interaction is prevented.
|
|
37
|
+
*/
|
|
38
|
+
isDisabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Callback triggered when the Switch value changes.
|
|
41
|
+
* Receives the new boolean value and, optionally, the triggering Event.
|
|
42
|
+
*/
|
|
43
|
+
onChange?: ((value: boolean, event: Event) => void) | ((value: boolean) => void);
|
|
44
|
+
}
|
|
45
|
+
interface SwitchSignature {
|
|
46
|
+
Args: Args;
|
|
47
|
+
Blocks: {
|
|
48
|
+
startContent: [];
|
|
49
|
+
thumbContent: [{
|
|
50
|
+
isSelected: boolean;
|
|
51
|
+
}];
|
|
52
|
+
endContent: [];
|
|
53
|
+
};
|
|
54
|
+
Element: HTMLInputElement;
|
|
55
|
+
}
|
|
56
|
+
declare class Switch extends Component<SwitchSignature> {
|
|
57
|
+
_isSelected: boolean;
|
|
58
|
+
constructor(owner: Owner, args: Args);
|
|
59
|
+
get isControlled(): boolean;
|
|
60
|
+
get isSelected(): boolean;
|
|
61
|
+
handleChange: (event: Event) => void;
|
|
62
|
+
get classes(): {
|
|
63
|
+
base: (slotProps?: ({
|
|
64
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
65
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
66
|
+
isDisabled?: boolean | undefined;
|
|
67
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
68
|
+
labelContainer: (slotProps?: ({
|
|
69
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
70
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
71
|
+
isDisabled?: boolean | undefined;
|
|
72
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
73
|
+
label: (slotProps?: ({
|
|
74
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
75
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
76
|
+
isDisabled?: boolean | undefined;
|
|
77
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
78
|
+
wrapper: (slotProps?: ({
|
|
79
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
80
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
81
|
+
isDisabled?: boolean | undefined;
|
|
82
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
83
|
+
hiddenInput: (slotProps?: ({
|
|
84
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
85
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
86
|
+
isDisabled?: boolean | undefined;
|
|
87
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
88
|
+
thumb: (slotProps?: ({
|
|
89
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
90
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
91
|
+
isDisabled?: boolean | undefined;
|
|
92
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
93
|
+
startContent: (slotProps?: ({
|
|
94
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
95
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
96
|
+
isDisabled?: boolean | undefined;
|
|
97
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
98
|
+
endContent: (slotProps?: ({
|
|
99
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
100
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
101
|
+
isDisabled?: boolean | undefined;
|
|
102
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
103
|
+
} & {
|
|
104
|
+
base: (slotProps?: ({
|
|
105
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
106
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
107
|
+
isDisabled?: boolean | undefined;
|
|
108
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
109
|
+
labelContainer: (slotProps?: ({
|
|
110
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
111
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
112
|
+
isDisabled?: boolean | undefined;
|
|
113
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
114
|
+
label: (slotProps?: ({
|
|
115
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
116
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
117
|
+
isDisabled?: boolean | undefined;
|
|
118
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
119
|
+
wrapper: (slotProps?: ({
|
|
120
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
121
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
122
|
+
isDisabled?: boolean | undefined;
|
|
123
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
124
|
+
hiddenInput: (slotProps?: ({
|
|
125
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
126
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
127
|
+
isDisabled?: boolean | undefined;
|
|
128
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
129
|
+
thumb: (slotProps?: ({
|
|
130
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
131
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
132
|
+
isDisabled?: boolean | undefined;
|
|
133
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
134
|
+
startContent: (slotProps?: ({
|
|
135
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
136
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
137
|
+
isDisabled?: boolean | undefined;
|
|
138
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
139
|
+
endContent: (slotProps?: ({
|
|
140
|
+
intent?: "default" | "primary" | "success" | "danger" | "warning" | undefined;
|
|
141
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
142
|
+
isDisabled?: boolean | undefined;
|
|
143
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
144
|
+
} & {};
|
|
145
|
+
}
|
|
146
|
+
export { Switch, type SwitchSignature };
|
|
147
|
+
export default Switch;
|
|
148
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/swit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MpC,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,UAAU,IAAI,OAAO,CAKxB;IAED,YAAY,UAAW,KAAK,UAS1B;IAEF,IAAI,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAOV;CAwGF;AAED,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type FormControlSharedArgs } from './form-control';
|
|
3
|
+
import { type TextareaSlots, type TextareaVariants, type SlotsToClasses } from '@frontile/theme';
|
|
4
|
+
interface Args extends FormControlSharedArgs {
|
|
5
|
+
id?: string;
|
|
6
|
+
value?: string | number | boolean;
|
|
7
|
+
name?: string;
|
|
8
|
+
size?: TextareaVariants['size'];
|
|
9
|
+
classes?: SlotsToClasses<TextareaSlots>;
|
|
10
|
+
onInput?: (value: string, event: InputEvent) => void;
|
|
11
|
+
onChange?: (value: string, event: InputEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
interface TextareaSignature {
|
|
14
|
+
Args: Args;
|
|
15
|
+
Element: HTMLTextAreaElement;
|
|
16
|
+
}
|
|
17
|
+
declare class Textarea extends Component<TextareaSignature> {
|
|
18
|
+
handleOnInput(event: Event): void;
|
|
19
|
+
handleOnChange(event: Event): void;
|
|
20
|
+
get classes(): {
|
|
21
|
+
base: (slotProps?: ({
|
|
22
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
23
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
24
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
25
|
+
hasStartContent?: boolean | undefined;
|
|
26
|
+
hasEndContent?: boolean | undefined;
|
|
27
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
28
|
+
innerContainer: (slotProps?: ({
|
|
29
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
30
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
31
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
32
|
+
hasStartContent?: boolean | undefined;
|
|
33
|
+
hasEndContent?: boolean | undefined;
|
|
34
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
35
|
+
startContent: (slotProps?: ({
|
|
36
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
37
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
38
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
39
|
+
hasStartContent?: boolean | undefined;
|
|
40
|
+
hasEndContent?: boolean | undefined;
|
|
41
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
42
|
+
endContent: (slotProps?: ({
|
|
43
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
44
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
45
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
46
|
+
hasStartContent?: boolean | undefined;
|
|
47
|
+
hasEndContent?: boolean | undefined;
|
|
48
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
49
|
+
input: (slotProps?: ({
|
|
50
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
51
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
52
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
53
|
+
hasStartContent?: boolean | undefined;
|
|
54
|
+
hasEndContent?: boolean | undefined;
|
|
55
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
56
|
+
} & {
|
|
57
|
+
input: (slotProps?: ({
|
|
58
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
59
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
60
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
61
|
+
hasStartContent?: boolean | undefined;
|
|
62
|
+
hasEndContent?: boolean | undefined;
|
|
63
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
64
|
+
} & {};
|
|
65
|
+
}
|
|
66
|
+
export { Textarea, type TextareaSignature };
|
|
67
|
+
export default Textarea;
|
|
68
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAe,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAEzB,UAAU,IAAK,SAAQ,qBAAqB;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IAGxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAGrD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvD;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,cAAM,QAAS,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACzC,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IASjC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAS1C,IAAI,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAKV;CA4BF;AACD,OAAO,EAAE,QAAQ,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
package/declarations/index.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
export * from './components/
|
|
1
|
+
export * from './components/form';
|
|
2
|
+
export * from './components/checkbox';
|
|
3
|
+
export * from './components/checkbox-group';
|
|
4
|
+
export * from './components/form-description';
|
|
5
|
+
export * from './components/form-feedback';
|
|
6
|
+
export * from './components/input';
|
|
7
|
+
export * from './components/label';
|
|
2
8
|
export * from './components/native-select';
|
|
3
|
-
export
|
|
9
|
+
export * from './components/select';
|
|
10
|
+
export * from './components/textarea';
|
|
11
|
+
export * from './components/radio';
|
|
12
|
+
export * from './components/radio-group';
|
|
13
|
+
export * from './components/form-control';
|
|
14
|
+
export * from './components/switch';
|
|
4
15
|
//# sourceMappingURL=index.d.ts.map
|