@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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSwitch = useSwitch;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _focus = require("@react-native-aria/focus");
|
|
9
|
+
var _interactions = require("@react-native-aria/interactions");
|
|
10
|
+
var _toggle = require("@react-stately/toggle");
|
|
11
|
+
var _utils = require("@cdx-ui/utils");
|
|
12
|
+
var _dataAttributes = require("../utils/dataAttributes");
|
|
13
|
+
/**
|
|
14
|
+
* Headless behavioral primitive for `Switch`.
|
|
15
|
+
*
|
|
16
|
+
* Owns the controlled/uncontrolled toggle state, ARIA `role="switch"` semantics
|
|
17
|
+
* (consumers must wire `aria-checked`/`accessibilityRole` to the host element they
|
|
18
|
+
* render), and interaction tracking (hover, focus-visible). Surfaces a
|
|
19
|
+
* platform-aware `dataAttrs` object so the styled layer can emit interaction-state
|
|
20
|
+
* `data-*` attributes (Standard 1) without re-implementing the toggle machinery.
|
|
21
|
+
*
|
|
22
|
+
* Standards mapping (per `.cursor/plans/primitive_design_standards_0d0ca4b1.plan.md`):
|
|
23
|
+
* - Standard 3 #1 — controlled state via `useToggleState`.
|
|
24
|
+
* - Standard 3 #2 — `role="switch"` semantics (consumer wires to host).
|
|
25
|
+
*
|
|
26
|
+
* The styled layer renders the host element (`RNSwitch` on native, a custom
|
|
27
|
+
* `Pressable` + `View` toggle on web) and is the sole owner of className/styling
|
|
28
|
+
* machinery — primitives never carry Uniwind className passthrough.
|
|
29
|
+
*/
|
|
30
|
+
function useSwitch(props = {}) {
|
|
31
|
+
const {
|
|
32
|
+
disabled,
|
|
33
|
+
isDisabled,
|
|
34
|
+
isChecked,
|
|
35
|
+
isInvalid,
|
|
36
|
+
defaultValue,
|
|
37
|
+
value,
|
|
38
|
+
onValueChange
|
|
39
|
+
} = props;
|
|
40
|
+
const formControlContext = (0, _utils.useFormControlContext)();
|
|
41
|
+
const controlledValue = value ?? isChecked;
|
|
42
|
+
const state = (0, _toggle.useToggleState)({
|
|
43
|
+
defaultSelected: defaultValue ?? false,
|
|
44
|
+
isSelected: controlledValue,
|
|
45
|
+
onChange: onValueChange
|
|
46
|
+
});
|
|
47
|
+
const checked = controlledValue ?? state.isSelected;
|
|
48
|
+
const hostRef = (0, _react.useRef)(null);
|
|
49
|
+
const {
|
|
50
|
+
isHovered,
|
|
51
|
+
hoverProps
|
|
52
|
+
} = (0, _interactions.useHover)({}, hostRef);
|
|
53
|
+
const {
|
|
54
|
+
isFocusVisible,
|
|
55
|
+
focusProps
|
|
56
|
+
} = (0, _focus.useFocusRing)();
|
|
57
|
+
const isDisabledResolved = Boolean(disabled || isDisabled || formControlContext.isDisabled);
|
|
58
|
+
const isInvalidResolved = Boolean(isInvalid || formControlContext.isInvalid);
|
|
59
|
+
const setChecked = (0, _react.useCallback)(next => {
|
|
60
|
+
state.setSelected(next);
|
|
61
|
+
}, [state]);
|
|
62
|
+
return {
|
|
63
|
+
checked,
|
|
64
|
+
isDisabled: isDisabledResolved,
|
|
65
|
+
isInvalid: isInvalidResolved,
|
|
66
|
+
isHovered,
|
|
67
|
+
isFocusVisible,
|
|
68
|
+
setChecked,
|
|
69
|
+
hoverProps,
|
|
70
|
+
focusProps,
|
|
71
|
+
dataAttrs: (0, _dataAttributes.dataAttributes)({
|
|
72
|
+
hover: isHovered,
|
|
73
|
+
disabled: isDisabledResolved,
|
|
74
|
+
invalid: isInvalidResolved,
|
|
75
|
+
checked,
|
|
76
|
+
focusVisible: isFocusVisible
|
|
77
|
+
}),
|
|
78
|
+
hostRef
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=useSwitch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_focus","_interactions","_toggle","_utils","_dataAttributes","useSwitch","props","disabled","isDisabled","isChecked","isInvalid","defaultValue","value","onValueChange","formControlContext","useFormControlContext","controlledValue","state","useToggleState","defaultSelected","isSelected","onChange","checked","hostRef","useRef","isHovered","hoverProps","useHover","isFocusVisible","focusProps","useFocusRing","isDisabledResolved","Boolean","isInvalidResolved","setChecked","useCallback","next","setSelected","dataAttrs","dataAttributes","hover","invalid","focusVisible"],"sourceRoot":"../../../src","sources":["switch/useSwitch.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,SAASA,CAACC,KAAmB,GAAG,CAAC,CAAC,EAAoB;EACpE,MAAM;IAAEC,QAAQ;IAAEC,UAAU;IAAEC,SAAS;IAAEC,SAAS;IAAEC,YAAY;IAAEC,KAAK;IAAEC;EAAc,CAAC,GAAGP,KAAK;EAEhG,MAAMQ,kBAAkB,GAAG,IAAAC,4BAAqB,EAAC,CAAC;EAClD,MAAMC,eAAe,GAAGJ,KAAK,IAAIH,SAAS;EAE1C,MAAMQ,KAAK,GAAG,IAAAC,sBAAc,EAAC;IAC3BC,eAAe,EAAER,YAAY,IAAI,KAAK;IACtCS,UAAU,EAAEJ,eAAe;IAC3BK,QAAQ,EAAER;EACZ,CAAC,CAAC;EAEF,MAAMS,OAAO,GAAGN,eAAe,IAAIC,KAAK,CAACG,UAAU;EAEnD,MAAMG,OAAO,GAAG,IAAAC,aAAM,EAAU,IAAI,CAAC;EACrC,MAAM;IAAEC,SAAS;IAAEC;EAAW,CAAC,GAAG,IAAAC,sBAAQ,EAAC,CAAC,CAAC,EAAEJ,OAAO,CAAC;EACvD,MAAM;IAAEK,cAAc;IAAEC;EAAW,CAAC,GAAG,IAAAC,mBAAY,EAAC,CAGnD;EAED,MAAMC,kBAAkB,GAAGC,OAAO,CAACzB,QAAQ,IAAIC,UAAU,IAAIM,kBAAkB,CAACN,UAAU,CAAC;EAC3F,MAAMyB,iBAAiB,GAAGD,OAAO,CAACtB,SAAS,IAAII,kBAAkB,CAACJ,SAAS,CAAC;EAE5E,MAAMwB,UAAU,GAAG,IAAAC,kBAAW,EAC3BC,IAAa,IAAK;IACjBnB,KAAK,CAACoB,WAAW,CAACD,IAAI,CAAC;EACzB,CAAC,EACD,CAACnB,KAAK,CACR,CAAC;EAED,OAAO;IACLK,OAAO;IACPd,UAAU,EAAEuB,kBAAkB;IAC9BrB,SAAS,EAAEuB,iBAAiB;IAC5BR,SAAS;IACTG,cAAc;IACdM,UAAU;IACVR,UAAU;IACVG,UAAU;IACVS,SAAS,EAAE,IAAAC,8BAAc,EAAC;MACxBC,KAAK,EAAEf,SAAS;MAChBlB,QAAQ,EAAEwB,kBAAkB;MAC5BU,OAAO,EAAER,iBAAiB;MAC1BX,OAAO;MACPoB,YAAY,EAAEd;IAChB,CAAC,CAAC;IACFL;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TileGroup = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _slot = require("../slot");
|
|
11
|
+
var _context = require("./context");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* Internal widening of the public discriminated union: the runtime accepts any value
|
|
15
|
+
* shape and reads `type` to decide branch behavior. The public API stays narrow.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const TileGroup = exports.TileGroup = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
19
|
+
const {
|
|
20
|
+
asChild = false,
|
|
21
|
+
children,
|
|
22
|
+
type,
|
|
23
|
+
value: valueProp,
|
|
24
|
+
defaultValue,
|
|
25
|
+
onValueChange,
|
|
26
|
+
max: maxProp,
|
|
27
|
+
isDisabled = false,
|
|
28
|
+
'aria-label': ariaLabel,
|
|
29
|
+
...rest
|
|
30
|
+
} = props;
|
|
31
|
+
const max = maxProp ?? Number.POSITIVE_INFINITY;
|
|
32
|
+
const defaultProp = defaultValue !== undefined ? defaultValue : type === 'multiple' ? [] : undefined;
|
|
33
|
+
const [state, setState] = (0, _utils.useControllableState)({
|
|
34
|
+
prop: valueProp,
|
|
35
|
+
defaultProp,
|
|
36
|
+
onChange: next => {
|
|
37
|
+
if (next !== undefined) {
|
|
38
|
+
onValueChange?.(next);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const isSelected = (0, _react.useCallback)(tileValue => {
|
|
43
|
+
if (type === 'single') {
|
|
44
|
+
return state === tileValue;
|
|
45
|
+
}
|
|
46
|
+
return Array.isArray(state) && state.includes(tileValue);
|
|
47
|
+
}, [type, state]);
|
|
48
|
+
const isTileDisabledByGroup = (0, _react.useCallback)(tileValue => {
|
|
49
|
+
if (isDisabled) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (type !== 'multiple') {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const arr = Array.isArray(state) ? state : [];
|
|
56
|
+
if (arr.length < max) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return !arr.includes(tileValue);
|
|
60
|
+
}, [isDisabled, type, state, max]);
|
|
61
|
+
const toggleValue = (0, _react.useCallback)(tileValue => {
|
|
62
|
+
if (isDisabled) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (type === 'single') {
|
|
66
|
+
if (state === tileValue) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
setState(tileValue);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const arr = Array.isArray(state) ? [...state] : [];
|
|
73
|
+
const idx = arr.indexOf(tileValue);
|
|
74
|
+
if (idx >= 0) {
|
|
75
|
+
arr.splice(idx, 1);
|
|
76
|
+
setState(arr);
|
|
77
|
+
} else if (arr.length < max) {
|
|
78
|
+
arr.push(tileValue);
|
|
79
|
+
setState(arr);
|
|
80
|
+
}
|
|
81
|
+
}, [isDisabled, type, state, setState, max]);
|
|
82
|
+
const contextValue = (0, _react.useMemo)(() => ({
|
|
83
|
+
type,
|
|
84
|
+
value: state,
|
|
85
|
+
toggleValue,
|
|
86
|
+
isSelected,
|
|
87
|
+
isTileDisabledByGroup,
|
|
88
|
+
isGroupDisabled: isDisabled,
|
|
89
|
+
max
|
|
90
|
+
}), [type, state, toggleValue, isSelected, isTileDisabledByGroup, isDisabled, max]);
|
|
91
|
+
const role = type === 'single' ? 'radiogroup' : 'group';
|
|
92
|
+
const Comp = asChild ? _slot.Slot : _reactNative.View;
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.TileGroupContextProvider, {
|
|
94
|
+
value: contextValue,
|
|
95
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
96
|
+
ref: ref,
|
|
97
|
+
role: role,
|
|
98
|
+
...(type === 'single' ? {
|
|
99
|
+
accessibilityRole: 'radiogroup'
|
|
100
|
+
} : {}),
|
|
101
|
+
...(ariaLabel ? {
|
|
102
|
+
'aria-label': ariaLabel,
|
|
103
|
+
accessibilityLabel: ariaLabel
|
|
104
|
+
} : {}),
|
|
105
|
+
...rest,
|
|
106
|
+
children: children
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
TileGroup.displayName = 'TileGroup';
|
|
111
|
+
//# sourceMappingURL=TileGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_slot","_context","_jsxRuntime","TileGroup","exports","forwardRef","props","ref","asChild","children","type","value","valueProp","defaultValue","onValueChange","max","maxProp","isDisabled","ariaLabel","rest","Number","POSITIVE_INFINITY","defaultProp","undefined","state","setState","useControllableState","prop","onChange","next","isSelected","useCallback","tileValue","Array","isArray","includes","isTileDisabledByGroup","arr","length","toggleValue","idx","indexOf","splice","push","contextValue","useMemo","isGroupDisabled","role","Comp","Slot","View","jsx","TileGroupContextProvider","accessibilityRole","accessibilityLabel","displayName"],"sourceRoot":"../../../src","sources":["tile/TileGroup.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TileRoot = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _focus = require("@react-native-aria/focus");
|
|
11
|
+
var _interactions = require("@react-native-aria/interactions");
|
|
12
|
+
var _slot = require("../slot");
|
|
13
|
+
var _dataAttributes = require("../utils/dataAttributes");
|
|
14
|
+
var _context = require("./context");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
const rowStyle = {
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
alignSelf: 'stretch',
|
|
19
|
+
alignItems: 'center'
|
|
20
|
+
};
|
|
21
|
+
const TileRoot = exports.TileRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
22
|
+
asChild = false,
|
|
23
|
+
value,
|
|
24
|
+
disabled: disabledProp = false,
|
|
25
|
+
isSelected: controlledSelected,
|
|
26
|
+
defaultSelected,
|
|
27
|
+
onSelectedChange,
|
|
28
|
+
children,
|
|
29
|
+
onPress,
|
|
30
|
+
onFocus,
|
|
31
|
+
onBlur,
|
|
32
|
+
style,
|
|
33
|
+
...rest
|
|
34
|
+
}, ref) => {
|
|
35
|
+
const group = (0, _context.useOptionalTileGroupContext)();
|
|
36
|
+
const [standaloneSelected = false, setStandaloneSelected] = (0, _utils.useControllableState)({
|
|
37
|
+
prop: controlledSelected,
|
|
38
|
+
defaultProp: defaultSelected ?? false,
|
|
39
|
+
onChange: next => {
|
|
40
|
+
onSelectedChange?.(next);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const isSelected = group ? group.isSelected(value) : standaloneSelected;
|
|
44
|
+
const disabledByGroup = group ? group.isTileDisabledByGroup(value) : false;
|
|
45
|
+
const isDisabled = disabledByGroup || disabledProp;
|
|
46
|
+
const cannotToggle = isDisabled;
|
|
47
|
+
const {
|
|
48
|
+
focusProps,
|
|
49
|
+
isFocused
|
|
50
|
+
} = (0, _focus.useFocus)();
|
|
51
|
+
const {
|
|
52
|
+
isFocusVisible,
|
|
53
|
+
focusProps: focusRingProps
|
|
54
|
+
} = (0, _focus.useFocusRing)();
|
|
55
|
+
const {
|
|
56
|
+
pressProps,
|
|
57
|
+
isPressed
|
|
58
|
+
} = (0, _interactions.usePress)({
|
|
59
|
+
isDisabled: cannotToggle
|
|
60
|
+
});
|
|
61
|
+
const {
|
|
62
|
+
hoverProps,
|
|
63
|
+
isHovered
|
|
64
|
+
} = (0, _interactions.useHover)();
|
|
65
|
+
|
|
66
|
+
// Standalone tiles use checkbox semantics (independent on/off toggle).
|
|
67
|
+
const selectionType = group ? group.type : 'multiple';
|
|
68
|
+
const accessibilityState = (0, _react.useMemo)(() => ({
|
|
69
|
+
disabled: isDisabled,
|
|
70
|
+
...(selectionType === 'single' ? {
|
|
71
|
+
selected: isSelected
|
|
72
|
+
} : {
|
|
73
|
+
checked: isSelected
|
|
74
|
+
})
|
|
75
|
+
}), [isDisabled, isSelected, selectionType]);
|
|
76
|
+
const tileContext = (0, _react.useMemo)(() => ({
|
|
77
|
+
value,
|
|
78
|
+
isSelected,
|
|
79
|
+
isDisabled,
|
|
80
|
+
selectionType
|
|
81
|
+
}), [value, isSelected, isDisabled, selectionType]);
|
|
82
|
+
const passthrough = rest;
|
|
83
|
+
const composedOnPress = (0, _utils.composeEventHandlers)(onPress, () => {
|
|
84
|
+
if (cannotToggle) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (group) {
|
|
88
|
+
group.toggleValue(value);
|
|
89
|
+
} else {
|
|
90
|
+
setStandaloneSelected(!standaloneSelected);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const role = selectionType === 'single' ? 'radio' : 'checkbox';
|
|
94
|
+
const Comp = asChild ? _slot.Slot : _reactNative.Pressable;
|
|
95
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.TileProvider, {
|
|
96
|
+
value: tileContext,
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
98
|
+
ref: ref,
|
|
99
|
+
accessibilityRole: role,
|
|
100
|
+
role: role,
|
|
101
|
+
accessibilityState: accessibilityState,
|
|
102
|
+
"aria-checked": isSelected,
|
|
103
|
+
...(isDisabled ? {
|
|
104
|
+
'aria-disabled': true
|
|
105
|
+
} : {}),
|
|
106
|
+
disabled: isDisabled,
|
|
107
|
+
...rest,
|
|
108
|
+
...(0, _dataAttributes.mergeDataAttributes)(rest, (0, _dataAttributes.dataAttributes)({
|
|
109
|
+
state: isSelected ? 'selected' : 'unselected',
|
|
110
|
+
disabled: isDisabled,
|
|
111
|
+
active: isPressed,
|
|
112
|
+
hover: isHovered,
|
|
113
|
+
focus: isFocused,
|
|
114
|
+
focusVisible: isFocusVisible
|
|
115
|
+
})),
|
|
116
|
+
style: [rowStyle, style],
|
|
117
|
+
onPress: isDisabled ? undefined : composedOnPress,
|
|
118
|
+
onPressIn: (0, _utils.composeEventHandlers)(passthrough.onPressIn, pressProps.onPressIn),
|
|
119
|
+
onPressOut: (0, _utils.composeEventHandlers)(passthrough.onPressOut, pressProps.onPressOut),
|
|
120
|
+
onHoverIn: (0, _utils.composeEventHandlers)(passthrough.onHoverIn, hoverProps.onHoverIn),
|
|
121
|
+
onHoverOut: (0, _utils.composeEventHandlers)(passthrough.onHoverOut, hoverProps.onHoverOut),
|
|
122
|
+
onFocus: (0, _utils.composeEventHandlers)((0, _utils.composeEventHandlers)(onFocus, focusProps.onFocus), focusRingProps.onFocus),
|
|
123
|
+
onBlur: (0, _utils.composeEventHandlers)((0, _utils.composeEventHandlers)(onBlur, focusProps.onBlur), focusRingProps.onBlur),
|
|
124
|
+
children: children
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
TileRoot.displayName = 'TileRoot';
|
|
129
|
+
//# sourceMappingURL=TileRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_focus","_interactions","_slot","_dataAttributes","_context","_jsxRuntime","rowStyle","flexDirection","alignSelf","alignItems","TileRoot","exports","forwardRef","asChild","value","disabled","disabledProp","isSelected","controlledSelected","defaultSelected","onSelectedChange","children","onPress","onFocus","onBlur","style","rest","ref","group","useOptionalTileGroupContext","standaloneSelected","setStandaloneSelected","useControllableState","prop","defaultProp","onChange","next","disabledByGroup","isTileDisabledByGroup","isDisabled","cannotToggle","focusProps","isFocused","useFocus","isFocusVisible","focusRingProps","useFocusRing","pressProps","isPressed","usePress","hoverProps","isHovered","useHover","selectionType","type","accessibilityState","useMemo","selected","checked","tileContext","passthrough","composedOnPress","composeEventHandlers","toggleValue","role","Comp","Slot","Pressable","jsx","TileProvider","accessibilityRole","mergeDataAttributes","dataAttributes","state","active","hover","focus","focusVisible","undefined","onPressIn","onPressOut","onHoverIn","onHoverOut","displayName"],"sourceRoot":"../../../src","sources":["tile/TileRoot.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TileProvider = exports.TileGroupContextProvider = void 0;
|
|
7
|
+
exports.useOptionalTileGroupContext = useOptionalTileGroupContext;
|
|
8
|
+
exports.useTileContext = void 0;
|
|
9
|
+
exports.useTileGroupContext = useTileGroupContext;
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _utils = require("@cdx-ui/utils");
|
|
12
|
+
// Per-tile subtree (selection-aware slots, indicator, etc.)
|
|
13
|
+
const [TileProvider, useTileContext] = (0, _utils.createContext)('TileContext');
|
|
14
|
+
|
|
15
|
+
// Per-group subtree (optional — standalone tiles have no provider)
|
|
16
|
+
exports.useTileContext = useTileContext;
|
|
17
|
+
exports.TileProvider = TileProvider;
|
|
18
|
+
const TileGroupContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
19
|
+
const TileGroupContextProvider = exports.TileGroupContextProvider = TileGroupContext.Provider;
|
|
20
|
+
function useTileGroupContext() {
|
|
21
|
+
const ctx = (0, _react.useContext)(TileGroupContext);
|
|
22
|
+
if (!ctx) {
|
|
23
|
+
throw new Error('Tile must be used within Tile.Group');
|
|
24
|
+
}
|
|
25
|
+
return ctx;
|
|
26
|
+
}
|
|
27
|
+
function useOptionalTileGroupContext() {
|
|
28
|
+
return (0, _react.useContext)(TileGroupContext);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_utils","TileProvider","useTileContext","createContext","exports","TileGroupContext","createReactContext","TileGroupContextProvider","Provider","useTileGroupContext","ctx","useContext","Error","useOptionalTileGroupContext"],"sourceRoot":"../../../src","sources":["tile/context.tsx"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA;AACO,MAAM,CAACE,YAAY,EAAEC,cAAc,CAAC,GAAG,IAAAC,oBAAa,EAAoB,aAAa,CAAC;;AAE7F;AAAAC,OAAA,CAAAF,cAAA,GAAAA,cAAA;AAAAE,OAAA,CAAAH,YAAA,GAAAA,YAAA;AACA,MAAMI,gBAAgB,gBAAG,IAAAC,oBAAkB,EAAgC,IAAI,CAAC;AAEzE,MAAMC,wBAAwB,GAAAH,OAAA,CAAAG,wBAAA,GAAGF,gBAAgB,CAACG,QAAQ;AAE1D,SAASC,mBAAmBA,CAAA,EAA2B;EAC5D,MAAMC,GAAG,GAAG,IAAAC,iBAAU,EAACN,gBAAgB,CAAC;EACxC,IAAI,CAACK,GAAG,EAAE;IACR,MAAM,IAAIE,KAAK,CAAC,qCAAqC,CAAC;EACxD;EACA,OAAOF,GAAG;AACZ;AAEO,SAASG,2BAA2BA,CAAA,EAAkC;EAC3E,OAAO,IAAAF,iBAAU,EAACN,gBAAgB,CAAC;AACrC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TileGroup", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TileGroup.TileGroup;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TileProvider", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _context.TileProvider;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "TileRoot", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _TileRoot.TileRoot;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "useTileContext", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _context.useTileContext;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _context = require("./context");
|
|
31
|
+
var _TileRoot = require("./TileRoot");
|
|
32
|
+
var _TileGroup = require("./TileGroup");
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_context","require","_TileRoot","_TileGroup"],"sourceRoot":"../../../src","sources":["tile/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["tile/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ToastRoot = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _slot = require("../slot");
|
|
10
|
+
var _context = require("./context");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
const ToastRoot = exports.ToastRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
13
|
+
asChild,
|
|
14
|
+
id,
|
|
15
|
+
role = 'status',
|
|
16
|
+
...viewProps
|
|
17
|
+
}, ref) => {
|
|
18
|
+
const generatedId = (0, _react.useId)();
|
|
19
|
+
const nativeID = id || generatedId;
|
|
20
|
+
const Comp = asChild ? _slot.Slot : _reactNative.View;
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ToastProvider, {
|
|
22
|
+
value: {
|
|
23
|
+
nativeID
|
|
24
|
+
},
|
|
25
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
role: role,
|
|
28
|
+
...(_reactNative.Platform.OS !== 'web' && {
|
|
29
|
+
'aria-live': role === 'alert' ? 'assertive' : 'polite',
|
|
30
|
+
'aria-atomic': true
|
|
31
|
+
}),
|
|
32
|
+
...(_reactNative.Platform.OS === 'web' && role === 'alert' && {
|
|
33
|
+
'aria-live': 'assertive'
|
|
34
|
+
}),
|
|
35
|
+
nativeID: nativeID,
|
|
36
|
+
...viewProps
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
ToastRoot.displayName = 'ToastRoot';
|
|
41
|
+
//# sourceMappingURL=ToastRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_slot","_context","_jsxRuntime","ToastRoot","exports","forwardRef","asChild","id","role","viewProps","ref","generatedId","useId","nativeID","Comp","Slot","View","jsx","ToastProvider","value","children","Platform","OS","displayName"],"sourceRoot":"../../../src","sources":["toast/ToastRoot.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAA0C,IAAAI,WAAA,GAAAJ,OAAA;AAOnC,MAAMK,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAG,IAAAE,iBAAU,EACjC,CAAC;EAAEC,OAAO;EAAEC,EAAE;EAAEC,IAAI,GAAG,QAAQ;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAG,KAAK;EACvD,MAAMC,WAAW,GAAG,IAAAC,YAAK,EAAC,CAAC;EAC3B,MAAMC,QAAQ,GAAGN,EAAE,IAAII,WAAW;EAElC,MAAMG,IAAI,GAAGR,OAAO,GAAGS,UAAI,GAAGC,iBAAI;EAElC,oBACE,IAAAd,WAAA,CAAAe,GAAA,EAAChB,QAAA,CAAAiB,aAAa;IAACC,KAAK,EAAE;MAAEN;IAAS,CAAE;IAAAO,QAAA,eACjC,IAAAlB,WAAA,CAAAe,GAAA,EAACH,IAAI;MACHJ,GAAG,EAAEA,GAAI;MACTF,IAAI,EAAEA,IAAK;MAAA,IACNa,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAI;QAC5B,WAAW,EAAEd,IAAI,KAAK,OAAO,GAAG,WAAW,GAAG,QAAQ;QACtD,aAAa,EAAE;MACjB,CAAC;MAAA,IACIa,qBAAQ,CAACC,EAAE,KAAK,KAAK,IACxBd,IAAI,KAAK,OAAO,IAAI;QAClB,WAAW,EAAE;MACf,CAAC;MACHK,QAAQ,EAAEA,QAAS;MAAA,GACfJ;IAAS,CACd;EAAC,CACW,CAAC;AAEpB,CACF,CAAC;AAEDN,SAAS,CAACoB,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useToastContext = exports.ToastProvider = void 0;
|
|
7
|
+
var _utils = require("@cdx-ui/utils");
|
|
8
|
+
const [ToastProvider, useToastContext] = (0, _utils.createContext)('ToastContext');
|
|
9
|
+
exports.useToastContext = useToastContext;
|
|
10
|
+
exports.ToastProvider = ToastProvider;
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","ToastProvider","useToastContext","createContext","exports"],"sourceRoot":"../../../src","sources":["toast/context.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAM,CAACC,aAAa,EAAEC,eAAe,CAAC,GAAG,IAAAC,oBAAa,EAAqB,cAAc,CAAC;AAACC,OAAA,CAAAF,eAAA,GAAAA,eAAA;AAAAE,OAAA,CAAAH,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ToastProvider", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _context.ToastProvider;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ToastRoot", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ToastRoot.ToastRoot;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useToastContext", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _context.useToastContext;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var _context = require("./context");
|
|
25
|
+
var _ToastRoot = require("./ToastRoot");
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_context","require","_ToastRoot"],"sourceRoot":"../../../src","sources":["toast/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["toast/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -3,30 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
function camelToKebab(str) {
|
|
19
|
-
return str.replaceAll(/[A-Z]/g, ch => `-${ch.toLowerCase()}`);
|
|
20
|
-
}
|
|
21
|
-
function dataAttributes(attrs) {
|
|
22
|
-
const result = {};
|
|
23
|
-
for (const key in attrs) {
|
|
24
|
-
const value = attrs[key];
|
|
25
|
-
if (value === undefined) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
result[`data-${camelToKebab(key)}`] = typeof value === 'boolean' ? String(value) : value;
|
|
6
|
+
Object.defineProperty(exports, "dataAttributes", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _domDataAttributes.domDataAttributes;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "mergeDataAttributes", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _domDataAttributes.mergeDomDataAttributes;
|
|
29
16
|
}
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
});
|
|
18
|
+
var _domDataAttributes = require("./domDataAttributes");
|
|
32
19
|
//# sourceMappingURL=dataAttributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_domDataAttributes","require"],"sourceRoot":"../../../src","sources":["utils/dataAttributes.ts"],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAAA,kBAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.dataAttributes = dataAttributes;
|
|
7
|
+
exports.mergeDataAttributes = mergeDataAttributes;
|
|
7
8
|
/**
|
|
8
9
|
* Produces platform-specific props for data attributes.
|
|
9
10
|
*
|
|
@@ -25,4 +26,28 @@ function dataAttributes(attrs) {
|
|
|
25
26
|
dataSet
|
|
26
27
|
};
|
|
27
28
|
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Merges multiple sources of data attributes into a single `{ dataSet }` prop
|
|
32
|
+
* on web. Each source may be a `dataAttributes()` output (`{ dataSet: {...} }`)
|
|
33
|
+
* or any props object that contains a `dataSet` key — other keys are ignored.
|
|
34
|
+
* Later sources override earlier sources on inner-key conflicts.
|
|
35
|
+
*
|
|
36
|
+
* Required when an element receives data attributes from more than one source:
|
|
37
|
+
* a plain prop spread merges by replacing the `dataSet` key entirely, so e.g.
|
|
38
|
+
* `{...dataAttributes({ slot })} {...dataAttributes({ hover })}` keeps only the
|
|
39
|
+
* second `dataSet`. Use `mergeDataAttributes(...)` to combine them safely.
|
|
40
|
+
*/
|
|
41
|
+
function mergeDataAttributes(...sources) {
|
|
42
|
+
const dataSet = {};
|
|
43
|
+
for (const source of sources) {
|
|
44
|
+
if (!source) continue;
|
|
45
|
+
const sourceDataSet = source.dataSet;
|
|
46
|
+
if (!sourceDataSet) continue;
|
|
47
|
+
Object.assign(dataSet, sourceDataSet);
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
dataSet
|
|
51
|
+
};
|
|
52
|
+
}
|
|
28
53
|
//# sourceMappingURL=dataAttributes.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dataAttributes","attrs","dataSet","key","value"],"sourceRoot":"../../../src","sources":["utils/dataAttributes.web.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["dataAttributes","attrs","dataSet","key","value","mergeDataAttributes","sources","source","sourceDataSet","Object","assign"],"sourceRoot":"../../../src","sources":["utils/dataAttributes.web.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIO,SAASA,cAAcA,CAACC,KAAyC,EAEtE;EACA,MAAMC,OAAyC,GAAG,CAAC,CAAC;EACpD,KAAK,MAAMC,GAAG,IAAIF,KAAK,EAAE;IACvB,MAAMG,KAAK,GAAGH,KAAK,CAACE,GAAG,CAAC;IAExBD,OAAO,CAACC,GAAG,CAAC,GAAGC,KAAK,IAAI,KAAK;EAC/B;EACA,OAAO;IAAEF;EAAQ,CAAC;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CACjC,GAAGC,OAAwF,EACrD;EACtC,MAAMJ,OAAgC,GAAG,CAAC,CAAC;EAC3C,KAAK,MAAMK,MAAM,IAAID,OAAO,EAAE;IAC5B,IAAI,CAACC,MAAM,EAAE;IACb,MAAMC,aAAa,GAAID,MAAM,CAA2CL,OAAO;IAC/E,IAAI,CAACM,aAAa,EAAE;IACpBC,MAAM,CAACC,MAAM,CAACR,OAAO,EAAEM,aAAa,CAAC;EACvC;EACA,OAAO;IAAEN;EAAQ,CAAC;AACpB","ignoreList":[]}
|