@cdx-ui/primitives 0.0.1-beta.65 → 0.0.1-beta.67
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 +35 -36
- package/lib/commonjs/CLAUDE.md +64 -12
- package/lib/commonjs/avatar/{createAvatarRoot.js → AvatarRoot.js} +10 -6
- package/lib/commonjs/avatar/AvatarRoot.js.map +1 -0
- package/lib/commonjs/avatar/index.js +14 -24
- package/lib/commonjs/avatar/index.js.map +1 -1
- package/lib/commonjs/button/{createButtonRoot.js → ButtonRoot.js} +13 -9
- package/lib/commonjs/button/ButtonRoot.js.map +1 -0
- package/lib/commonjs/button/index.js +7 -24
- package/lib/commonjs/button/index.js.map +1 -1
- package/lib/commonjs/checkbox/{createCheckboxGroup.js → CheckboxGroup.js} +20 -12
- package/lib/commonjs/checkbox/CheckboxGroup.js.map +1 -0
- package/lib/commonjs/checkbox/CheckboxRoot.js +103 -0
- package/lib/commonjs/checkbox/CheckboxRoot.js.map +1 -0
- package/lib/commonjs/checkbox/CheckboxRoot.web.js +94 -0
- package/lib/commonjs/checkbox/CheckboxRoot.web.js.map +1 -0
- package/lib/commonjs/checkbox/index.js +21 -24
- package/lib/commonjs/checkbox/index.js.map +1 -1
- package/lib/commonjs/chip/ChipRoot.js +147 -0
- package/lib/commonjs/chip/ChipRoot.js.map +1 -0
- package/lib/commonjs/chip/context.js +11 -0
- package/lib/commonjs/chip/context.js.map +1 -0
- package/lib/commonjs/chip/index.js +14 -10
- package/lib/commonjs/chip/index.js.map +1 -1
- package/lib/commonjs/dialog/DialogClose.js +32 -0
- package/lib/commonjs/dialog/DialogClose.js.map +1 -0
- package/lib/commonjs/dialog/{createDialogPopup.js → DialogPopup.js} +18 -14
- package/lib/commonjs/dialog/DialogPopup.js.map +1 -0
- package/lib/commonjs/dialog/{createDialogRoot.js → DialogRoot.js} +11 -8
- package/lib/commonjs/dialog/DialogRoot.js.map +1 -0
- package/lib/commonjs/dialog/DialogTrigger.js +32 -0
- package/lib/commonjs/dialog/DialogTrigger.js.map +1 -0
- package/lib/commonjs/dialog/index.js +28 -41
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/field/FieldLabel.js +48 -0
- package/lib/commonjs/field/FieldLabel.js.map +1 -0
- package/lib/commonjs/field/FieldLabel.web.js +60 -0
- package/lib/commonjs/field/FieldLabel.web.js.map +1 -0
- package/lib/commonjs/field/FieldRoot.js +38 -0
- package/lib/commonjs/field/FieldRoot.js.map +1 -0
- package/lib/commonjs/field/index.js +14 -40
- package/lib/commonjs/field/index.js.map +1 -1
- package/lib/commonjs/form/FormRoot.js +25 -0
- package/lib/commonjs/form/FormRoot.js.map +1 -0
- package/lib/commonjs/{dialog/createDialogFooter.js → form/FormRoot.web.js} +14 -8
- package/lib/commonjs/form/FormRoot.web.js.map +1 -0
- package/lib/commonjs/form/index.js +7 -9
- package/lib/commonjs/form/index.js.map +1 -1
- package/lib/commonjs/index.js +42 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/input/{createInputField.js → InputField.android.js} +36 -38
- package/lib/commonjs/input/InputField.android.js.map +1 -0
- package/lib/commonjs/input/InputField.js +92 -0
- package/lib/commonjs/input/InputField.js.map +1 -0
- package/lib/commonjs/input/InputField.web.js +131 -0
- package/lib/commonjs/input/InputField.web.js.map +1 -0
- package/lib/commonjs/input/{createInputRoot.js → InputRoot.js} +29 -27
- package/lib/commonjs/input/InputRoot.js.map +1 -0
- package/lib/commonjs/input/index.js +21 -16
- package/lib/commonjs/input/index.js.map +1 -1
- package/lib/commonjs/link/{createLink.js → LinkRoot.js} +20 -20
- package/lib/commonjs/link/LinkRoot.js.map +1 -0
- package/lib/commonjs/link/index.js +3 -3
- package/lib/commonjs/link/index.js.map +1 -1
- package/lib/commonjs/list-item/{createListItemRoot.js → ListItemRoot.js} +48 -68
- package/lib/commonjs/list-item/ListItemRoot.js.map +1 -0
- package/lib/commonjs/list-item/context.js.map +1 -1
- package/lib/commonjs/list-item/index.js +7 -36
- package/lib/commonjs/list-item/index.js.map +1 -1
- package/lib/commonjs/otp-input/{createOtpInputField.js → OtpInputField.js} +24 -8
- package/lib/commonjs/otp-input/OtpInputField.js.map +1 -0
- package/lib/commonjs/otp-input/index.js +39 -16
- package/lib/commonjs/otp-input/index.js.map +1 -1
- package/lib/commonjs/otp-input/{createOtpInputRoot.js → useOtpInput.js} +33 -49
- package/lib/commonjs/otp-input/useOtpInput.js.map +1 -0
- package/lib/commonjs/overlay/useDismissOverlay.js +0 -2
- package/lib/commonjs/overlay/useDismissOverlay.js.map +1 -1
- package/lib/commonjs/overlay/useEscapeKey.js +0 -2
- package/lib/commonjs/overlay/useEscapeKey.js.map +1 -1
- package/lib/commonjs/{progress/createProgressIndicator.js → progress-bar/ProgressBarIndicator.js} +12 -9
- package/lib/commonjs/progress-bar/ProgressBarIndicator.js.map +1 -0
- package/lib/commonjs/{progress/createProgressRoot.js → progress-bar/ProgressBarRoot.js} +9 -5
- package/lib/commonjs/progress-bar/ProgressBarRoot.js.map +1 -0
- package/lib/commonjs/progress-bar/context.js.map +1 -0
- package/lib/commonjs/progress-bar/index.js +27 -0
- package/lib/commonjs/progress-bar/index.js.map +1 -0
- package/lib/commonjs/{progress → progress-bar}/types.js.map +1 -1
- package/lib/commonjs/radio/{createRadioGroup.js → RadioGroup.js} +18 -10
- package/lib/commonjs/radio/RadioGroup.js.map +1 -0
- package/lib/commonjs/radio/RadioRoot.js +99 -0
- package/lib/commonjs/radio/RadioRoot.js.map +1 -0
- package/lib/commonjs/radio/RadioRoot.web.js +91 -0
- package/lib/commonjs/radio/RadioRoot.web.js.map +1 -0
- package/lib/commonjs/radio/index.js +21 -20
- package/lib/commonjs/radio/index.js.map +1 -1
- package/lib/commonjs/select/{createSelectContent.js → SelectContent.js} +14 -11
- package/lib/commonjs/select/SelectContent.js.map +1 -0
- package/lib/commonjs/select/{createSelectItem.js → SelectItem.js} +18 -15
- package/lib/commonjs/select/SelectItem.js.map +1 -0
- package/lib/commonjs/select/{createSelectRoot.js → SelectRoot.js} +11 -8
- package/lib/commonjs/select/SelectRoot.js.map +1 -0
- package/lib/commonjs/select/SelectTrigger.js +72 -0
- package/lib/commonjs/select/SelectTrigger.js.map +1 -0
- package/lib/commonjs/select/SelectTrigger.web.js +175 -0
- package/lib/commonjs/select/SelectTrigger.web.js.map +1 -0
- package/lib/commonjs/select/context.js +3 -12
- package/lib/commonjs/select/context.js.map +1 -1
- package/lib/commonjs/select/index.js +41 -32
- package/lib/commonjs/select/index.js.map +1 -1
- package/lib/commonjs/select/useContentFocus.js +1 -1
- package/lib/commonjs/select/useSelectTrigger.js +206 -0
- package/lib/commonjs/select/useSelectTrigger.js.map +1 -0
- package/lib/commonjs/select/useSelectTrigger.web.js +192 -0
- package/lib/commonjs/select/useSelectTrigger.web.js.map +1 -0
- package/lib/commonjs/slot/index.js +19 -0
- package/lib/commonjs/slot/index.js.map +1 -0
- package/lib/commonjs/switch/index.js +7 -9
- package/lib/commonjs/switch/index.js.map +1 -1
- package/lib/commonjs/switch/useSwitch.js +81 -0
- package/lib/commonjs/switch/useSwitch.js.map +1 -0
- package/lib/commonjs/tile/{createTileGroup.js → TileGroup.js} +11 -12
- package/lib/commonjs/tile/TileGroup.js.map +1 -0
- package/lib/commonjs/tile/TileRoot.js +129 -0
- package/lib/commonjs/tile/TileRoot.js.map +1 -0
- package/lib/commonjs/tile/index.js +14 -36
- package/lib/commonjs/tile/index.js.map +1 -1
- package/lib/commonjs/utils/dataAttributes.js +6 -0
- package/lib/commonjs/utils/dataAttributes.js.map +1 -1
- package/lib/commonjs/utils/dataAttributes.web.js +25 -0
- package/lib/commonjs/utils/dataAttributes.web.js.map +1 -1
- package/lib/commonjs/utils/domDataAttributes.js +30 -0
- package/lib/commonjs/utils/domDataAttributes.js.map +1 -1
- package/lib/module/CLAUDE.md +64 -12
- package/lib/module/avatar/{createAvatarRoot.js → AvatarRoot.js} +9 -4
- package/lib/module/avatar/AvatarRoot.js.map +1 -0
- package/lib/module/avatar/index.js +2 -23
- package/lib/module/avatar/index.js.map +1 -1
- package/lib/module/button/{createButtonRoot.js → ButtonRoot.js} +13 -8
- package/lib/module/button/ButtonRoot.js.map +1 -0
- package/lib/module/button/index.js +1 -23
- package/lib/module/button/index.js.map +1 -1
- package/lib/module/checkbox/{createCheckboxGroup.js → CheckboxGroup.js} +20 -11
- package/lib/module/checkbox/CheckboxGroup.js.map +1 -0
- package/lib/module/checkbox/CheckboxRoot.js +99 -0
- package/lib/module/checkbox/CheckboxRoot.js.map +1 -0
- package/lib/module/checkbox/CheckboxRoot.web.js +90 -0
- package/lib/module/checkbox/CheckboxRoot.web.js.map +1 -0
- package/lib/module/checkbox/index.js +3 -23
- package/lib/module/checkbox/index.js.map +1 -1
- package/lib/module/chip/ChipRoot.js +142 -0
- package/lib/module/chip/ChipRoot.js.map +1 -0
- package/lib/module/chip/context.js +5 -0
- package/lib/module/chip/context.js.map +1 -0
- package/lib/module/chip/index.js +2 -9
- package/lib/module/chip/index.js.map +1 -1
- package/lib/module/dialog/DialogClose.js +28 -0
- package/lib/module/dialog/DialogClose.js.map +1 -0
- package/lib/module/dialog/{createDialogPopup.js → DialogPopup.js} +19 -14
- package/lib/module/dialog/DialogPopup.js.map +1 -0
- package/lib/module/dialog/{createDialogRoot.js → DialogRoot.js} +11 -7
- package/lib/module/dialog/DialogRoot.js.map +1 -0
- package/lib/module/dialog/DialogTrigger.js +28 -0
- package/lib/module/dialog/DialogTrigger.js.map +1 -0
- package/lib/module/dialog/index.js +5 -42
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/field/FieldLabel.js +44 -0
- package/lib/module/field/FieldLabel.js.map +1 -0
- package/lib/module/field/FieldLabel.web.js +55 -0
- package/lib/module/field/FieldLabel.web.js.map +1 -0
- package/lib/module/field/FieldRoot.js +34 -0
- package/lib/module/field/FieldRoot.js.map +1 -0
- package/lib/module/field/index.js +2 -39
- package/lib/module/field/index.js.map +1 -1
- package/lib/module/form/FormRoot.js +21 -0
- package/lib/module/form/FormRoot.js.map +1 -0
- package/lib/module/form/FormRoot.web.js +22 -0
- package/lib/module/form/FormRoot.web.js.map +1 -0
- package/lib/module/form/index.js +1 -8
- package/lib/module/form/index.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/{createInputField.js → InputField.android.js} +36 -37
- package/lib/module/input/InputField.android.js.map +1 -0
- package/lib/module/input/InputField.js +88 -0
- package/lib/module/input/InputField.js.map +1 -0
- package/lib/module/input/InputField.web.js +126 -0
- package/lib/module/input/InputField.web.js.map +1 -0
- package/lib/module/input/{createInputRoot.js → InputRoot.js} +29 -25
- package/lib/module/input/InputRoot.js.map +1 -0
- package/lib/module/input/index.js +3 -15
- package/lib/module/input/index.js.map +1 -1
- package/lib/module/link/{createLink.js → LinkRoot.js} +21 -19
- package/lib/module/link/LinkRoot.js.map +1 -0
- package/lib/module/link/index.js +1 -1
- package/lib/module/link/index.js.map +1 -1
- package/lib/module/list-item/{createListItemRoot.js → ListItemRoot.js} +49 -68
- package/lib/module/list-item/ListItemRoot.js.map +1 -0
- package/lib/module/list-item/context.js.map +1 -1
- package/lib/module/list-item/index.js +1 -35
- package/lib/module/list-item/index.js.map +1 -1
- package/lib/module/otp-input/{createOtpInputField.js → OtpInputField.js} +24 -7
- package/lib/module/otp-input/OtpInputField.js.map +1 -0
- package/lib/module/otp-input/index.js +3 -15
- package/lib/module/otp-input/index.js.map +1 -1
- package/lib/module/otp-input/{createOtpInputRoot.js → useOtpInput.js} +33 -48
- package/lib/module/otp-input/useOtpInput.js.map +1 -0
- package/lib/module/overlay/useDismissOverlay.js +0 -2
- package/lib/module/overlay/useDismissOverlay.js.map +1 -1
- package/lib/module/overlay/useEscapeKey.js +0 -2
- package/lib/module/overlay/useEscapeKey.js.map +1 -1
- package/lib/module/{progress/createProgressIndicator.js → progress-bar/ProgressBarIndicator.js} +11 -7
- package/lib/module/progress-bar/ProgressBarIndicator.js.map +1 -0
- package/lib/module/{progress/createProgressRoot.js → progress-bar/ProgressBarRoot.js} +8 -3
- package/lib/module/progress-bar/ProgressBarRoot.js.map +1 -0
- package/lib/module/progress-bar/context.js.map +1 -0
- package/lib/module/progress-bar/index.js +6 -0
- package/lib/module/progress-bar/index.js.map +1 -0
- package/lib/module/{progress → progress-bar}/types.js.map +1 -1
- package/lib/module/radio/{createRadioGroup.js → RadioGroup.js} +18 -9
- package/lib/module/radio/RadioGroup.js.map +1 -0
- package/lib/module/radio/RadioRoot.js +95 -0
- package/lib/module/radio/RadioRoot.js.map +1 -0
- package/lib/module/radio/RadioRoot.web.js +87 -0
- package/lib/module/radio/RadioRoot.web.js.map +1 -0
- package/lib/module/radio/index.js +3 -19
- package/lib/module/radio/index.js.map +1 -1
- package/lib/module/select/{createSelectContent.js → SelectContent.js} +14 -11
- package/lib/module/select/SelectContent.js.map +1 -0
- package/lib/module/select/{createSelectItem.js → SelectItem.js} +18 -14
- package/lib/module/select/SelectItem.js.map +1 -0
- package/lib/module/select/{createSelectRoot.js → SelectRoot.js} +11 -7
- package/lib/module/select/SelectRoot.js.map +1 -0
- package/lib/module/select/SelectTrigger.js +67 -0
- package/lib/module/select/SelectTrigger.js.map +1 -0
- package/lib/module/select/SelectTrigger.web.js +170 -0
- package/lib/module/select/SelectTrigger.web.js.map +1 -0
- package/lib/module/select/context.js +1 -8
- package/lib/module/select/context.js.map +1 -1
- package/lib/module/select/index.js +5 -31
- package/lib/module/select/index.js.map +1 -1
- package/lib/module/select/useContentFocus.js +1 -1
- package/lib/module/select/useSelectTrigger.js +202 -0
- package/lib/module/select/useSelectTrigger.js.map +1 -0
- package/lib/module/select/useSelectTrigger.web.js +188 -0
- package/lib/module/select/useSelectTrigger.web.js.map +1 -0
- package/lib/module/slot/index.js +4 -0
- package/lib/module/slot/index.js.map +1 -0
- package/lib/module/switch/index.js +1 -8
- package/lib/module/switch/index.js.map +1 -1
- package/lib/module/switch/useSwitch.js +77 -0
- package/lib/module/switch/useSwitch.js.map +1 -0
- package/lib/module/tile/{createTileGroup.js → TileGroup.js} +10 -9
- package/lib/module/tile/TileGroup.js.map +1 -0
- package/lib/module/tile/{createTileRoot.js → TileRoot.js} +52 -54
- package/lib/module/tile/TileRoot.js.map +1 -0
- package/lib/module/tile/index.js +2 -35
- package/lib/module/tile/index.js.map +1 -1
- package/lib/module/utils/dataAttributes.js +1 -1
- package/lib/module/utils/dataAttributes.js.map +1 -1
- package/lib/module/utils/dataAttributes.web.js +24 -0
- package/lib/module/utils/dataAttributes.web.js.map +1 -1
- package/lib/module/utils/domDataAttributes.js +29 -0
- package/lib/module/utils/domDataAttributes.js.map +1 -1
- package/lib/typescript/avatar/AvatarRoot.d.ts +8 -0
- package/lib/typescript/avatar/AvatarRoot.d.ts.map +1 -0
- package/lib/typescript/avatar/index.d.ts +3 -10
- package/lib/typescript/avatar/index.d.ts.map +1 -1
- package/lib/typescript/avatar/types.d.ts +1 -17
- package/lib/typescript/avatar/types.d.ts.map +1 -1
- package/lib/typescript/button/ButtonRoot.d.ts +9 -0
- package/lib/typescript/button/ButtonRoot.d.ts.map +1 -0
- package/lib/typescript/button/index.d.ts +2 -10
- package/lib/typescript/button/index.d.ts.map +1 -1
- package/lib/typescript/button/types.d.ts +1 -34
- package/lib/typescript/button/types.d.ts.map +1 -1
- package/lib/typescript/checkbox/CheckboxGroup.d.ts +9 -0
- package/lib/typescript/checkbox/CheckboxGroup.d.ts.map +1 -0
- package/lib/typescript/checkbox/CheckboxRoot.d.ts +6 -0
- package/lib/typescript/checkbox/CheckboxRoot.d.ts.map +1 -0
- package/lib/typescript/checkbox/CheckboxRoot.web.d.ts +6 -0
- package/lib/typescript/checkbox/CheckboxRoot.web.d.ts.map +1 -0
- package/lib/typescript/checkbox/index.d.ts +4 -10
- package/lib/typescript/checkbox/index.d.ts.map +1 -1
- package/lib/typescript/checkbox/types.d.ts +0 -17
- package/lib/typescript/checkbox/types.d.ts.map +1 -1
- package/lib/typescript/checkbox/useCheckboxRoot.d.ts +1 -1
- package/lib/typescript/chip/ChipRoot.d.ts +7 -0
- package/lib/typescript/chip/ChipRoot.d.ts.map +1 -0
- package/lib/typescript/chip/context.d.ts +6 -0
- package/lib/typescript/chip/context.d.ts.map +1 -0
- package/lib/typescript/chip/index.d.ts +3 -8
- package/lib/typescript/chip/index.d.ts.map +1 -1
- package/lib/typescript/chip/types.d.ts +3 -4
- package/lib/typescript/chip/types.d.ts.map +1 -1
- package/lib/typescript/dialog/DialogClose.d.ts +5 -0
- package/lib/typescript/dialog/DialogClose.d.ts.map +1 -0
- package/lib/typescript/dialog/DialogPopup.d.ts +14 -0
- package/lib/typescript/dialog/DialogPopup.d.ts.map +1 -0
- package/lib/typescript/dialog/DialogRoot.d.ts +7 -0
- package/lib/typescript/dialog/DialogRoot.d.ts.map +1 -0
- package/lib/typescript/dialog/DialogTrigger.d.ts +5 -0
- package/lib/typescript/dialog/DialogTrigger.d.ts.map +1 -0
- package/lib/typescript/dialog/index.d.ts +6 -17
- package/lib/typescript/dialog/index.d.ts.map +1 -1
- package/lib/typescript/dialog/types.d.ts +2 -24
- package/lib/typescript/dialog/types.d.ts.map +1 -1
- package/lib/typescript/field/FieldLabel.d.ts +12 -0
- package/lib/typescript/field/FieldLabel.d.ts.map +1 -0
- package/lib/typescript/field/FieldLabel.web.d.ts +24 -0
- package/lib/typescript/field/FieldLabel.web.d.ts.map +1 -0
- package/lib/typescript/field/FieldRoot.d.ts +8 -0
- package/lib/typescript/field/FieldRoot.d.ts.map +1 -0
- package/lib/typescript/field/index.d.ts +3 -12
- package/lib/typescript/field/index.d.ts.map +1 -1
- package/lib/typescript/field/types.d.ts +0 -20
- package/lib/typescript/field/types.d.ts.map +1 -1
- package/lib/typescript/form/FormRoot.d.ts +8 -0
- package/lib/typescript/form/FormRoot.d.ts.map +1 -0
- package/lib/typescript/form/FormRoot.web.d.ts +8 -0
- package/lib/typescript/form/FormRoot.web.d.ts.map +1 -0
- package/lib/typescript/form/index.d.ts +2 -5
- package/lib/typescript/form/index.d.ts.map +1 -1
- package/lib/typescript/form/types.d.ts +8 -9
- package/lib/typescript/form/types.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +5 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/input/InputField.android.d.ts +5 -0
- package/lib/typescript/input/InputField.android.d.ts.map +1 -0
- package/lib/typescript/input/InputField.d.ts +5 -0
- package/lib/typescript/input/InputField.d.ts.map +1 -0
- package/lib/typescript/input/InputField.web.d.ts +6 -0
- package/lib/typescript/input/InputField.web.d.ts.map +1 -0
- package/lib/typescript/input/InputRoot.d.ts +5 -0
- package/lib/typescript/input/InputRoot.d.ts.map +1 -0
- package/lib/typescript/input/index.d.ts +4 -8
- package/lib/typescript/input/index.d.ts.map +1 -1
- package/lib/typescript/input/types.d.ts +20 -39
- package/lib/typescript/input/types.d.ts.map +1 -1
- package/lib/typescript/link/LinkRoot.d.ts +9 -0
- package/lib/typescript/link/LinkRoot.d.ts.map +1 -0
- package/lib/typescript/link/index.d.ts +1 -1
- package/lib/typescript/link/index.d.ts.map +1 -1
- package/lib/typescript/list-item/ListItemRoot.d.ts +7 -0
- package/lib/typescript/list-item/ListItemRoot.d.ts.map +1 -0
- package/lib/typescript/list-item/context.d.ts +3 -3
- package/lib/typescript/list-item/context.d.ts.map +1 -1
- package/lib/typescript/list-item/index.d.ts +2 -14
- package/lib/typescript/list-item/index.d.ts.map +1 -1
- package/lib/typescript/list-item/types.d.ts +4 -52
- package/lib/typescript/list-item/types.d.ts.map +1 -1
- package/lib/typescript/otp-input/OtpInputField.d.ts +19 -0
- package/lib/typescript/otp-input/OtpInputField.d.ts.map +1 -0
- package/lib/typescript/otp-input/index.d.ts +4 -8
- package/lib/typescript/otp-input/index.d.ts.map +1 -1
- package/lib/typescript/otp-input/types.d.ts +0 -9
- package/lib/typescript/otp-input/types.d.ts.map +1 -1
- package/lib/typescript/otp-input/useOtpInput.d.ts +19 -0
- package/lib/typescript/otp-input/useOtpInput.d.ts.map +1 -0
- package/lib/typescript/overlay/useDismissOverlay.d.ts.map +1 -1
- package/lib/typescript/overlay/useEscapeKey.d.ts.map +1 -1
- package/lib/typescript/progress-bar/ProgressBarIndicator.d.ts +6 -0
- package/lib/typescript/progress-bar/ProgressBarIndicator.d.ts.map +1 -0
- package/lib/typescript/progress-bar/ProgressBarRoot.d.ts +6 -0
- package/lib/typescript/progress-bar/ProgressBarRoot.d.ts.map +1 -0
- package/lib/typescript/progress-bar/context.d.ts.map +1 -0
- package/lib/typescript/progress-bar/index.d.ts +6 -0
- package/lib/typescript/progress-bar/index.d.ts.map +1 -0
- package/lib/typescript/{progress → progress-bar}/types.d.ts +1 -4
- package/lib/typescript/progress-bar/types.d.ts.map +1 -0
- package/lib/typescript/radio/RadioGroup.d.ts +9 -0
- package/lib/typescript/radio/RadioGroup.d.ts.map +1 -0
- package/lib/typescript/radio/RadioRoot.d.ts +6 -0
- package/lib/typescript/radio/RadioRoot.d.ts.map +1 -0
- package/lib/typescript/radio/RadioRoot.web.d.ts +6 -0
- package/lib/typescript/radio/RadioRoot.web.d.ts.map +1 -0
- package/lib/typescript/radio/index.d.ts +4 -9
- package/lib/typescript/radio/index.d.ts.map +1 -1
- package/lib/typescript/radio/types.d.ts +0 -11
- package/lib/typescript/radio/types.d.ts.map +1 -1
- package/lib/typescript/radio/useRadioRoot.d.ts +1 -1
- package/lib/typescript/select/SelectContent.d.ts +9 -0
- package/lib/typescript/select/SelectContent.d.ts.map +1 -0
- package/lib/typescript/select/SelectItem.d.ts +8 -0
- package/lib/typescript/select/SelectItem.d.ts.map +1 -0
- package/lib/typescript/select/SelectRoot.d.ts +8 -0
- package/lib/typescript/select/SelectRoot.d.ts.map +1 -0
- package/lib/typescript/select/SelectTrigger.d.ts +9 -0
- package/lib/typescript/select/SelectTrigger.d.ts.map +1 -0
- package/lib/typescript/select/SelectTrigger.web.d.ts +13 -0
- package/lib/typescript/select/SelectTrigger.web.d.ts.map +1 -0
- package/lib/typescript/select/context.d.ts +1 -11
- package/lib/typescript/select/context.d.ts.map +1 -1
- package/lib/typescript/select/index.d.ts +6 -12
- package/lib/typescript/select/index.d.ts.map +1 -1
- package/lib/typescript/select/types.d.ts +1 -9
- package/lib/typescript/select/types.d.ts.map +1 -1
- package/lib/typescript/select/useContentFocus.d.ts +1 -1
- package/lib/typescript/select/useSelectTrigger.d.ts +77 -0
- package/lib/typescript/select/useSelectTrigger.d.ts.map +1 -0
- package/lib/typescript/select/useSelectTrigger.web.d.ts +16 -0
- package/lib/typescript/select/useSelectTrigger.web.d.ts.map +1 -0
- package/lib/typescript/slot/index.d.ts +2 -0
- package/lib/typescript/slot/index.d.ts.map +1 -0
- package/lib/typescript/switch/index.d.ts +2 -6
- package/lib/typescript/switch/index.d.ts.map +1 -1
- package/lib/typescript/switch/types.d.ts +35 -6
- package/lib/typescript/switch/types.d.ts.map +1 -1
- package/lib/typescript/switch/useSwitch.d.ts +20 -0
- package/lib/typescript/switch/useSwitch.d.ts.map +1 -0
- package/lib/typescript/tile/TileGroup.d.ts +5 -0
- package/lib/typescript/tile/TileGroup.d.ts.map +1 -0
- package/lib/typescript/tile/TileRoot.d.ts +5 -0
- package/lib/typescript/tile/TileRoot.d.ts.map +1 -0
- package/lib/typescript/tile/index.d.ts +3 -13
- package/lib/typescript/tile/index.d.ts.map +1 -1
- package/lib/typescript/tile/types.d.ts +7 -18
- package/lib/typescript/tile/types.d.ts.map +1 -1
- package/lib/typescript/utils/dataAttributes.d.ts +1 -1
- package/lib/typescript/utils/dataAttributes.d.ts.map +1 -1
- package/lib/typescript/utils/dataAttributes.web.d.ts +16 -0
- package/lib/typescript/utils/dataAttributes.web.d.ts.map +1 -1
- package/lib/typescript/utils/domDataAttributes.d.ts +13 -0
- package/lib/typescript/utils/domDataAttributes.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/CLAUDE.md +64 -12
- package/src/avatar/AvatarRoot.tsx +39 -0
- package/src/avatar/index.ts +3 -43
- package/src/avatar/types.ts +1 -47
- package/src/button/ButtonRoot.tsx +115 -0
- package/src/button/index.ts +3 -0
- package/src/button/types.ts +1 -52
- package/src/checkbox/CheckboxGroup.tsx +50 -0
- package/src/checkbox/CheckboxRoot.tsx +102 -0
- package/src/checkbox/CheckboxRoot.web.tsx +92 -0
- package/src/checkbox/index.ts +4 -42
- package/src/checkbox/types.ts +1 -32
- package/src/chip/ChipRoot.tsx +168 -0
- package/src/chip/context.tsx +4 -0
- package/src/chip/index.ts +3 -18
- package/src/chip/types.ts +3 -6
- package/src/dialog/DialogClose.tsx +26 -0
- package/src/dialog/DialogPopup.tsx +162 -0
- package/src/dialog/DialogRoot.tsx +72 -0
- package/src/dialog/DialogTrigger.tsx +26 -0
- package/src/dialog/index.tsx +5 -86
- package/src/dialog/types.ts +2 -56
- package/src/field/FieldLabel.tsx +43 -0
- package/src/field/FieldLabel.web.tsx +71 -0
- package/src/field/FieldRoot.tsx +39 -0
- package/src/field/index.tsx +3 -68
- package/src/field/types.tsx +0 -34
- package/src/form/FormRoot.tsx +18 -0
- package/src/form/FormRoot.web.tsx +17 -0
- package/src/form/index.tsx +2 -12
- package/src/form/types.tsx +9 -11
- package/src/index.ts +9 -3
- package/src/input/InputField.android.tsx +107 -0
- package/src/input/InputField.tsx +100 -0
- package/src/input/InputField.web.tsx +141 -0
- package/src/input/InputRoot.tsx +104 -0
- package/src/input/index.tsx +4 -38
- package/src/input/types.ts +21 -53
- package/src/link/LinkRoot.tsx +108 -0
- package/src/link/index.tsx +1 -1
- package/src/list-item/ListItemRoot.tsx +183 -0
- package/src/list-item/context.tsx +2 -2
- package/src/list-item/index.ts +2 -79
- package/src/list-item/types.ts +4 -81
- package/src/otp-input/OtpInputField.tsx +122 -0
- package/src/otp-input/index.ts +16 -0
- package/src/otp-input/types.ts +0 -23
- package/src/otp-input/useOtpInput.ts +156 -0
- package/src/overlay/useDismissOverlay.ts +0 -2
- package/src/overlay/useEscapeKey.ts +0 -2
- package/src/progress-bar/ProgressBarIndicator.tsx +34 -0
- package/src/{progress/createProgressRoot.tsx → progress-bar/ProgressBarRoot.tsx} +17 -9
- package/src/progress-bar/index.ts +5 -0
- package/src/{progress → progress-bar}/types.ts +1 -14
- package/src/radio/{createRadioGroup.tsx → RadioGroup.tsx} +31 -13
- package/src/radio/RadioRoot.tsx +98 -0
- package/src/radio/RadioRoot.web.tsx +90 -0
- package/src/radio/index.ts +4 -36
- package/src/radio/types.ts +0 -22
- package/src/select/SelectContent.tsx +120 -0
- package/src/select/SelectItem.tsx +139 -0
- package/src/select/SelectRoot.tsx +154 -0
- package/src/select/SelectTrigger.tsx +82 -0
- package/src/select/SelectTrigger.web.tsx +238 -0
- package/src/select/context.tsx +1 -10
- package/src/select/index.ts +17 -0
- package/src/select/types.ts +1 -32
- package/src/select/useContentFocus.ts +1 -1
- package/src/select/useSelectTrigger.ts +345 -0
- package/src/select/useSelectTrigger.web.ts +267 -0
- package/src/slot/index.ts +1 -0
- package/src/switch/index.ts +7 -16
- package/src/switch/types.ts +35 -10
- package/src/switch/useSwitch.ts +75 -0
- package/src/tile/TileGroup.tsx +137 -0
- package/src/tile/{createTileRoot.tsx → TileRoot.tsx} +58 -45
- package/src/tile/index.ts +2 -72
- package/src/tile/types.ts +7 -39
- package/src/utils/dataAttributes.ts +4 -1
- package/src/utils/dataAttributes.web.ts +24 -0
- package/src/utils/domDataAttributes.ts +31 -0
- package/lib/commonjs/avatar/createAvatarBadge.js +0 -20
- package/lib/commonjs/avatar/createAvatarBadge.js.map +0 -1
- package/lib/commonjs/avatar/createAvatarIcon.js +0 -30
- package/lib/commonjs/avatar/createAvatarIcon.js.map +0 -1
- package/lib/commonjs/avatar/createAvatarImage.js +0 -51
- package/lib/commonjs/avatar/createAvatarImage.js.map +0 -1
- package/lib/commonjs/avatar/createAvatarRoot.js.map +0 -1
- package/lib/commonjs/avatar/createAvatarText.js +0 -50
- package/lib/commonjs/avatar/createAvatarText.js.map +0 -1
- package/lib/commonjs/button/createButtonGroup.js +0 -80
- package/lib/commonjs/button/createButtonGroup.js.map +0 -1
- package/lib/commonjs/button/createButtonIcon.js +0 -18
- package/lib/commonjs/button/createButtonIcon.js.map +0 -1
- package/lib/commonjs/button/createButtonRoot.js.map +0 -1
- package/lib/commonjs/button/createButtonSpinner.js +0 -34
- package/lib/commonjs/button/createButtonSpinner.js.map +0 -1
- package/lib/commonjs/button/createButtonText.js +0 -39
- package/lib/commonjs/button/createButtonText.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxGroup.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxIcon.js +0 -29
- package/lib/commonjs/checkbox/createCheckboxIcon.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxIndicator.js +0 -47
- package/lib/commonjs/checkbox/createCheckboxIndicator.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxLabel.js +0 -46
- package/lib/commonjs/checkbox/createCheckboxLabel.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxRoot.js +0 -99
- package/lib/commonjs/checkbox/createCheckboxRoot.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxRoot.web.js +0 -95
- package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +0 -1
- package/lib/commonjs/chip/createChipRoot.js +0 -132
- package/lib/commonjs/chip/createChipRoot.js.map +0 -1
- package/lib/commonjs/dialog/createDialogClose.js +0 -37
- package/lib/commonjs/dialog/createDialogClose.js.map +0 -1
- package/lib/commonjs/dialog/createDialogContent.js +0 -21
- package/lib/commonjs/dialog/createDialogContent.js.map +0 -1
- package/lib/commonjs/dialog/createDialogDescription.js +0 -30
- package/lib/commonjs/dialog/createDialogDescription.js.map +0 -1
- package/lib/commonjs/dialog/createDialogFooter.js.map +0 -1
- package/lib/commonjs/dialog/createDialogHeader.js +0 -21
- package/lib/commonjs/dialog/createDialogHeader.js.map +0 -1
- package/lib/commonjs/dialog/createDialogPopup.js.map +0 -1
- package/lib/commonjs/dialog/createDialogRoot.js.map +0 -1
- package/lib/commonjs/dialog/createDialogTitle.js +0 -21
- package/lib/commonjs/dialog/createDialogTitle.js.map +0 -1
- package/lib/commonjs/dialog/createDialogTrigger.js +0 -37
- package/lib/commonjs/dialog/createDialogTrigger.js.map +0 -1
- package/lib/commonjs/field/createFieldError.js +0 -41
- package/lib/commonjs/field/createFieldError.js.map +0 -1
- package/lib/commonjs/field/createFieldErrorIcon.js +0 -18
- package/lib/commonjs/field/createFieldErrorIcon.js.map +0 -1
- package/lib/commonjs/field/createFieldErrorText.js +0 -18
- package/lib/commonjs/field/createFieldErrorText.js.map +0 -1
- package/lib/commonjs/field/createFieldHelper.js +0 -41
- package/lib/commonjs/field/createFieldHelper.js.map +0 -1
- package/lib/commonjs/field/createFieldHelperText.js +0 -18
- package/lib/commonjs/field/createFieldHelperText.js.map +0 -1
- package/lib/commonjs/field/createFieldLabel.js +0 -36
- package/lib/commonjs/field/createFieldLabel.js.map +0 -1
- package/lib/commonjs/field/createFieldRoot.js +0 -35
- package/lib/commonjs/field/createFieldRoot.js.map +0 -1
- package/lib/commonjs/form/createFormRoot.js +0 -21
- package/lib/commonjs/form/createFormRoot.js.map +0 -1
- package/lib/commonjs/input/createInputField.js.map +0 -1
- package/lib/commonjs/input/createInputRoot.js.map +0 -1
- package/lib/commonjs/input/createInputSlot.js +0 -44
- package/lib/commonjs/input/createInputSlot.js.map +0 -1
- package/lib/commonjs/link/createLink.js.map +0 -1
- package/lib/commonjs/list-item/createListItemContent.js +0 -30
- package/lib/commonjs/list-item/createListItemContent.js.map +0 -1
- package/lib/commonjs/list-item/createListItemDescription.js +0 -25
- package/lib/commonjs/list-item/createListItemDescription.js.map +0 -1
- package/lib/commonjs/list-item/createListItemLeadingSlot.js +0 -34
- package/lib/commonjs/list-item/createListItemLeadingSlot.js.map +0 -1
- package/lib/commonjs/list-item/createListItemMeta.js +0 -25
- package/lib/commonjs/list-item/createListItemMeta.js.map +0 -1
- package/lib/commonjs/list-item/createListItemRoot.js.map +0 -1
- package/lib/commonjs/list-item/createListItemSectionHeader.js +0 -54
- package/lib/commonjs/list-item/createListItemSectionHeader.js.map +0 -1
- package/lib/commonjs/list-item/createListItemTitle.js +0 -25
- package/lib/commonjs/list-item/createListItemTitle.js.map +0 -1
- package/lib/commonjs/list-item/createListItemTrailingSlot.js +0 -28
- package/lib/commonjs/list-item/createListItemTrailingSlot.js.map +0 -1
- package/lib/commonjs/otp-input/createOtpInputCell.js +0 -29
- package/lib/commonjs/otp-input/createOtpInputCell.js.map +0 -1
- package/lib/commonjs/otp-input/createOtpInputField.js.map +0 -1
- package/lib/commonjs/otp-input/createOtpInputRoot.js.map +0 -1
- package/lib/commonjs/progress/context.js.map +0 -1
- package/lib/commonjs/progress/createProgressIndicator.js.map +0 -1
- package/lib/commonjs/progress/createProgressRoot.js.map +0 -1
- package/lib/commonjs/progress/index.js +0 -25
- package/lib/commonjs/progress/index.js.map +0 -1
- package/lib/commonjs/radio/createRadioGroup.js.map +0 -1
- package/lib/commonjs/radio/createRadioIndicator.js +0 -43
- package/lib/commonjs/radio/createRadioIndicator.js.map +0 -1
- package/lib/commonjs/radio/createRadioLabel.js +0 -38
- package/lib/commonjs/radio/createRadioLabel.js.map +0 -1
- package/lib/commonjs/radio/createRadioRoot.js +0 -95
- package/lib/commonjs/radio/createRadioRoot.js.map +0 -1
- package/lib/commonjs/radio/createRadioRoot.web.js +0 -87
- package/lib/commonjs/radio/createRadioRoot.web.js.map +0 -1
- package/lib/commonjs/select/createSelectContent.js.map +0 -1
- package/lib/commonjs/select/createSelectIcon.js +0 -43
- package/lib/commonjs/select/createSelectIcon.js.map +0 -1
- package/lib/commonjs/select/createSelectItem.js.map +0 -1
- package/lib/commonjs/select/createSelectItemLabel.js +0 -41
- package/lib/commonjs/select/createSelectItemLabel.js.map +0 -1
- package/lib/commonjs/select/createSelectRoot.js.map +0 -1
- package/lib/commonjs/select/createSelectTrigger.js +0 -192
- package/lib/commonjs/select/createSelectTrigger.js.map +0 -1
- package/lib/commonjs/select/createSelectValue.js +0 -53
- package/lib/commonjs/select/createSelectValue.js.map +0 -1
- package/lib/commonjs/switch/createSwitchRoot.js +0 -73
- package/lib/commonjs/switch/createSwitchRoot.js.map +0 -1
- package/lib/commonjs/tile/createTileContent.js +0 -30
- package/lib/commonjs/tile/createTileContent.js.map +0 -1
- package/lib/commonjs/tile/createTileDescription.js +0 -28
- package/lib/commonjs/tile/createTileDescription.js.map +0 -1
- package/lib/commonjs/tile/createTileGroup.js.map +0 -1
- package/lib/commonjs/tile/createTileIndicator.js +0 -46
- package/lib/commonjs/tile/createTileIndicator.js.map +0 -1
- package/lib/commonjs/tile/createTileLeadingSlot.js +0 -34
- package/lib/commonjs/tile/createTileLeadingSlot.js.map +0 -1
- package/lib/commonjs/tile/createTileRoot.js +0 -133
- package/lib/commonjs/tile/createTileRoot.js.map +0 -1
- package/lib/commonjs/tile/createTileTitle.js +0 -28
- package/lib/commonjs/tile/createTileTitle.js.map +0 -1
- package/lib/commonjs/tile/createTileTrailingSlot.js +0 -35
- package/lib/commonjs/tile/createTileTrailingSlot.js.map +0 -1
- package/lib/module/avatar/createAvatarBadge.js +0 -15
- package/lib/module/avatar/createAvatarBadge.js.map +0 -1
- package/lib/module/avatar/createAvatarIcon.js +0 -25
- package/lib/module/avatar/createAvatarIcon.js.map +0 -1
- package/lib/module/avatar/createAvatarImage.js +0 -46
- package/lib/module/avatar/createAvatarImage.js.map +0 -1
- package/lib/module/avatar/createAvatarRoot.js.map +0 -1
- package/lib/module/avatar/createAvatarText.js +0 -45
- package/lib/module/avatar/createAvatarText.js.map +0 -1
- package/lib/module/button/createButtonGroup.js +0 -74
- package/lib/module/button/createButtonGroup.js.map +0 -1
- package/lib/module/button/createButtonIcon.js +0 -13
- package/lib/module/button/createButtonIcon.js.map +0 -1
- package/lib/module/button/createButtonRoot.js.map +0 -1
- package/lib/module/button/createButtonSpinner.js +0 -29
- package/lib/module/button/createButtonSpinner.js.map +0 -1
- package/lib/module/button/createButtonText.js +0 -34
- package/lib/module/button/createButtonText.js.map +0 -1
- package/lib/module/checkbox/createCheckboxGroup.js.map +0 -1
- package/lib/module/checkbox/createCheckboxIcon.js +0 -24
- package/lib/module/checkbox/createCheckboxIcon.js.map +0 -1
- package/lib/module/checkbox/createCheckboxIndicator.js +0 -42
- package/lib/module/checkbox/createCheckboxIndicator.js.map +0 -1
- package/lib/module/checkbox/createCheckboxLabel.js +0 -41
- package/lib/module/checkbox/createCheckboxLabel.js.map +0 -1
- package/lib/module/checkbox/createCheckboxRoot.js +0 -94
- package/lib/module/checkbox/createCheckboxRoot.js.map +0 -1
- package/lib/module/checkbox/createCheckboxRoot.web.js +0 -91
- package/lib/module/checkbox/createCheckboxRoot.web.js.map +0 -1
- package/lib/module/chip/createChipRoot.js +0 -126
- package/lib/module/chip/createChipRoot.js.map +0 -1
- package/lib/module/dialog/createDialogClose.js +0 -31
- package/lib/module/dialog/createDialogClose.js.map +0 -1
- package/lib/module/dialog/createDialogContent.js +0 -15
- package/lib/module/dialog/createDialogContent.js.map +0 -1
- package/lib/module/dialog/createDialogDescription.js +0 -24
- package/lib/module/dialog/createDialogDescription.js.map +0 -1
- package/lib/module/dialog/createDialogFooter.js +0 -15
- package/lib/module/dialog/createDialogFooter.js.map +0 -1
- package/lib/module/dialog/createDialogHeader.js +0 -15
- package/lib/module/dialog/createDialogHeader.js.map +0 -1
- package/lib/module/dialog/createDialogPopup.js.map +0 -1
- package/lib/module/dialog/createDialogRoot.js.map +0 -1
- package/lib/module/dialog/createDialogTitle.js +0 -15
- package/lib/module/dialog/createDialogTitle.js.map +0 -1
- package/lib/module/dialog/createDialogTrigger.js +0 -31
- package/lib/module/dialog/createDialogTrigger.js.map +0 -1
- package/lib/module/field/createFieldError.js +0 -35
- package/lib/module/field/createFieldError.js.map +0 -1
- package/lib/module/field/createFieldErrorIcon.js +0 -13
- package/lib/module/field/createFieldErrorIcon.js.map +0 -1
- package/lib/module/field/createFieldErrorText.js +0 -13
- package/lib/module/field/createFieldErrorText.js.map +0 -1
- package/lib/module/field/createFieldHelper.js +0 -35
- package/lib/module/field/createFieldHelper.js.map +0 -1
- package/lib/module/field/createFieldHelperText.js +0 -13
- package/lib/module/field/createFieldHelperText.js.map +0 -1
- package/lib/module/field/createFieldLabel.js +0 -31
- package/lib/module/field/createFieldLabel.js.map +0 -1
- package/lib/module/field/createFieldRoot.js +0 -29
- package/lib/module/field/createFieldRoot.js.map +0 -1
- package/lib/module/form/createFormRoot.js +0 -15
- package/lib/module/form/createFormRoot.js.map +0 -1
- package/lib/module/input/createInputField.js.map +0 -1
- package/lib/module/input/createInputRoot.js.map +0 -1
- package/lib/module/input/createInputSlot.js +0 -39
- package/lib/module/input/createInputSlot.js.map +0 -1
- package/lib/module/link/createLink.js.map +0 -1
- package/lib/module/list-item/createListItemContent.js +0 -24
- package/lib/module/list-item/createListItemContent.js.map +0 -1
- package/lib/module/list-item/createListItemDescription.js +0 -19
- package/lib/module/list-item/createListItemDescription.js.map +0 -1
- package/lib/module/list-item/createListItemLeadingSlot.js +0 -28
- package/lib/module/list-item/createListItemLeadingSlot.js.map +0 -1
- package/lib/module/list-item/createListItemMeta.js +0 -19
- package/lib/module/list-item/createListItemMeta.js.map +0 -1
- package/lib/module/list-item/createListItemRoot.js.map +0 -1
- package/lib/module/list-item/createListItemSectionHeader.js +0 -48
- package/lib/module/list-item/createListItemSectionHeader.js.map +0 -1
- package/lib/module/list-item/createListItemTitle.js +0 -19
- package/lib/module/list-item/createListItemTitle.js.map +0 -1
- package/lib/module/list-item/createListItemTrailingSlot.js +0 -22
- package/lib/module/list-item/createListItemTrailingSlot.js.map +0 -1
- package/lib/module/otp-input/createOtpInputCell.js +0 -24
- package/lib/module/otp-input/createOtpInputCell.js.map +0 -1
- package/lib/module/otp-input/createOtpInputField.js.map +0 -1
- package/lib/module/otp-input/createOtpInputRoot.js.map +0 -1
- package/lib/module/progress/context.js.map +0 -1
- package/lib/module/progress/createProgressIndicator.js.map +0 -1
- package/lib/module/progress/createProgressRoot.js.map +0 -1
- package/lib/module/progress/index.js +0 -15
- package/lib/module/progress/index.js.map +0 -1
- package/lib/module/radio/createRadioGroup.js.map +0 -1
- package/lib/module/radio/createRadioIndicator.js +0 -38
- package/lib/module/radio/createRadioIndicator.js.map +0 -1
- package/lib/module/radio/createRadioLabel.js +0 -33
- package/lib/module/radio/createRadioLabel.js.map +0 -1
- package/lib/module/radio/createRadioRoot.js +0 -90
- package/lib/module/radio/createRadioRoot.js.map +0 -1
- package/lib/module/radio/createRadioRoot.web.js +0 -82
- package/lib/module/radio/createRadioRoot.web.js.map +0 -1
- package/lib/module/select/createSelectContent.js.map +0 -1
- package/lib/module/select/createSelectIcon.js +0 -38
- package/lib/module/select/createSelectIcon.js.map +0 -1
- package/lib/module/select/createSelectItem.js.map +0 -1
- package/lib/module/select/createSelectItemLabel.js +0 -36
- package/lib/module/select/createSelectItemLabel.js.map +0 -1
- package/lib/module/select/createSelectRoot.js.map +0 -1
- package/lib/module/select/createSelectTrigger.js +0 -187
- package/lib/module/select/createSelectTrigger.js.map +0 -1
- package/lib/module/select/createSelectValue.js +0 -48
- package/lib/module/select/createSelectValue.js.map +0 -1
- package/lib/module/switch/createSwitchRoot.js +0 -67
- package/lib/module/switch/createSwitchRoot.js.map +0 -1
- package/lib/module/tile/createTileContent.js +0 -24
- package/lib/module/tile/createTileContent.js.map +0 -1
- package/lib/module/tile/createTileDescription.js +0 -22
- package/lib/module/tile/createTileDescription.js.map +0 -1
- package/lib/module/tile/createTileGroup.js.map +0 -1
- package/lib/module/tile/createTileIndicator.js +0 -40
- package/lib/module/tile/createTileIndicator.js.map +0 -1
- package/lib/module/tile/createTileLeadingSlot.js +0 -28
- package/lib/module/tile/createTileLeadingSlot.js.map +0 -1
- package/lib/module/tile/createTileRoot.js.map +0 -1
- package/lib/module/tile/createTileTitle.js +0 -22
- package/lib/module/tile/createTileTitle.js.map +0 -1
- package/lib/module/tile/createTileTrailingSlot.js +0 -29
- package/lib/module/tile/createTileTrailingSlot.js.map +0 -1
- package/lib/typescript/avatar/createAvatarBadge.d.ts +0 -4
- package/lib/typescript/avatar/createAvatarBadge.d.ts.map +0 -1
- package/lib/typescript/avatar/createAvatarIcon.d.ts +0 -4
- package/lib/typescript/avatar/createAvatarIcon.d.ts.map +0 -1
- package/lib/typescript/avatar/createAvatarImage.d.ts +0 -4
- package/lib/typescript/avatar/createAvatarImage.d.ts.map +0 -1
- package/lib/typescript/avatar/createAvatarRoot.d.ts +0 -4
- package/lib/typescript/avatar/createAvatarRoot.d.ts.map +0 -1
- package/lib/typescript/avatar/createAvatarText.d.ts +0 -4
- package/lib/typescript/avatar/createAvatarText.d.ts.map +0 -1
- package/lib/typescript/button/createButtonGroup.d.ts +0 -4
- package/lib/typescript/button/createButtonGroup.d.ts.map +0 -1
- package/lib/typescript/button/createButtonIcon.d.ts +0 -2
- package/lib/typescript/button/createButtonIcon.d.ts.map +0 -1
- package/lib/typescript/button/createButtonRoot.d.ts +0 -6
- package/lib/typescript/button/createButtonRoot.d.ts.map +0 -1
- package/lib/typescript/button/createButtonSpinner.d.ts +0 -4
- package/lib/typescript/button/createButtonSpinner.d.ts.map +0 -1
- package/lib/typescript/button/createButtonText.d.ts +0 -4
- package/lib/typescript/button/createButtonText.d.ts.map +0 -1
- package/lib/typescript/checkbox/createCheckboxGroup.d.ts +0 -3
- package/lib/typescript/checkbox/createCheckboxGroup.d.ts.map +0 -1
- package/lib/typescript/checkbox/createCheckboxIcon.d.ts +0 -3
- package/lib/typescript/checkbox/createCheckboxIcon.d.ts.map +0 -1
- package/lib/typescript/checkbox/createCheckboxIndicator.d.ts +0 -5
- package/lib/typescript/checkbox/createCheckboxIndicator.d.ts.map +0 -1
- package/lib/typescript/checkbox/createCheckboxLabel.d.ts +0 -5
- package/lib/typescript/checkbox/createCheckboxLabel.d.ts.map +0 -1
- package/lib/typescript/checkbox/createCheckboxRoot.d.ts +0 -2
- package/lib/typescript/checkbox/createCheckboxRoot.d.ts.map +0 -1
- package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts +0 -6
- package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +0 -1
- package/lib/typescript/chip/createChipRoot.d.ts +0 -4
- package/lib/typescript/chip/createChipRoot.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogClose.d.ts +0 -4
- package/lib/typescript/dialog/createDialogClose.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogContent.d.ts +0 -4
- package/lib/typescript/dialog/createDialogContent.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogDescription.d.ts +0 -4
- package/lib/typescript/dialog/createDialogDescription.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogFooter.d.ts +0 -4
- package/lib/typescript/dialog/createDialogFooter.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogHeader.d.ts +0 -4
- package/lib/typescript/dialog/createDialogHeader.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogPopup.d.ts +0 -4
- package/lib/typescript/dialog/createDialogPopup.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogRoot.d.ts +0 -4
- package/lib/typescript/dialog/createDialogRoot.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogTitle.d.ts +0 -4
- package/lib/typescript/dialog/createDialogTitle.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogTrigger.d.ts +0 -4
- package/lib/typescript/dialog/createDialogTrigger.d.ts.map +0 -1
- package/lib/typescript/field/createFieldError.d.ts +0 -5
- package/lib/typescript/field/createFieldError.d.ts.map +0 -1
- package/lib/typescript/field/createFieldErrorIcon.d.ts +0 -5
- package/lib/typescript/field/createFieldErrorIcon.d.ts.map +0 -1
- package/lib/typescript/field/createFieldErrorText.d.ts +0 -5
- package/lib/typescript/field/createFieldErrorText.d.ts.map +0 -1
- package/lib/typescript/field/createFieldHelper.d.ts +0 -5
- package/lib/typescript/field/createFieldHelper.d.ts.map +0 -1
- package/lib/typescript/field/createFieldHelperText.d.ts +0 -5
- package/lib/typescript/field/createFieldHelperText.d.ts.map +0 -1
- package/lib/typescript/field/createFieldLabel.d.ts +0 -6
- package/lib/typescript/field/createFieldLabel.d.ts.map +0 -1
- package/lib/typescript/field/createFieldRoot.d.ts +0 -6
- package/lib/typescript/field/createFieldRoot.d.ts.map +0 -1
- package/lib/typescript/form/createFormRoot.d.ts +0 -4
- package/lib/typescript/form/createFormRoot.d.ts.map +0 -1
- package/lib/typescript/input/createInputField.d.ts +0 -4
- package/lib/typescript/input/createInputField.d.ts.map +0 -1
- package/lib/typescript/input/createInputRoot.d.ts +0 -4
- package/lib/typescript/input/createInputRoot.d.ts.map +0 -1
- package/lib/typescript/input/createInputSlot.d.ts +0 -4
- package/lib/typescript/input/createInputSlot.d.ts.map +0 -1
- package/lib/typescript/link/createLink.d.ts +0 -6
- package/lib/typescript/link/createLink.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemContent.d.ts +0 -3
- package/lib/typescript/list-item/createListItemContent.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemDescription.d.ts +0 -3
- package/lib/typescript/list-item/createListItemDescription.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemLeadingSlot.d.ts +0 -4
- package/lib/typescript/list-item/createListItemLeadingSlot.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemMeta.d.ts +0 -3
- package/lib/typescript/list-item/createListItemMeta.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemRoot.d.ts +0 -4
- package/lib/typescript/list-item/createListItemRoot.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemSectionHeader.d.ts +0 -4
- package/lib/typescript/list-item/createListItemSectionHeader.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemTitle.d.ts +0 -3
- package/lib/typescript/list-item/createListItemTitle.d.ts.map +0 -1
- package/lib/typescript/list-item/createListItemTrailingSlot.d.ts +0 -3
- package/lib/typescript/list-item/createListItemTrailingSlot.d.ts.map +0 -1
- package/lib/typescript/otp-input/createOtpInputCell.d.ts +0 -4
- package/lib/typescript/otp-input/createOtpInputCell.d.ts.map +0 -1
- package/lib/typescript/otp-input/createOtpInputField.d.ts +0 -4
- package/lib/typescript/otp-input/createOtpInputField.d.ts.map +0 -1
- package/lib/typescript/otp-input/createOtpInputRoot.d.ts +0 -4
- package/lib/typescript/otp-input/createOtpInputRoot.d.ts.map +0 -1
- package/lib/typescript/progress/context.d.ts.map +0 -1
- package/lib/typescript/progress/createProgressIndicator.d.ts +0 -3
- package/lib/typescript/progress/createProgressIndicator.d.ts.map +0 -1
- package/lib/typescript/progress/createProgressRoot.d.ts +0 -4
- package/lib/typescript/progress/createProgressRoot.d.ts.map +0 -1
- package/lib/typescript/progress/index.d.ts +0 -10
- package/lib/typescript/progress/index.d.ts.map +0 -1
- package/lib/typescript/progress/types.d.ts.map +0 -1
- package/lib/typescript/radio/createRadioGroup.d.ts +0 -3
- package/lib/typescript/radio/createRadioGroup.d.ts.map +0 -1
- package/lib/typescript/radio/createRadioIndicator.d.ts +0 -5
- package/lib/typescript/radio/createRadioIndicator.d.ts.map +0 -1
- package/lib/typescript/radio/createRadioLabel.d.ts +0 -5
- package/lib/typescript/radio/createRadioLabel.d.ts.map +0 -1
- package/lib/typescript/radio/createRadioRoot.d.ts +0 -3
- package/lib/typescript/radio/createRadioRoot.d.ts.map +0 -1
- package/lib/typescript/radio/createRadioRoot.web.d.ts +0 -3
- package/lib/typescript/radio/createRadioRoot.web.d.ts.map +0 -1
- package/lib/typescript/select/createSelectContent.d.ts +0 -4
- package/lib/typescript/select/createSelectContent.d.ts.map +0 -1
- package/lib/typescript/select/createSelectIcon.d.ts +0 -2
- package/lib/typescript/select/createSelectIcon.d.ts.map +0 -1
- package/lib/typescript/select/createSelectItem.d.ts +0 -6
- package/lib/typescript/select/createSelectItem.d.ts.map +0 -1
- package/lib/typescript/select/createSelectItemLabel.d.ts +0 -4
- package/lib/typescript/select/createSelectItemLabel.d.ts.map +0 -1
- package/lib/typescript/select/createSelectRoot.d.ts +0 -4
- package/lib/typescript/select/createSelectRoot.d.ts.map +0 -1
- package/lib/typescript/select/createSelectTrigger.d.ts +0 -7
- package/lib/typescript/select/createSelectTrigger.d.ts.map +0 -1
- package/lib/typescript/select/createSelectValue.d.ts +0 -4
- package/lib/typescript/select/createSelectValue.d.ts.map +0 -1
- package/lib/typescript/switch/createSwitchRoot.d.ts +0 -3
- package/lib/typescript/switch/createSwitchRoot.d.ts.map +0 -1
- package/lib/typescript/tile/createTileContent.d.ts +0 -3
- package/lib/typescript/tile/createTileContent.d.ts.map +0 -1
- package/lib/typescript/tile/createTileDescription.d.ts +0 -3
- package/lib/typescript/tile/createTileDescription.d.ts.map +0 -1
- package/lib/typescript/tile/createTileGroup.d.ts +0 -4
- package/lib/typescript/tile/createTileGroup.d.ts.map +0 -1
- package/lib/typescript/tile/createTileIndicator.d.ts +0 -4
- package/lib/typescript/tile/createTileIndicator.d.ts.map +0 -1
- package/lib/typescript/tile/createTileLeadingSlot.d.ts +0 -4
- package/lib/typescript/tile/createTileLeadingSlot.d.ts.map +0 -1
- package/lib/typescript/tile/createTileRoot.d.ts +0 -4
- package/lib/typescript/tile/createTileRoot.d.ts.map +0 -1
- package/lib/typescript/tile/createTileTitle.d.ts +0 -3
- package/lib/typescript/tile/createTileTitle.d.ts.map +0 -1
- package/lib/typescript/tile/createTileTrailingSlot.d.ts +0 -9
- package/lib/typescript/tile/createTileTrailingSlot.d.ts.map +0 -1
- package/src/avatar/createAvatarBadge.tsx +0 -12
- package/src/avatar/createAvatarIcon.tsx +0 -16
- package/src/avatar/createAvatarImage.tsx +0 -40
- package/src/avatar/createAvatarRoot.tsx +0 -23
- package/src/avatar/createAvatarText.tsx +0 -39
- package/src/button/createButtonGroup.tsx +0 -88
- package/src/button/createButtonIcon.tsx +0 -8
- package/src/button/createButtonRoot.tsx +0 -102
- package/src/button/createButtonSpinner.tsx +0 -20
- package/src/button/createButtonText.tsx +0 -23
- package/src/button/index.tsx +0 -53
- package/src/checkbox/createCheckboxGroup.tsx +0 -32
- package/src/checkbox/createCheckboxIcon.tsx +0 -18
- package/src/checkbox/createCheckboxIndicator.tsx +0 -43
- package/src/checkbox/createCheckboxLabel.tsx +0 -42
- package/src/checkbox/createCheckboxRoot.tsx +0 -100
- package/src/checkbox/createCheckboxRoot.web.tsx +0 -83
- package/src/chip/createChipRoot.tsx +0 -144
- package/src/dialog/createDialogClose.tsx +0 -27
- package/src/dialog/createDialogContent.tsx +0 -11
- package/src/dialog/createDialogDescription.tsx +0 -20
- package/src/dialog/createDialogFooter.tsx +0 -11
- package/src/dialog/createDialogHeader.tsx +0 -11
- package/src/dialog/createDialogPopup.tsx +0 -146
- package/src/dialog/createDialogRoot.tsx +0 -66
- package/src/dialog/createDialogTitle.tsx +0 -11
- package/src/dialog/createDialogTrigger.tsx +0 -27
- package/src/field/createFieldError.tsx +0 -32
- package/src/field/createFieldErrorIcon.tsx +0 -9
- package/src/field/createFieldErrorText.tsx +0 -9
- package/src/field/createFieldHelper.tsx +0 -28
- package/src/field/createFieldHelperText.tsx +0 -9
- package/src/field/createFieldLabel.tsx +0 -33
- package/src/field/createFieldRoot.tsx +0 -27
- package/src/form/createFormRoot.tsx +0 -13
- package/src/input/createInputField.tsx +0 -120
- package/src/input/createInputRoot.tsx +0 -92
- package/src/input/createInputSlot.tsx +0 -39
- package/src/link/createLink.tsx +0 -89
- package/src/list-item/createListItemContent.tsx +0 -23
- package/src/list-item/createListItemDescription.tsx +0 -19
- package/src/list-item/createListItemLeadingSlot.tsx +0 -30
- package/src/list-item/createListItemMeta.tsx +0 -17
- package/src/list-item/createListItemRoot.tsx +0 -195
- package/src/list-item/createListItemSectionHeader.tsx +0 -53
- package/src/list-item/createListItemTitle.tsx +0 -17
- package/src/list-item/createListItemTrailingSlot.tsx +0 -21
- package/src/otp-input/createOtpInputCell.tsx +0 -22
- package/src/otp-input/createOtpInputField.tsx +0 -98
- package/src/otp-input/createOtpInputRoot.tsx +0 -179
- package/src/otp-input/index.tsx +0 -34
- package/src/progress/createProgressIndicator.tsx +0 -35
- package/src/progress/index.ts +0 -28
- package/src/radio/createRadioIndicator.tsx +0 -32
- package/src/radio/createRadioLabel.tsx +0 -28
- package/src/radio/createRadioRoot.tsx +0 -100
- package/src/radio/createRadioRoot.web.tsx +0 -81
- package/src/select/createSelectContent.tsx +0 -115
- package/src/select/createSelectIcon.tsx +0 -28
- package/src/select/createSelectItem.tsx +0 -121
- package/src/select/createSelectItemLabel.tsx +0 -30
- package/src/select/createSelectRoot.tsx +0 -134
- package/src/select/createSelectTrigger.tsx +0 -241
- package/src/select/createSelectValue.tsx +0 -38
- package/src/select/index.tsx +0 -73
- package/src/switch/createSwitchRoot.tsx +0 -72
- package/src/tile/createTileContent.tsx +0 -23
- package/src/tile/createTileDescription.tsx +0 -19
- package/src/tile/createTileGroup.tsx +0 -134
- package/src/tile/createTileIndicator.tsx +0 -38
- package/src/tile/createTileLeadingSlot.tsx +0 -30
- package/src/tile/createTileTitle.tsx +0 -19
- package/src/tile/createTileTrailingSlot.tsx +0 -25
- /package/lib/commonjs/{progress → progress-bar}/context.js +0 -0
- /package/lib/commonjs/{progress → progress-bar}/types.js +0 -0
- /package/lib/module/{progress → progress-bar}/context.js +0 -0
- /package/lib/module/{progress → progress-bar}/types.js +0 -0
- /package/lib/typescript/{progress → progress-bar}/context.d.ts +0 -0
- /package/src/{progress → progress-bar}/context.tsx +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { forwardRef, useMemo, useState } from 'react';
|
|
3
|
+
import { View, type ViewProps } from 'react-native';
|
|
4
|
+
import { Slot } from '../slot';
|
|
5
|
+
import { AvatarProvider } from './context';
|
|
6
|
+
import type { IAvatarProps, IAvatarContextValue } from './types';
|
|
7
|
+
|
|
8
|
+
export interface AvatarRootProps extends IAvatarProps {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const AvatarRoot = forwardRef<React.ComponentRef<typeof View>, AvatarRootProps>(
|
|
13
|
+
({ asChild, children, ...props }, ref) => {
|
|
14
|
+
const [imageLoaded, setImageLoaded] = useState(false);
|
|
15
|
+
const [imageError, setImageError] = useState(false);
|
|
16
|
+
|
|
17
|
+
const contextValue = useMemo<IAvatarContextValue>(
|
|
18
|
+
() => ({ imageLoaded, imageError, setImageLoaded, setImageError }),
|
|
19
|
+
[imageLoaded, imageError],
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const Comp = asChild ? Slot : View;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<AvatarProvider value={contextValue}>
|
|
26
|
+
<Comp
|
|
27
|
+
ref={ref}
|
|
28
|
+
role={props.role || 'img'}
|
|
29
|
+
accessibilityRole="image"
|
|
30
|
+
{...(props as ViewProps)}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</Comp>
|
|
34
|
+
</AvatarProvider>
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
AvatarRoot.displayName = 'AvatarRoot';
|
package/src/avatar/index.ts
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { createAvatarText } from './createAvatarText';
|
|
5
|
-
import { createAvatarImage } from './createAvatarImage';
|
|
6
|
-
import { createAvatarRoot } from './createAvatarRoot';
|
|
7
|
-
import type { IAvatarComponentType } from './types';
|
|
8
|
-
|
|
9
|
-
export type {
|
|
10
|
-
IAvatarBadgeProps,
|
|
11
|
-
IAvatarComponentType,
|
|
12
|
-
IAvatarIconProps,
|
|
13
|
-
IAvatarTextProps,
|
|
14
|
-
IAvatarImageProps,
|
|
15
|
-
IAvatarProps,
|
|
16
|
-
} from './types';
|
|
17
|
-
|
|
18
|
-
export function createAvatar<Root, Image, Text, Icon, Badge>(BaseComponents: {
|
|
19
|
-
Root: React.ComponentType<Root>;
|
|
20
|
-
Image: React.ComponentType<Image>;
|
|
21
|
-
Text: React.ComponentType<Text>;
|
|
22
|
-
Icon: React.ComponentType<Icon>;
|
|
23
|
-
Badge: React.ComponentType<Badge>;
|
|
24
|
-
}) {
|
|
25
|
-
const Avatar = createAvatarRoot(BaseComponents.Root);
|
|
26
|
-
const AvatarImage = createAvatarImage(BaseComponents.Image);
|
|
27
|
-
const Text = createAvatarText(BaseComponents.Text);
|
|
28
|
-
const AvatarIcon = createAvatarIcon(BaseComponents.Icon);
|
|
29
|
-
const Badge = createAvatarBadge(BaseComponents.Badge);
|
|
30
|
-
|
|
31
|
-
Avatar.displayName = 'AvatarPrimitive';
|
|
32
|
-
AvatarImage.displayName = 'AvatarPrimitive.Image';
|
|
33
|
-
Text.displayName = 'AvatarPrimitive.Text';
|
|
34
|
-
AvatarIcon.displayName = 'AvatarPrimitive.Icon';
|
|
35
|
-
Badge.displayName = 'AvatarPrimitive.Badge';
|
|
36
|
-
|
|
37
|
-
return Object.assign(Avatar, {
|
|
38
|
-
Image: AvatarImage,
|
|
39
|
-
Text,
|
|
40
|
-
Icon: AvatarIcon,
|
|
41
|
-
Badge,
|
|
42
|
-
}) as unknown as IAvatarComponentType<Root, Image, Text, Icon, Badge>;
|
|
43
|
-
}
|
|
1
|
+
export type { IAvatarContextValue, IAvatarImageProps, IAvatarProps } from './types';
|
|
2
|
+
export { useAvatarContext } from './context';
|
|
3
|
+
export { AvatarRoot, type AvatarRootProps } from './AvatarRoot';
|
package/src/avatar/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ImageProps,
|
|
1
|
+
import type { ImageProps, ViewProps } from 'react-native';
|
|
2
2
|
|
|
3
3
|
// =============================================================================
|
|
4
4
|
// AVATAR ROOT
|
|
@@ -19,31 +19,6 @@ export interface IAvatarImageProps extends Omit<ImageProps, 'source'> {
|
|
|
19
19
|
alt?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// =============================================================================
|
|
23
|
-
// AVATAR FALLBACK TEXT
|
|
24
|
-
// =============================================================================
|
|
25
|
-
|
|
26
|
-
export interface IAvatarTextProps extends TextProps {
|
|
27
|
-
/** Full name — initials will be derived automatically */
|
|
28
|
-
children?: React.ReactNode;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// =============================================================================
|
|
32
|
-
// AVATAR ICON (fallback icon — hidden when image loads)
|
|
33
|
-
// =============================================================================
|
|
34
|
-
|
|
35
|
-
export interface IAvatarIconProps extends ViewProps {
|
|
36
|
-
children?: React.ReactNode;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// =============================================================================
|
|
40
|
-
// AVATAR BADGE
|
|
41
|
-
// =============================================================================
|
|
42
|
-
|
|
43
|
-
export interface IAvatarBadgeProps extends ViewProps {
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
22
|
// =============================================================================
|
|
48
23
|
// CONTEXT
|
|
49
24
|
// =============================================================================
|
|
@@ -54,24 +29,3 @@ export interface IAvatarContextValue {
|
|
|
54
29
|
setImageLoaded: (loaded: boolean) => void;
|
|
55
30
|
setImageError: (error: boolean) => void;
|
|
56
31
|
}
|
|
57
|
-
|
|
58
|
-
// =============================================================================
|
|
59
|
-
// COMPOUND COMPONENT TYPE
|
|
60
|
-
// =============================================================================
|
|
61
|
-
|
|
62
|
-
export type IAvatarComponentType<Root, Image, Text, Icon, Badge> = React.ForwardRefExoticComponent<
|
|
63
|
-
React.RefAttributes<Root> & React.PropsWithoutRef<Root> & IAvatarProps
|
|
64
|
-
> & {
|
|
65
|
-
Image: React.ForwardRefExoticComponent<
|
|
66
|
-
React.RefAttributes<Image> & React.PropsWithoutRef<Image> & IAvatarImageProps
|
|
67
|
-
>;
|
|
68
|
-
Text: React.ForwardRefExoticComponent<
|
|
69
|
-
React.RefAttributes<Text> & React.PropsWithoutRef<Text> & IAvatarTextProps
|
|
70
|
-
>;
|
|
71
|
-
Icon: React.ForwardRefExoticComponent<
|
|
72
|
-
React.RefAttributes<Icon> & React.PropsWithoutRef<Icon> & IAvatarIconProps
|
|
73
|
-
>;
|
|
74
|
-
Badge: React.ForwardRefExoticComponent<
|
|
75
|
-
React.RefAttributes<Badge> & React.PropsWithoutRef<Badge> & IAvatarBadgeProps
|
|
76
|
-
>;
|
|
77
|
-
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
import { Pressable, type PressableProps } from 'react-native';
|
|
4
|
+
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
5
|
+
import { useFocus, useFocusRing } from '@react-native-aria/focus';
|
|
6
|
+
import { useHover, usePress } from '@react-native-aria/interactions';
|
|
7
|
+
import type { InteractionState } from '../types';
|
|
8
|
+
import { Slot } from '../slot';
|
|
9
|
+
import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
|
|
10
|
+
import { ButtonProvider } from './context';
|
|
11
|
+
import type { IButtonProps } from './types';
|
|
12
|
+
|
|
13
|
+
export interface ButtonRootProps extends Omit<IButtonProps, 'children'> {
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
children?: ((state: InteractionState) => React.ReactNode) | React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ButtonRoot = forwardRef<React.ComponentRef<typeof Pressable>, ButtonRootProps>(
|
|
19
|
+
(
|
|
20
|
+
{
|
|
21
|
+
asChild,
|
|
22
|
+
children,
|
|
23
|
+
isDisabled,
|
|
24
|
+
isHovered: isHoveredProp,
|
|
25
|
+
isActive: isActiveProp,
|
|
26
|
+
isFocused: isFocusedProp,
|
|
27
|
+
isFocusVisible: isFocusVisibleProp,
|
|
28
|
+
...props
|
|
29
|
+
},
|
|
30
|
+
ref,
|
|
31
|
+
) => {
|
|
32
|
+
const { isFocused, focusProps } = useFocus();
|
|
33
|
+
const { isFocusVisible, focusProps: focusRingProps } = useFocusRing() as {
|
|
34
|
+
isFocusVisible: boolean;
|
|
35
|
+
focusProps: typeof focusProps;
|
|
36
|
+
};
|
|
37
|
+
const { pressProps: pressableProps, isPressed: isActive } = usePress({
|
|
38
|
+
isDisabled,
|
|
39
|
+
});
|
|
40
|
+
const { isHovered, hoverProps } = useHover();
|
|
41
|
+
|
|
42
|
+
const contextValue = useMemo(() => {
|
|
43
|
+
return {
|
|
44
|
+
hover: isHoveredProp || isHovered,
|
|
45
|
+
focus: isFocusedProp || isFocused,
|
|
46
|
+
active: isActiveProp || isActive,
|
|
47
|
+
disabled: !!isDisabled,
|
|
48
|
+
focusVisible: isFocusVisibleProp || isFocusVisible,
|
|
49
|
+
};
|
|
50
|
+
}, [
|
|
51
|
+
isHovered,
|
|
52
|
+
isHoveredProp,
|
|
53
|
+
isFocused,
|
|
54
|
+
isFocusedProp,
|
|
55
|
+
isActive,
|
|
56
|
+
isActiveProp,
|
|
57
|
+
isDisabled,
|
|
58
|
+
isFocusVisible,
|
|
59
|
+
isFocusVisibleProp,
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
const Comp = asChild ? Slot : Pressable;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<ButtonProvider value={contextValue}>
|
|
66
|
+
<Comp
|
|
67
|
+
ref={ref}
|
|
68
|
+
role={props?.role || 'button'}
|
|
69
|
+
disabled={isDisabled}
|
|
70
|
+
{...(props as PressableProps)}
|
|
71
|
+
{...mergeDataAttributes(
|
|
72
|
+
props,
|
|
73
|
+
dataAttributes({
|
|
74
|
+
hover: isHoveredProp || isHovered,
|
|
75
|
+
focus: isFocusedProp || isFocused,
|
|
76
|
+
active: isActiveProp || isActive,
|
|
77
|
+
disabled: !!isDisabled,
|
|
78
|
+
focusVisible: isFocusVisibleProp || isFocusVisible,
|
|
79
|
+
}),
|
|
80
|
+
)}
|
|
81
|
+
onPressIn={composeEventHandlers(props?.onPressIn, pressableProps.onPressIn)}
|
|
82
|
+
onPressOut={composeEventHandlers(props?.onPressOut, pressableProps.onPressOut)}
|
|
83
|
+
onHoverIn={composeEventHandlers(props?.onHoverIn, hoverProps.onHoverIn)}
|
|
84
|
+
onHoverOut={composeEventHandlers(props?.onHoverOut, hoverProps.onHoverOut)}
|
|
85
|
+
onFocus={composeEventHandlers(
|
|
86
|
+
composeEventHandlers(
|
|
87
|
+
props?.onFocus as (...args: unknown[]) => unknown,
|
|
88
|
+
focusProps.onFocus,
|
|
89
|
+
),
|
|
90
|
+
focusRingProps.onFocus,
|
|
91
|
+
)}
|
|
92
|
+
onBlur={composeEventHandlers(
|
|
93
|
+
composeEventHandlers(
|
|
94
|
+
props?.onBlur as (...args: unknown[]) => unknown,
|
|
95
|
+
focusProps.onBlur,
|
|
96
|
+
),
|
|
97
|
+
focusRingProps.onBlur,
|
|
98
|
+
)}
|
|
99
|
+
>
|
|
100
|
+
{typeof children === 'function'
|
|
101
|
+
? children({
|
|
102
|
+
hover: isHoveredProp || isHovered,
|
|
103
|
+
focus: isFocusedProp || isFocused,
|
|
104
|
+
active: isActiveProp || isActive,
|
|
105
|
+
disabled: !!isDisabled,
|
|
106
|
+
focusVisible: isFocusVisibleProp || isFocusVisible,
|
|
107
|
+
})
|
|
108
|
+
: children}
|
|
109
|
+
</Comp>
|
|
110
|
+
</ButtonProvider>
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
ButtonRoot.displayName = 'ButtonRoot';
|
package/src/button/types.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PressableProps, ViewProps } from 'react-native';
|
|
1
|
+
import type { PressableProps } from 'react-native';
|
|
3
2
|
|
|
4
3
|
export interface InterfaceButtonProps extends PressableProps {
|
|
5
4
|
/**
|
|
@@ -24,54 +23,4 @@ export interface InterfaceButtonProps extends PressableProps {
|
|
|
24
23
|
isDisabled?: boolean;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
export interface IButtonGroupProps {
|
|
28
|
-
/**
|
|
29
|
-
* The direction of the Stack Items.
|
|
30
|
-
* @default row
|
|
31
|
-
*/
|
|
32
|
-
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
children: ReactElement | ReactElement[];
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* If true, the button will be disabled.
|
|
40
|
-
*/
|
|
41
|
-
isDisabled?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* If true, button will be atttached together.
|
|
44
|
-
*/
|
|
45
|
-
isAttached?: boolean;
|
|
46
|
-
reversed?: boolean;
|
|
47
|
-
isReversed?: boolean;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export type IButtonComponentType<
|
|
51
|
-
ButtonProps,
|
|
52
|
-
GroupProps,
|
|
53
|
-
SpinnerProps,
|
|
54
|
-
TextProps,
|
|
55
|
-
IconProps,
|
|
56
|
-
ButtonRef = unknown,
|
|
57
|
-
TextRef = unknown,
|
|
58
|
-
> = React.ForwardRefExoticComponent<
|
|
59
|
-
PropsWithoutRef<ButtonProps & IButtonProps> & RefAttributes<ButtonRef>
|
|
60
|
-
> & {
|
|
61
|
-
Group: React.ForwardRefExoticComponent<
|
|
62
|
-
RefAttributes<unknown> & PropsWithoutRef<GroupProps & IButtonGroupProps>
|
|
63
|
-
>;
|
|
64
|
-
Spinner: React.ForwardRefExoticComponent<
|
|
65
|
-
PropsWithoutRef<SpinnerProps> & React.RefAttributes<unknown>
|
|
66
|
-
>;
|
|
67
|
-
Text: React.ForwardRefExoticComponent<React.RefAttributes<TextRef> & PropsWithoutRef<TextProps>>;
|
|
68
|
-
Icon: React.ForwardRefExoticComponent<React.RefAttributes<unknown> & PropsWithoutRef<IconProps>>;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export interface IButtonTextProps extends ViewProps {
|
|
72
|
-
children?: ReactNode;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface IButtonSpinnerProps extends ViewProps {}
|
|
76
|
-
|
|
77
26
|
export type IButtonProps = InterfaceButtonProps;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
import { useFormControlContext } from '@cdx-ui/utils';
|
|
4
|
+
import { useCheckboxGroup } from '@react-native-aria/checkbox';
|
|
5
|
+
import { useCheckboxGroupState } from '@react-stately/checkbox';
|
|
6
|
+
import { Slot } from '../slot';
|
|
7
|
+
import { CheckboxGroupContext } from './context';
|
|
8
|
+
import type { ICheckboxGroupProps } from './types';
|
|
9
|
+
|
|
10
|
+
export interface CheckboxGroupRootProps extends ICheckboxGroupProps {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: ViewProps['style'];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const CheckboxGroup = forwardRef<View, CheckboxGroupRootProps>(
|
|
17
|
+
({ asChild, children, className, style, ...props }, ref) => {
|
|
18
|
+
const state = useCheckboxGroupState({
|
|
19
|
+
...props,
|
|
20
|
+
validationState: props.isInvalid ? 'invalid' : 'valid',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const { groupProps } = useCheckboxGroup(
|
|
24
|
+
{
|
|
25
|
+
...props,
|
|
26
|
+
'aria-label': props['aria-label'],
|
|
27
|
+
},
|
|
28
|
+
state,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const formControlContext = useFormControlContext();
|
|
32
|
+
|
|
33
|
+
const contextValue = useMemo(
|
|
34
|
+
() => ({ state: { ...formControlContext, ...state } }),
|
|
35
|
+
[formControlContext, state],
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const Comp = asChild ? Slot : View;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<CheckboxGroupContext.Provider value={contextValue}>
|
|
42
|
+
<Comp {...groupProps} className={className} style={style} ref={ref}>
|
|
43
|
+
{children}
|
|
44
|
+
</Comp>
|
|
45
|
+
</CheckboxGroupContext.Provider>
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Pressable, type PressableProps } from 'react-native';
|
|
3
|
+
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
4
|
+
import { useFocus } from '@react-native-aria/focus';
|
|
5
|
+
import { usePress } from '@react-native-aria/interactions';
|
|
6
|
+
import { Slot } from '../slot';
|
|
7
|
+
import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
|
|
8
|
+
import { CheckboxProvider } from './context';
|
|
9
|
+
import type { ICheckboxProps, ICheckboxContextValue } from './types';
|
|
10
|
+
import { useCheckboxRoot } from './useCheckboxRoot';
|
|
11
|
+
|
|
12
|
+
export interface CheckboxRootProps extends ICheckboxProps {
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const CheckboxRoot = forwardRef<React.ComponentRef<typeof Pressable>, CheckboxRootProps>(
|
|
17
|
+
(
|
|
18
|
+
{ asChild, onPressIn, onPressOut, onHoverIn, onHoverOut, onFocus, onBlur, children, ...props },
|
|
19
|
+
ref,
|
|
20
|
+
) => {
|
|
21
|
+
const {
|
|
22
|
+
isHovered: isHoveredProp,
|
|
23
|
+
isChecked: isCheckedProp,
|
|
24
|
+
isDisabled: isDisabledProp,
|
|
25
|
+
isInvalid: isInvalidProp,
|
|
26
|
+
isReadOnly: isReadOnlyProp,
|
|
27
|
+
isPressed: isPressedProp,
|
|
28
|
+
isFocused: isFocusedProp,
|
|
29
|
+
isIndeterminate: isIndeterminateProp,
|
|
30
|
+
isFocusVisible: isFocusVisibleProp,
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
combinedProps,
|
|
35
|
+
isInvalid,
|
|
36
|
+
isReadOnly,
|
|
37
|
+
isIndeterminate,
|
|
38
|
+
groupItemInputProps,
|
|
39
|
+
isChecked,
|
|
40
|
+
isDisabled,
|
|
41
|
+
isHovered,
|
|
42
|
+
hoverProps,
|
|
43
|
+
mergedRef,
|
|
44
|
+
} = useCheckboxRoot(props, ref);
|
|
45
|
+
|
|
46
|
+
const { focusProps, isFocused } = useFocus();
|
|
47
|
+
|
|
48
|
+
const { pressProps, isPressed } = usePress({
|
|
49
|
+
isDisabled: isDisabled || isDisabledProp,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const contextValue: ICheckboxContextValue = {
|
|
53
|
+
isChecked: isChecked || isCheckedProp,
|
|
54
|
+
isDisabled: isDisabled || isDisabledProp,
|
|
55
|
+
isHovered: isHovered || isHoveredProp,
|
|
56
|
+
isInvalid: isInvalid || isInvalidProp,
|
|
57
|
+
isReadOnly: isReadOnly || isReadOnlyProp,
|
|
58
|
+
isPressed: isPressed || isPressedProp,
|
|
59
|
+
isFocused: isFocused || isFocusedProp,
|
|
60
|
+
isIndeterminate: isIndeterminate || isIndeterminateProp,
|
|
61
|
+
isFocusVisible: isFocusVisibleProp,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const Comp = asChild ? Slot : Pressable;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<CheckboxProvider value={contextValue}>
|
|
68
|
+
<Comp
|
|
69
|
+
disabled={isDisabled || isDisabledProp}
|
|
70
|
+
{...(combinedProps as PressableProps)}
|
|
71
|
+
{...groupItemInputProps}
|
|
72
|
+
ref={mergedRef}
|
|
73
|
+
role="checkbox"
|
|
74
|
+
{...mergeDataAttributes(
|
|
75
|
+
props,
|
|
76
|
+
dataAttributes({
|
|
77
|
+
checked: isChecked || isCheckedProp,
|
|
78
|
+
disabled: isDisabled || isDisabledProp,
|
|
79
|
+
hover: isHovered || isHoveredProp,
|
|
80
|
+
invalid: isInvalid || isInvalidProp,
|
|
81
|
+
readonly: isReadOnly || isReadOnlyProp,
|
|
82
|
+
active: isPressed,
|
|
83
|
+
focus: isFocused,
|
|
84
|
+
indeterminate: isIndeterminate || isIndeterminateProp,
|
|
85
|
+
focusVisible: isFocusVisibleProp,
|
|
86
|
+
}),
|
|
87
|
+
)}
|
|
88
|
+
onPressIn={composeEventHandlers(onPressIn, pressProps.onPressIn)}
|
|
89
|
+
onPressOut={composeEventHandlers(onPressOut, pressProps.onPressOut)}
|
|
90
|
+
onHoverIn={composeEventHandlers(onHoverIn, hoverProps.onHoverIn)}
|
|
91
|
+
onHoverOut={composeEventHandlers(onHoverOut, hoverProps.onHoverOut)}
|
|
92
|
+
onFocus={composeEventHandlers(composeEventHandlers(onFocus, focusProps.onFocus))}
|
|
93
|
+
onBlur={composeEventHandlers(composeEventHandlers(onBlur, focusProps.onBlur))}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</Comp>
|
|
97
|
+
</CheckboxProvider>
|
|
98
|
+
);
|
|
99
|
+
},
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
CheckboxRoot.displayName = 'CheckboxRoot';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Pressable, type PressableProps } from 'react-native';
|
|
3
|
+
import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
4
|
+
import { useFocusRing } from '@react-native-aria/focus';
|
|
5
|
+
import { Slot } from '../slot';
|
|
6
|
+
import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
|
|
7
|
+
import { CheckboxProvider } from './context';
|
|
8
|
+
import type { ICheckboxProps, ICheckboxContextValue } from './types';
|
|
9
|
+
import { useCheckboxRoot } from './useCheckboxRoot';
|
|
10
|
+
|
|
11
|
+
export interface CheckboxRootProps extends ICheckboxProps {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CheckboxRoot = forwardRef<React.ComponentRef<typeof Pressable>, CheckboxRootProps>(
|
|
16
|
+
({ asChild, children, ...props }, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
isHovered: isHoveredProp,
|
|
19
|
+
isFocusVisible: isFocusVisibleProp,
|
|
20
|
+
isChecked: isCheckedProp,
|
|
21
|
+
isDisabled: isDisabledProp,
|
|
22
|
+
isInvalid: isInvalidProp,
|
|
23
|
+
isReadOnly: isReadOnlyProp,
|
|
24
|
+
isIndeterminate: isIndeterminateProp,
|
|
25
|
+
isFocused,
|
|
26
|
+
isPressed,
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
combinedProps,
|
|
31
|
+
isInvalid,
|
|
32
|
+
isReadOnly,
|
|
33
|
+
isIndeterminate,
|
|
34
|
+
groupItemInputProps,
|
|
35
|
+
isChecked,
|
|
36
|
+
isDisabled,
|
|
37
|
+
isHovered,
|
|
38
|
+
mergedRef,
|
|
39
|
+
inputRef,
|
|
40
|
+
} = useCheckboxRoot(props, ref, { useInputRefForAria: true });
|
|
41
|
+
|
|
42
|
+
const { focusProps, isFocusVisible } = useFocusRing();
|
|
43
|
+
|
|
44
|
+
const contextValue: ICheckboxContextValue = {
|
|
45
|
+
isChecked: isChecked || isCheckedProp,
|
|
46
|
+
isDisabled: isDisabled || isDisabledProp,
|
|
47
|
+
isFocusVisible: isFocusVisible || isFocusVisibleProp,
|
|
48
|
+
isHovered: isHovered || isHoveredProp,
|
|
49
|
+
isInvalid: isInvalid || isInvalidProp,
|
|
50
|
+
isReadOnly: isReadOnly || isReadOnlyProp,
|
|
51
|
+
isIndeterminate: isIndeterminate || isIndeterminateProp,
|
|
52
|
+
isPressed,
|
|
53
|
+
isFocused,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const Comp = asChild ? Slot : Pressable;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<CheckboxProvider value={contextValue}>
|
|
60
|
+
<Comp
|
|
61
|
+
{...(combinedProps as PressableProps)}
|
|
62
|
+
ref={mergedRef}
|
|
63
|
+
tabIndex={-1}
|
|
64
|
+
role="label"
|
|
65
|
+
// eslint-disable-next-line react-native-a11y/has-valid-accessibility-role
|
|
66
|
+
accessibilityRole="label"
|
|
67
|
+
{...mergeDataAttributes(
|
|
68
|
+
props,
|
|
69
|
+
dataAttributes({
|
|
70
|
+
checked: isChecked || isCheckedProp,
|
|
71
|
+
disabled: isDisabled || isDisabledProp,
|
|
72
|
+
hover: isHovered || isHoveredProp,
|
|
73
|
+
invalid: isInvalid || isInvalidProp,
|
|
74
|
+
readonly: isReadOnly || isReadOnlyProp,
|
|
75
|
+
active: isPressed,
|
|
76
|
+
focus: isFocused,
|
|
77
|
+
indeterminate: isIndeterminate || isIndeterminateProp,
|
|
78
|
+
focusVisible: isFocusVisible,
|
|
79
|
+
}),
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
<VisuallyHidden>
|
|
83
|
+
<input {...groupItemInputProps} {...focusProps} ref={inputRef} />
|
|
84
|
+
</VisuallyHidden>
|
|
85
|
+
{children}
|
|
86
|
+
</Comp>
|
|
87
|
+
</CheckboxProvider>
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
CheckboxRoot.displayName = 'CheckboxRoot';
|
package/src/checkbox/index.ts
CHANGED
|
@@ -1,43 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { createCheckboxGroup } from './createCheckboxGroup';
|
|
3
|
-
import { createCheckboxIcon } from './createCheckboxIcon';
|
|
4
|
-
import { createCheckboxIndicator } from './createCheckboxIndicator';
|
|
5
|
-
import { createCheckboxLabel } from './createCheckboxLabel';
|
|
6
|
-
import { createCheckboxRoot } from './createCheckboxRoot';
|
|
7
|
-
import type { ICheckboxComponentType } from './types';
|
|
1
|
+
export type { ICheckboxContextValue, ICheckboxGroupProps, ICheckboxProps } from './types';
|
|
8
2
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ICheckboxIconProps,
|
|
13
|
-
ICheckboxIndicatorProps,
|
|
14
|
-
ICheckboxLabelProps,
|
|
15
|
-
ICheckboxProps,
|
|
16
|
-
} from './types';
|
|
17
|
-
|
|
18
|
-
export function createCheckbox<Root, Indicator, Icon, Label, Group>(BaseComponents: {
|
|
19
|
-
Root: React.ComponentType<Root>;
|
|
20
|
-
Indicator: React.ComponentType<Indicator>;
|
|
21
|
-
Icon: React.ComponentType<Icon>;
|
|
22
|
-
Label: React.ComponentType<Label>;
|
|
23
|
-
Group: React.ComponentType<Group>;
|
|
24
|
-
}) {
|
|
25
|
-
const Checkbox = createCheckboxRoot(BaseComponents.Root);
|
|
26
|
-
const Indicator = createCheckboxIndicator(BaseComponents.Indicator);
|
|
27
|
-
const Icon = createCheckboxIcon(BaseComponents.Icon);
|
|
28
|
-
const Label = createCheckboxLabel(BaseComponents.Label);
|
|
29
|
-
const Group = createCheckboxGroup(BaseComponents.Group);
|
|
30
|
-
|
|
31
|
-
Checkbox.displayName = 'CheckboxPrimitive';
|
|
32
|
-
Indicator.displayName = 'CheckboxPrimitive.Indicator';
|
|
33
|
-
Icon.displayName = 'CheckboxPrimitive.Icon';
|
|
34
|
-
Label.displayName = 'CheckboxPrimitive.Label';
|
|
35
|
-
Group.displayName = 'CheckboxPrimitive.Group';
|
|
36
|
-
|
|
37
|
-
return Object.assign(Checkbox, {
|
|
38
|
-
Indicator,
|
|
39
|
-
Icon,
|
|
40
|
-
Label,
|
|
41
|
-
Group,
|
|
42
|
-
}) as ICheckboxComponentType<Root, Indicator, Icon, Label, Group>;
|
|
43
|
-
}
|
|
3
|
+
export { useCheckboxContext } from './context';
|
|
4
|
+
export { CheckboxRoot, type CheckboxRootProps } from './CheckboxRoot';
|
|
5
|
+
export { CheckboxGroup, type CheckboxGroupRootProps } from './CheckboxGroup';
|
package/src/checkbox/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PressableProps } from 'react-native';
|
|
2
|
+
|
|
2
3
|
export interface InterfaceCheckbox extends PressableProps {
|
|
3
4
|
value: string;
|
|
4
5
|
onChange?: (isSelected: boolean) => void;
|
|
@@ -27,38 +28,6 @@ export interface ICheckboxGroupProps {
|
|
|
27
28
|
'aria-label'?: string;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
export type ICheckboxComponentType<Root, Indicator, Icon, Label, Group> =
|
|
31
|
-
React.ForwardRefExoticComponent<
|
|
32
|
-
React.RefAttributes<Root> & React.PropsWithoutRef<Root> & InterfaceCheckbox
|
|
33
|
-
> & {
|
|
34
|
-
Indicator: React.ForwardRefExoticComponent<
|
|
35
|
-
React.RefAttributes<Indicator> & React.PropsWithoutRef<Indicator> & ICheckboxIndicatorProps
|
|
36
|
-
>;
|
|
37
|
-
Icon: React.ForwardRefExoticComponent<
|
|
38
|
-
React.RefAttributes<Icon> & React.PropsWithoutRef<Icon> & ICheckboxIconProps
|
|
39
|
-
>;
|
|
40
|
-
Label: React.ForwardRefExoticComponent<
|
|
41
|
-
React.RefAttributes<Label> & React.PropsWithoutRef<Label> & ICheckboxLabelProps
|
|
42
|
-
>;
|
|
43
|
-
Group: React.ForwardRefExoticComponent<
|
|
44
|
-
React.RefAttributes<Group> & React.PropsWithoutRef<Group> & ICheckboxGroupProps
|
|
45
|
-
>;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export interface ICheckboxIndicatorProps {
|
|
49
|
-
children?: React.ReactNode;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface ICheckboxIconProps {
|
|
53
|
-
children?: React.ReactNode;
|
|
54
|
-
/** Render the icon even when unchecked */
|
|
55
|
-
forceMount?: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ICheckboxLabelProps {
|
|
59
|
-
children?: React.ReactNode;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
31
|
export type ICheckboxProps = InterfaceCheckbox;
|
|
63
32
|
|
|
64
33
|
export interface ICheckboxContextValue {
|