@cdx-ui/primitives 0.0.1-beta.9 → 0.0.1-beta.91
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 +67 -32
- package/lib/commonjs/CLAUDE.md +84 -0
- package/lib/commonjs/avatar/AvatarRoot.js +38 -0
- 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/ButtonRoot.js +85 -0
- 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/CheckboxGroup.js +52 -0
- 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 +20 -0
- package/lib/commonjs/chip/index.js.map +1 -0
- package/lib/commonjs/chip/types.js.map +1 -0
- package/lib/commonjs/dialog/DialogClose.js +32 -0
- package/lib/commonjs/dialog/DialogClose.js.map +1 -0
- package/lib/commonjs/dialog/DialogPopup.js +161 -0
- package/lib/commonjs/dialog/DialogPopup.js.map +1 -0
- package/lib/commonjs/dialog/DialogRoot.js +57 -0
- 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/form/FormRoot.web.js +27 -0
- 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/full-window-overlay/index.js +47 -0
- package/lib/commonjs/full-window-overlay/index.js.map +1 -0
- package/lib/commonjs/full-window-overlay/index.web.js +19 -0
- package/lib/commonjs/full-window-overlay/index.web.js.map +1 -0
- package/lib/commonjs/index.js +122 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/input/InputField.android.js +98 -0
- 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/InputRoot.js +84 -0
- 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/LinkRoot.js +88 -0
- package/lib/commonjs/link/LinkRoot.js.map +1 -0
- package/lib/commonjs/link/context.js +11 -0
- package/lib/commonjs/link/context.js.map +1 -0
- package/lib/commonjs/link/index.js +16 -3
- package/lib/commonjs/link/index.js.map +1 -1
- package/lib/commonjs/list-item/ListItemRoot.js +149 -0
- 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/OtpInputField.js +120 -0
- 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/useOtpInput.js +120 -0
- 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/portal/index.js +17 -0
- package/lib/commonjs/portal/index.js.map +1 -0
- package/lib/commonjs/portal/portal.js +110 -0
- package/lib/commonjs/portal/portal.js.map +1 -0
- package/lib/commonjs/progress-bar/ProgressBarIndicator.js +45 -0
- package/lib/commonjs/progress-bar/ProgressBarIndicator.js.map +1 -0
- package/lib/commonjs/progress-bar/ProgressBarRoot.js +100 -0
- 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-bar/types.js +6 -0
- package/lib/commonjs/progress-bar/types.js.map +1 -0
- package/lib/commonjs/radio/RadioGroup.js +74 -0
- 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/context.js +14 -0
- package/lib/commonjs/radio/context.js.map +1 -0
- package/lib/commonjs/radio/index.js +27 -0
- package/lib/commonjs/radio/index.js.map +1 -0
- package/lib/commonjs/radio/types.js +6 -0
- package/lib/commonjs/radio/types.js.map +1 -0
- package/lib/commonjs/radio/useRadioRoot.js +64 -0
- package/lib/commonjs/radio/useRadioRoot.js.map +1 -0
- package/lib/commonjs/select/SelectContent.js +105 -0
- package/lib/commonjs/select/SelectContent.js.map +1 -0
- package/lib/commonjs/select/SelectItem.js +104 -0
- package/lib/commonjs/select/SelectItem.js.map +1 -0
- package/lib/commonjs/select/SelectRoot.js +105 -0
- 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 +141 -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/TileGroup.js +111 -0
- 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/context.js +30 -0
- package/lib/commonjs/tile/context.js.map +1 -0
- package/lib/commonjs/tile/index.js +33 -0
- package/lib/commonjs/tile/index.js.map +1 -0
- package/lib/commonjs/tile/types.js +6 -0
- package/lib/commonjs/tile/types.js.map +1 -0
- package/lib/commonjs/toast/ToastRoot.js +41 -0
- package/lib/commonjs/toast/ToastRoot.js.map +1 -0
- package/lib/commonjs/toast/context.js +11 -0
- package/lib/commonjs/toast/context.js.map +1 -0
- package/lib/commonjs/toast/index.js +26 -0
- package/lib/commonjs/toast/index.js.map +1 -0
- package/lib/commonjs/toast/types.js +6 -0
- package/lib/commonjs/toast/types.js.map +1 -0
- package/lib/commonjs/utils/dataAttributes.js +12 -25
- 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 +64 -0
- package/lib/commonjs/utils/domDataAttributes.js.map +1 -0
- package/lib/module/CLAUDE.md +84 -0
- package/lib/module/avatar/AvatarRoot.js +34 -0
- 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/ButtonRoot.js +81 -0
- 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/CheckboxGroup.js +48 -0
- 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 +5 -0
- package/lib/module/chip/index.js.map +1 -0
- package/lib/module/chip/types.js.map +1 -0
- package/lib/module/dialog/DialogClose.js +28 -0
- package/lib/module/dialog/DialogClose.js.map +1 -0
- package/lib/module/dialog/DialogPopup.js +157 -0
- package/lib/module/dialog/DialogPopup.js.map +1 -0
- package/lib/module/dialog/DialogRoot.js +53 -0
- 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/full-window-overlay/index.js +43 -0
- package/lib/module/full-window-overlay/index.js.map +1 -0
- package/lib/module/full-window-overlay/index.web.js +15 -0
- package/lib/module/full-window-overlay/index.web.js.map +1 -0
- package/lib/module/index.js +11 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/input/InputField.android.js +94 -0
- 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/InputRoot.js +80 -0
- 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/LinkRoot.js +84 -0
- package/lib/module/link/LinkRoot.js.map +1 -0
- package/lib/module/link/context.js +5 -0
- package/lib/module/link/context.js.map +1 -0
- package/lib/module/link/index.js +2 -1
- package/lib/module/link/index.js.map +1 -1
- package/lib/module/list-item/ListItemRoot.js +144 -0
- 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/OtpInputField.js +116 -0
- 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/useOtpInput.js +116 -0
- 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/portal/index.js +4 -0
- package/lib/module/portal/index.js.map +1 -0
- package/lib/module/portal/portal.js +103 -0
- package/lib/module/portal/portal.js.map +1 -0
- package/lib/module/progress-bar/ProgressBarIndicator.js +41 -0
- package/lib/module/progress-bar/ProgressBarIndicator.js.map +1 -0
- package/lib/module/progress-bar/ProgressBarRoot.js +96 -0
- 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-bar/types.js +4 -0
- package/lib/module/progress-bar/types.js.map +1 -0
- package/lib/module/radio/RadioGroup.js +70 -0
- 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/context.js +7 -0
- package/lib/module/radio/context.js.map +1 -0
- package/lib/module/radio/index.js +6 -0
- package/lib/module/radio/index.js.map +1 -0
- package/lib/module/radio/types.js +4 -0
- package/lib/module/radio/types.js.map +1 -0
- package/lib/module/radio/useRadioRoot.js +60 -0
- package/lib/module/radio/useRadioRoot.js.map +1 -0
- package/lib/module/select/SelectContent.js +100 -0
- package/lib/module/select/SelectContent.js.map +1 -0
- package/lib/module/select/SelectItem.js +100 -0
- package/lib/module/select/SelectItem.js.map +1 -0
- package/lib/module/select/SelectRoot.js +101 -0
- 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 +135 -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/TileGroup.js +107 -0
- package/lib/module/tile/TileGroup.js.map +1 -0
- package/lib/module/tile/TileRoot.js +125 -0
- package/lib/module/tile/TileRoot.js.map +1 -0
- package/lib/module/tile/context.js +21 -0
- package/lib/module/tile/context.js.map +1 -0
- package/lib/module/tile/index.js +6 -0
- package/lib/module/tile/index.js.map +1 -0
- package/lib/module/tile/types.js +4 -0
- package/lib/module/tile/types.js.map +1 -0
- package/lib/module/toast/ToastRoot.js +37 -0
- package/lib/module/toast/ToastRoot.js.map +1 -0
- package/lib/module/toast/context.js +5 -0
- package/lib/module/toast/context.js.map +1 -0
- package/lib/module/toast/index.js +5 -0
- package/lib/module/toast/index.js.map +1 -0
- package/lib/module/toast/types.js +4 -0
- package/lib/module/toast/types.js.map +1 -0
- package/lib/module/utils/dataAttributes.js +4 -22
- 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 +59 -0
- package/lib/module/utils/domDataAttributes.js.map +1 -0
- 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 +1 -9
- 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 +3 -1
- package/lib/typescript/checkbox/useCheckboxRoot.d.ts.map +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 +4 -0
- package/lib/typescript/chip/index.d.ts.map +1 -0
- package/lib/typescript/chip/types.d.ts +16 -0
- package/lib/typescript/chip/types.d.ts.map +1 -0
- 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 +14 -25
- 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/full-window-overlay/index.d.ts +46 -0
- package/lib/typescript/full-window-overlay/index.d.ts.map +1 -0
- package/lib/typescript/full-window-overlay/index.web.d.ts +29 -0
- package/lib/typescript/full-window-overlay/index.web.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +11 -2
- 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/context.d.ts +10 -0
- package/lib/typescript/link/context.d.ts.map +1 -0
- package/lib/typescript/link/index.d.ts +3 -1
- package/lib/typescript/link/index.d.ts.map +1 -1
- package/lib/typescript/link/types.d.ts +1 -0
- package/lib/typescript/link/types.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 +5 -59
- 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/portal/index.d.ts +2 -0
- package/lib/typescript/portal/index.d.ts.map +1 -0
- package/lib/typescript/portal/portal.d.ts +25 -0
- package/lib/typescript/portal/portal.d.ts.map +1 -0
- 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-bar/types.d.ts +22 -0
- 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/context.d.ts +21 -0
- package/lib/typescript/radio/context.d.ts.map +1 -0
- package/lib/typescript/radio/index.d.ts +5 -0
- package/lib/typescript/radio/index.d.ts.map +1 -0
- package/lib/typescript/radio/types.d.ts +43 -0
- package/lib/typescript/radio/types.d.ts.map +1 -0
- package/lib/typescript/radio/useRadioRoot.d.ts +151 -0
- package/lib/typescript/radio/useRadioRoot.d.ts.map +1 -0
- 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 +8 -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/context.d.ts +9 -0
- package/lib/typescript/tile/context.d.ts.map +1 -0
- package/lib/typescript/tile/index.d.ts +5 -0
- package/lib/typescript/tile/index.d.ts.map +1 -0
- package/lib/typescript/tile/types.d.ts +108 -0
- package/lib/typescript/tile/types.d.ts.map +1 -0
- package/lib/typescript/toast/ToastRoot.d.ts +7 -0
- package/lib/typescript/toast/ToastRoot.d.ts.map +1 -0
- package/lib/typescript/toast/context.d.ts +6 -0
- package/lib/typescript/toast/context.d.ts.map +1 -0
- package/lib/typescript/toast/index.d.ts +3 -0
- package/lib/typescript/toast/index.d.ts.map +1 -0
- package/lib/typescript/toast/types.d.ts +16 -0
- package/lib/typescript/toast/types.d.ts.map +1 -0
- package/lib/typescript/utils/dataAttributes.d.ts +4 -10
- 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 +28 -0
- package/lib/typescript/utils/domDataAttributes.d.ts.map +1 -0
- package/package.json +5 -2
- package/src/CLAUDE.md +84 -0
- 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 -0
- package/src/chip/types.ts +20 -0
- 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 +6 -87
- package/src/dialog/types.ts +14 -57
- 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/full-window-overlay/index.tsx +65 -0
- package/src/full-window-overlay/index.web.tsx +32 -0
- package/src/index.ts +15 -2
- 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/context.tsx +10 -0
- package/src/link/index.tsx +3 -1
- package/src/link/types.ts +1 -0
- package/src/list-item/ListItemRoot.tsx +183 -0
- package/src/list-item/context.tsx +2 -2
- package/src/list-item/index.ts +1 -80
- package/src/list-item/types.ts +5 -89
- 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/portal/index.ts +1 -0
- package/src/portal/portal.tsx +116 -0
- package/src/progress-bar/ProgressBarIndicator.tsx +34 -0
- package/src/progress-bar/ProgressBarRoot.tsx +117 -0
- package/src/progress-bar/index.ts +5 -0
- package/src/progress-bar/types.ts +24 -0
- package/src/radio/RadioGroup.tsx +85 -0
- package/src/radio/RadioRoot.tsx +98 -0
- package/src/radio/RadioRoot.web.tsx +90 -0
- package/src/radio/context.tsx +21 -0
- package/src/radio/index.ts +5 -0
- package/src/radio/types.ts +45 -0
- package/src/radio/useRadioRoot.ts +69 -0
- 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.tsx +162 -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/TileRoot.tsx +137 -0
- package/src/tile/context.tsx +23 -0
- package/src/tile/index.ts +18 -0
- package/src/tile/types.ts +121 -0
- package/src/toast/ToastRoot.tsx +39 -0
- package/src/toast/context.tsx +4 -0
- package/src/toast/index.ts +2 -0
- package/src/toast/types.ts +17 -0
- package/src/uniwind.d.ts +1 -0
- package/src/utils/dataAttributes.ts +7 -25
- package/src/utils/dataAttributes.web.ts +24 -0
- package/src/utils/domDataAttributes.ts +63 -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 +0 -34
- package/lib/commonjs/avatar/createAvatarRoot.js.map +0 -1
- package/lib/commonjs/avatar/createAvatarText.js +0 -42
- 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 +0 -81
- 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 -38
- package/lib/commonjs/button/createButtonText.js.map +0 -1
- package/lib/commonjs/checkbox/createCheckboxGroup.js +0 -44
- 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 -90
- package/lib/commonjs/checkbox/createCheckboxRoot.web.js.map +0 -1
- package/lib/commonjs/dialog/createDialogBody.js +0 -21
- package/lib/commonjs/dialog/createDialogBody.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 -141
- 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 +0 -21
- 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/createDialogRoot.js +0 -54
- 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 +0 -95
- package/lib/commonjs/input/createInputField.js.map +0 -1
- package/lib/commonjs/input/createInputRoot.js +0 -82
- 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 +0 -74
- 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 +0 -142
- 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 +0 -104
- package/lib/commonjs/otp-input/createOtpInputField.js.map +0 -1
- package/lib/commonjs/otp-input/createOtpInputRoot.js +0 -136
- 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 +0 -42
- package/lib/commonjs/progress/createProgressIndicator.js.map +0 -1
- package/lib/commonjs/progress/createProgressRoot.js +0 -96
- 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/progress/types.js.map +0 -1
- package/lib/commonjs/select/createSelectContent.js +0 -102
- package/lib/commonjs/select/createSelectContent.js.map +0 -1
- package/lib/commonjs/select/createSelectIcon.js +0 -41
- package/lib/commonjs/select/createSelectIcon.js.map +0 -1
- package/lib/commonjs/select/createSelectItem.js +0 -101
- 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 +0 -102
- package/lib/commonjs/select/createSelectRoot.js.map +0 -1
- package/lib/commonjs/select/createSelectTrigger.js +0 -179
- 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/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 +0 -29
- package/lib/module/avatar/createAvatarRoot.js.map +0 -1
- package/lib/module/avatar/createAvatarText.js +0 -37
- 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 +0 -76
- 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 -33
- package/lib/module/button/createButtonText.js.map +0 -1
- package/lib/module/checkbox/createCheckboxGroup.js +0 -39
- 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 -85
- package/lib/module/checkbox/createCheckboxRoot.web.js.map +0 -1
- package/lib/module/dialog/createDialogBody.js +0 -15
- package/lib/module/dialog/createDialogBody.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 -136
- 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/createDialogRoot.js +0 -49
- 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 +0 -90
- package/lib/module/input/createInputField.js.map +0 -1
- package/lib/module/input/createInputRoot.js +0 -76
- 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 +0 -68
- 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 +0 -136
- 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 +0 -99
- package/lib/module/otp-input/createOtpInputField.js.map +0 -1
- package/lib/module/otp-input/createOtpInputRoot.js +0 -131
- 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 +0 -37
- package/lib/module/progress/createProgressIndicator.js.map +0 -1
- package/lib/module/progress/createProgressRoot.js +0 -91
- 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/progress/types.js.map +0 -1
- package/lib/module/select/createSelectContent.js +0 -97
- package/lib/module/select/createSelectContent.js.map +0 -1
- package/lib/module/select/createSelectIcon.js +0 -36
- package/lib/module/select/createSelectIcon.js.map +0 -1
- package/lib/module/select/createSelectItem.js +0 -96
- 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 +0 -97
- package/lib/module/select/createSelectRoot.js.map +0 -1
- package/lib/module/select/createSelectTrigger.js +0 -174
- 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/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 -2
- package/lib/typescript/checkbox/createCheckboxRoot.web.d.ts.map +0 -1
- package/lib/typescript/dialog/createDialogBody.d.ts +0 -4
- package/lib/typescript/dialog/createDialogBody.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/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 +0 -25
- package/lib/typescript/progress/types.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/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 -30
- 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 -22
- 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 -79
- package/src/dialog/createDialogBody.tsx +0 -11
- package/src/dialog/createDialogClose.tsx +0 -27
- package/src/dialog/createDialogContent.tsx +0 -122
- package/src/dialog/createDialogDescription.tsx +0 -20
- package/src/dialog/createDialogFooter.tsx +0 -11
- package/src/dialog/createDialogHeader.tsx +0 -11
- 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 -30
- package/src/field/createFieldRoot.tsx +0 -27
- package/src/form/createFormRoot.tsx +0 -13
- package/src/input/createInputField.tsx +0 -114
- package/src/input/createInputRoot.tsx +0 -92
- package/src/input/createInputSlot.tsx +0 -39
- package/src/link/createLink.tsx +0 -71
- 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 -163
- 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/createProgressRoot.tsx +0 -109
- package/src/progress/index.ts +0 -28
- package/src/progress/types.ts +0 -37
- package/src/select/createSelectContent.tsx +0 -115
- package/src/select/createSelectIcon.tsx +0 -27
- 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 -218
- package/src/select/createSelectValue.tsx +0 -38
- package/src/select/index.tsx +0 -73
- package/src/switch/createSwitchRoot.tsx +0 -72
- /package/lib/commonjs/{progress → chip}/types.js +0 -0
- /package/lib/commonjs/{progress → progress-bar}/context.js +0 -0
- /package/lib/module/{progress → chip}/types.js +0 -0
- /package/lib/module/{progress → progress-bar}/context.js +0 -0
- /package/lib/typescript/{progress → progress-bar}/context.d.ts +0 -0
- /package/src/{progress → progress-bar}/context.tsx +0 -0
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 {
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React, { forwardRef, useMemo, type ComponentRef } from 'react';
|
|
2
|
+
import { Pressable, View, type PressableProps, type ViewProps } from 'react-native';
|
|
3
|
+
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
4
|
+
import { useFocus, useFocusRing } from '@react-native-aria/focus';
|
|
5
|
+
import { useHover, usePress } from '@react-native-aria/interactions';
|
|
6
|
+
import type { InteractionState } from '../types';
|
|
7
|
+
import { Slot } from '../slot';
|
|
8
|
+
import { dataAttributes, mergeDataAttributes } from '../utils/dataAttributes';
|
|
9
|
+
import { ChipProvider } from './context';
|
|
10
|
+
import type { IChipPressablePassthrough, IChipProps } from './types';
|
|
11
|
+
|
|
12
|
+
const rowStyle = {
|
|
13
|
+
flexDirection: 'row' as const,
|
|
14
|
+
alignItems: 'center' as const,
|
|
15
|
+
alignSelf: 'flex-start' as const,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface ChipRootProps extends IChipProps {}
|
|
19
|
+
|
|
20
|
+
export const ChipRoot = forwardRef<ComponentRef<typeof View>, ChipRootProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
asChild = false,
|
|
24
|
+
children,
|
|
25
|
+
onPress,
|
|
26
|
+
disabled = false,
|
|
27
|
+
accessibilityRole,
|
|
28
|
+
style,
|
|
29
|
+
...restProps
|
|
30
|
+
},
|
|
31
|
+
ref,
|
|
32
|
+
) => {
|
|
33
|
+
const asChildInteractive = asChild && React.isValidElement(children);
|
|
34
|
+
const isPressableRoot = !!onPress && !asChildInteractive;
|
|
35
|
+
|
|
36
|
+
const pressState = usePress({
|
|
37
|
+
isDisabled: !isPressableRoot || disabled,
|
|
38
|
+
});
|
|
39
|
+
const isPressed = pressState.isPressed;
|
|
40
|
+
const pressProps = pressState.pressProps as Pick<PressableProps, 'onPressIn' | 'onPressOut'>;
|
|
41
|
+
const { hoverProps, isHovered } = useHover();
|
|
42
|
+
const { isFocused, focusProps } = useFocus();
|
|
43
|
+
const { isFocusVisible, focusProps: focusRingProps } = useFocusRing() as {
|
|
44
|
+
isFocusVisible: boolean;
|
|
45
|
+
focusProps: typeof focusProps;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const childDisabled =
|
|
49
|
+
asChildInteractive &&
|
|
50
|
+
!!(children as React.ReactElement<{ disabled?: boolean }>).props.disabled;
|
|
51
|
+
const resolvedDisabled = disabled || childDisabled;
|
|
52
|
+
|
|
53
|
+
const contextValue = useMemo<InteractionState>(
|
|
54
|
+
() => ({
|
|
55
|
+
hover: isPressableRoot ? isHovered : false,
|
|
56
|
+
focus: isPressableRoot ? isFocused : false,
|
|
57
|
+
active: isPressableRoot ? isPressed : false,
|
|
58
|
+
disabled: resolvedDisabled,
|
|
59
|
+
focusVisible: isPressableRoot ? isFocusVisible : false,
|
|
60
|
+
}),
|
|
61
|
+
[isPressableRoot, isHovered, isFocused, isPressed, resolvedDisabled, isFocusVisible],
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
if (asChildInteractive) {
|
|
65
|
+
const slotMergeProps: Record<string, unknown> = {
|
|
66
|
+
...restProps,
|
|
67
|
+
...(resolvedDisabled && { accessibilityState: { disabled: true } }),
|
|
68
|
+
disabled: resolvedDisabled,
|
|
69
|
+
style: [rowStyle, style],
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Only set onPress when we have a parent handler to compose. Slot merges this
|
|
73
|
+
// with the child's own onPress (child first, then ours). When there is no parent
|
|
74
|
+
// onPress, omitting it preserves the child's internal handler (e.g. Link's useLink).
|
|
75
|
+
if (!resolvedDisabled && onPress) {
|
|
76
|
+
slotMergeProps.onPress = onPress;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<ChipProvider value={contextValue}>
|
|
81
|
+
<Slot
|
|
82
|
+
ref={ref as React.Ref<View>}
|
|
83
|
+
{...(slotMergeProps as PressableProps)}
|
|
84
|
+
{...mergeDataAttributes(
|
|
85
|
+
restProps,
|
|
86
|
+
dataAttributes({
|
|
87
|
+
active: false,
|
|
88
|
+
hover: false,
|
|
89
|
+
focus: false,
|
|
90
|
+
focusVisible: false,
|
|
91
|
+
disabled: resolvedDisabled,
|
|
92
|
+
}),
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</Slot>
|
|
97
|
+
</ChipProvider>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (isPressableRoot) {
|
|
102
|
+
const {
|
|
103
|
+
onPressIn: onPressInProp,
|
|
104
|
+
onPressOut: onPressOutProp,
|
|
105
|
+
onHoverIn: onHoverInProp,
|
|
106
|
+
onHoverOut: onHoverOutProp,
|
|
107
|
+
onFocus: onFocusProp,
|
|
108
|
+
onBlur: onBlurProp,
|
|
109
|
+
} = restProps as IChipPressablePassthrough & Pick<PressableProps, 'onFocus' | 'onBlur'>;
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<ChipProvider value={contextValue}>
|
|
113
|
+
<Pressable
|
|
114
|
+
{...(restProps as PressableProps)}
|
|
115
|
+
ref={ref}
|
|
116
|
+
accessibilityRole={accessibilityRole ?? 'button'}
|
|
117
|
+
{...(disabled && { accessibilityState: { disabled: true } })}
|
|
118
|
+
disabled={disabled}
|
|
119
|
+
style={[rowStyle, style]}
|
|
120
|
+
onPress={disabled ? undefined : onPress}
|
|
121
|
+
onPressIn={composeEventHandlers(onPressInProp, pressProps.onPressIn)}
|
|
122
|
+
onPressOut={composeEventHandlers(onPressOutProp, pressProps.onPressOut)}
|
|
123
|
+
onHoverIn={composeEventHandlers(onHoverInProp, hoverProps.onHoverIn)}
|
|
124
|
+
onHoverOut={composeEventHandlers(onHoverOutProp, hoverProps.onHoverOut)}
|
|
125
|
+
onFocus={composeEventHandlers(
|
|
126
|
+
composeEventHandlers(onFocusProp, focusProps.onFocus),
|
|
127
|
+
focusRingProps.onFocus,
|
|
128
|
+
)}
|
|
129
|
+
onBlur={composeEventHandlers(
|
|
130
|
+
composeEventHandlers(onBlurProp, focusProps.onBlur),
|
|
131
|
+
focusRingProps.onBlur,
|
|
132
|
+
)}
|
|
133
|
+
{...mergeDataAttributes(
|
|
134
|
+
restProps,
|
|
135
|
+
dataAttributes({
|
|
136
|
+
active: isPressed,
|
|
137
|
+
hover: isHovered,
|
|
138
|
+
focus: isFocused,
|
|
139
|
+
focusVisible: isFocusVisible,
|
|
140
|
+
disabled,
|
|
141
|
+
}),
|
|
142
|
+
)}
|
|
143
|
+
>
|
|
144
|
+
{children}
|
|
145
|
+
</Pressable>
|
|
146
|
+
</ChipProvider>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<ChipProvider value={contextValue}>
|
|
152
|
+
<View
|
|
153
|
+
{...(restProps as ViewProps)}
|
|
154
|
+
ref={ref}
|
|
155
|
+
style={[rowStyle, style]}
|
|
156
|
+
{...mergeDataAttributes(
|
|
157
|
+
restProps,
|
|
158
|
+
disabled ? dataAttributes({ disabled: true }) : undefined,
|
|
159
|
+
)}
|
|
160
|
+
>
|
|
161
|
+
{children}
|
|
162
|
+
</View>
|
|
163
|
+
</ChipProvider>
|
|
164
|
+
);
|
|
165
|
+
},
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
ChipRoot.displayName = 'ChipRoot';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type IChipPressablePassthrough = Partial<
|
|
4
|
+
Pick<PressableProps, 'onPressIn' | 'onPressOut' | 'onHoverIn' | 'onHoverOut'>
|
|
5
|
+
>;
|
|
6
|
+
|
|
7
|
+
export interface InterfaceChipProps extends ViewProps, IChipPressablePassthrough {
|
|
8
|
+
/**
|
|
9
|
+
* When set (and `asChild` is not used with a valid element), root renders as pressable.
|
|
10
|
+
*/
|
|
11
|
+
onPress?: PressableProps['onPress'];
|
|
12
|
+
/** Disables press handling when the root is pressable. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Merge interaction props onto a single child instead of rendering the default pressable root.
|
|
16
|
+
*/
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type IChipProps = InterfaceChipProps;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { forwardRef, type ComponentRef } from 'react';
|
|
2
|
+
import { Pressable, type PressableProps } from 'react-native';
|
|
3
|
+
import { composeEventHandlers } from '@cdx-ui/utils';
|
|
4
|
+
import { Slot } from '../slot';
|
|
5
|
+
import { useDialog } from './context';
|
|
6
|
+
import type { IDialogCloseProps } from './types';
|
|
7
|
+
|
|
8
|
+
export interface DialogCloseProps extends IDialogCloseProps {}
|
|
9
|
+
|
|
10
|
+
export const DialogClose = forwardRef<ComponentRef<typeof Pressable>, DialogCloseProps>(
|
|
11
|
+
({ asChild = false, children, onPress, ...props }, ref) => {
|
|
12
|
+
const { onOpenChange } = useDialog();
|
|
13
|
+
|
|
14
|
+
const handlePress = composeEventHandlers(onPress, () => onOpenChange(false));
|
|
15
|
+
|
|
16
|
+
const Comp = asChild ? Slot : Pressable;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Comp ref={ref} {...(props as PressableProps)} onPress={handlePress}>
|
|
20
|
+
{children}
|
|
21
|
+
</Comp>
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
DialogClose.displayName = 'DialogClose';
|