@central-ui/react 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +31 -2
- package/dist/components/accordion/index.d.ts +73 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +92 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/autocomplete/index.d.ts +365 -0
- package/dist/components/autocomplete/index.d.ts.map +1 -0
- package/dist/components/autocomplete/index.js +369 -0
- package/dist/components/autocomplete/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +48 -0
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +60 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +29 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/badge/index.js +36 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/banner/index.d.ts +71 -0
- package/dist/components/banner/index.d.ts.map +1 -0
- package/dist/components/banner/index.js +119 -0
- package/dist/components/banner/index.js.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +31 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.js +42 -0
- package/dist/components/breadcrumb/index.js.map +1 -0
- package/dist/components/button/index.d.ts +48 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +60 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/card/index.d.ts +34 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/card/index.js +45 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +66 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/index.js +146 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/chip/index.d.ts +26 -0
- package/dist/components/chip/index.d.ts.map +1 -0
- package/dist/components/chip/index.js +40 -0
- package/dist/components/chip/index.js.map +1 -0
- package/dist/components/combobox/index.d.ts +427 -0
- package/dist/components/combobox/index.d.ts.map +1 -0
- package/dist/components/combobox/index.js +416 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/datepicker/index.d.ts +297 -0
- package/dist/components/datepicker/index.d.ts.map +1 -0
- package/dist/components/datepicker/index.js +507 -0
- package/dist/components/datepicker/index.js.map +1 -0
- package/dist/components/dialog/index.d.ts +88 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/index.js +102 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/divider/index.d.ts +21 -0
- package/dist/components/divider/index.d.ts.map +1 -0
- package/dist/components/divider/index.js +24 -0
- package/dist/components/divider/index.js.map +1 -0
- package/dist/components/drawer/index.d.ts +99 -0
- package/dist/components/drawer/index.d.ts.map +1 -0
- package/dist/components/drawer/index.js +137 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/empty/index.d.ts +40 -0
- package/dist/components/empty/index.d.ts.map +1 -0
- package/dist/components/empty/index.js +61 -0
- package/dist/components/empty/index.js.map +1 -0
- package/dist/components/fileupload/index.d.ts +107 -0
- package/dist/components/fileupload/index.d.ts.map +1 -0
- package/dist/components/fileupload/index.js +185 -0
- package/dist/components/fileupload/index.js.map +1 -0
- package/dist/components/form/index.d.ts +34 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/index.js +35 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/input/index.d.ts +85 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/index.js +249 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/menu/index.d.ts +115 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +188 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/metric/index.d.ts +24 -0
- package/dist/components/metric/index.d.ts.map +1 -0
- package/dist/components/metric/index.js +26 -0
- package/dist/components/metric/index.js.map +1 -0
- package/dist/components/numberinput/index.d.ts +105 -0
- package/dist/components/numberinput/index.d.ts.map +1 -0
- package/dist/components/numberinput/index.js +240 -0
- package/dist/components/numberinput/index.js.map +1 -0
- package/dist/components/otpinput/index.d.ts +63 -0
- package/dist/components/otpinput/index.d.ts.map +1 -0
- package/dist/components/otpinput/index.js +133 -0
- package/dist/components/otpinput/index.js.map +1 -0
- package/dist/components/page/index.d.ts +54 -0
- package/dist/components/page/index.d.ts.map +1 -0
- package/dist/components/page/index.js +100 -0
- package/dist/components/page/index.js.map +1 -0
- package/dist/components/passwordinput/index.d.ts +88 -0
- package/dist/components/passwordinput/index.d.ts.map +1 -0
- package/dist/components/passwordinput/index.js +251 -0
- package/dist/components/passwordinput/index.js.map +1 -0
- package/dist/components/popover/index.d.ts +67 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popover/index.js +76 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/radio/index.d.ts +90 -0
- package/dist/components/radio/index.d.ts.map +1 -0
- package/dist/components/radio/index.js +232 -0
- package/dist/components/radio/index.js.map +1 -0
- package/dist/components/ratinginput/index.d.ts +59 -0
- package/dist/components/ratinginput/index.d.ts.map +1 -0
- package/dist/components/ratinginput/index.js +88 -0
- package/dist/components/ratinginput/index.js.map +1 -0
- package/dist/components/select/index.d.ts +205 -0
- package/dist/components/select/index.d.ts.map +1 -0
- package/dist/components/select/index.js +234 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +19 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +20 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +72 -0
- package/dist/components/slider/index.d.ts.map +1 -0
- package/dist/components/slider/index.js +159 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/spinner/index.d.ts +14 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/index.js +15 -0
- package/dist/components/spinner/index.js.map +1 -0
- package/dist/components/splitter/index.d.ts +49 -0
- package/dist/components/splitter/index.d.ts.map +1 -0
- package/dist/components/splitter/index.js +67 -0
- package/dist/components/splitter/index.js.map +1 -0
- package/dist/components/stepper/index.d.ts +82 -0
- package/dist/components/stepper/index.d.ts.map +1 -0
- package/dist/components/stepper/index.js +100 -0
- package/dist/components/stepper/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +57 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/switch/index.js +101 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/table/index.d.ts +110 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +211 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +67 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/index.js +78 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/textarea/index.d.ts +72 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/textarea/index.js +205 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/textlink/index.d.ts +39 -0
- package/dist/components/textlink/index.d.ts.map +1 -0
- package/dist/components/textlink/index.js +42 -0
- package/dist/components/textlink/index.js.map +1 -0
- package/dist/components/toast/index.d.ts +111 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/components/toast/index.js +205 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/components/toggle/index.d.ts +41 -0
- package/dist/components/toggle/index.d.ts.map +1 -0
- package/dist/components/toggle/index.js +78 -0
- package/dist/components/toggle/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +44 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/index.js +51 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/types/Style.d.ts +14 -0
- package/dist/types/Style.d.ts.map +1 -0
- package/dist/types/Style.js +2 -0
- package/dist/types/Style.js.map +1 -0
- package/dist/types/Tone.d.ts +4 -0
- package/dist/types/Tone.d.ts.map +1 -0
- package/dist/types/Tone.js +2 -0
- package/dist/types/Tone.js.map +1 -0
- package/dist/utils/ArkStateToDataAttributes.d.ts +4 -0
- package/dist/utils/ArkStateToDataAttributes.d.ts.map +1 -0
- package/dist/utils/ArkStateToDataAttributes.js +9 -0
- package/dist/utils/ArkStateToDataAttributes.js.map +1 -0
- package/dist/utils/Tone.d.ts +3 -0
- package/dist/utils/Tone.d.ts.map +1 -0
- package/dist/utils/Tone.js +7 -0
- package/dist/utils/Tone.js.map +1 -0
- package/dist/utils/useForwardClickToInput.d.ts +4 -0
- package/dist/utils/useForwardClickToInput.d.ts.map +1 -0
- package/dist/utils/useForwardClickToInput.js +27 -0
- package/dist/utils/useForwardClickToInput.js.map +1 -0
- package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts +198 -0
- package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts.map +1 -0
- package/dist/utils/virtualization/useVirtualizedAutocomplete.js +180 -0
- package/dist/utils/virtualization/useVirtualizedAutocomplete.js.map +1 -0
- package/dist/utils/virtualization/useVirtualizedCombobox.d.ts +200 -0
- package/dist/utils/virtualization/useVirtualizedCombobox.d.ts.map +1 -0
- package/dist/utils/virtualization/useVirtualizedCombobox.js +174 -0
- package/dist/utils/virtualization/useVirtualizedCombobox.js.map +1 -0
- package/dist/utils/virtualization/useVirtualizedTable.d.ts +169 -0
- package/dist/utils/virtualization/useVirtualizedTable.d.ts.map +1 -0
- package/dist/utils/virtualization/useVirtualizedTable.js +127 -0
- package/dist/utils/virtualization/useVirtualizedTable.js.map +1 -0
- package/package.json +64 -4
- package/src/presets/shopify-polaris/shopify-polaris-accordion.css +28 -0
- package/src/presets/shopify-polaris/shopify-polaris-autocomplete.css +155 -0
- package/src/presets/shopify-polaris/shopify-polaris-avatar.css +47 -0
- package/src/presets/shopify-polaris/shopify-polaris-badge.css +27 -0
- package/src/presets/shopify-polaris/shopify-polaris-banner.css +111 -0
- package/src/presets/shopify-polaris/shopify-polaris-breadcrumb.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-button.css +79 -0
- package/src/presets/shopify-polaris/shopify-polaris-card.css +28 -0
- package/src/presets/shopify-polaris/shopify-polaris-checkbox.css +52 -0
- package/src/presets/shopify-polaris/shopify-polaris-chip.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-combobox.css +179 -0
- package/src/presets/shopify-polaris/shopify-polaris-datepicker.css +183 -0
- package/src/presets/shopify-polaris/shopify-polaris-dialog.css +40 -0
- package/src/presets/shopify-polaris/shopify-polaris-divider.css +12 -0
- package/src/presets/shopify-polaris/shopify-polaris-drawer.css +40 -0
- package/src/presets/shopify-polaris/shopify-polaris-empty.css +32 -0
- package/src/presets/shopify-polaris/shopify-polaris-fileupload.css +78 -0
- package/src/presets/shopify-polaris/shopify-polaris-form.css +8 -0
- package/src/presets/shopify-polaris/shopify-polaris-input.css +72 -0
- package/src/presets/shopify-polaris/shopify-polaris-menu.css +112 -0
- package/src/presets/shopify-polaris/shopify-polaris-metric.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-numberinput.css +88 -0
- package/src/presets/shopify-polaris/shopify-polaris-otpinput.css +42 -0
- package/src/presets/shopify-polaris/shopify-polaris-page.css +69 -0
- package/src/presets/shopify-polaris/shopify-polaris-passwordinput.css +76 -0
- package/src/presets/shopify-polaris/shopify-polaris-popover.css +47 -0
- package/src/presets/shopify-polaris/shopify-polaris-radio.css +54 -0
- package/src/presets/shopify-polaris/shopify-polaris-ratinginput.css +42 -0
- package/src/presets/shopify-polaris/shopify-polaris-select.css +119 -0
- package/src/presets/shopify-polaris/shopify-polaris-skeleton.css +8 -0
- package/src/presets/shopify-polaris/shopify-polaris-slider.css +86 -0
- package/src/presets/shopify-polaris/shopify-polaris-spinner.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-splitter.css +34 -0
- package/src/presets/shopify-polaris/shopify-polaris-stepper.css +55 -0
- package/src/presets/shopify-polaris/shopify-polaris-switch.css +38 -0
- package/src/presets/shopify-polaris/shopify-polaris-table.css +72 -0
- package/src/presets/shopify-polaris/shopify-polaris-tabs.css +33 -0
- package/src/presets/shopify-polaris/shopify-polaris-textarea.css +61 -0
- package/src/presets/shopify-polaris/shopify-polaris-textlink.css +8 -0
- package/src/presets/shopify-polaris/shopify-polaris-toggle.css +52 -0
- package/src/presets/shopify-polaris/shopify-polaris-tooltip.css +31 -0
- package/src/presets/shopify-polaris/shopify-polaris.css +380 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-accordion.css +28 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-autocomplete.css +155 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-avatar.css +47 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-badge.css +27 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-banner.css +96 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-breadcrumb.css +16 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-button.css +68 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-card.css +28 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-checkbox.css +52 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-chip.css +16 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-combobox.css +184 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-datepicker.css +187 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-dialog.css +40 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-divider.css +12 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-drawer.css +40 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-empty.css +32 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-fileupload.css +72 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-form.css +8 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-input.css +72 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-menu.css +112 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-metric.css +16 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-numberinput.css +88 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-otpinput.css +42 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-page.css +69 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-passwordinput.css +76 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-popover.css +47 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-radio.css +54 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-ratinginput.css +42 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-select.css +118 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-skeleton.css +8 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-slider.css +86 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-spinner.css +16 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-splitter.css +34 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-stepper.css +55 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-switch.css +38 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-table.css +72 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tabs.css +33 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textarea.css +61 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textlink.css +8 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-toast.css +43 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-toggle.css +52 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tooltip.css +31 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css +381 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Root as RadixRoot, Input as RadixInput, Toggle as RadixToggle, Slot as RadixSlot, } from '@radix-ui/react-password-toggle-field';
|
|
3
|
+
import { Input as BaseInput } from '@base-ui/react/input';
|
|
4
|
+
import { Eye, EyeOff, LoaderCircle } from 'lucide-react';
|
|
5
|
+
import { useRef } from 'react';
|
|
6
|
+
import { useForwardClickToInput } from "../../utils/useForwardClickToInput.js";
|
|
7
|
+
import { cloneElement, createContext, forwardRef, useContext, useEffect, useId, useState, } from 'react';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import { ToneProvider, useToneContext } from "../../utils/Tone.js";
|
|
10
|
+
/**
|
|
11
|
+
* Configure the password on Root and use Input inside InputGroup. AddonVisibilityButton toggles visibility automatically; its visible/hidden icons follow that state. Do not maintain a second visibility state.
|
|
12
|
+
*
|
|
13
|
+
* @example Complete composition
|
|
14
|
+
* import { PasswordInput } from '@central-ui/react'
|
|
15
|
+
*
|
|
16
|
+
* function Example() {
|
|
17
|
+
* return (
|
|
18
|
+
* <PasswordInput.Root defaultValue="correct-horse" name="password">
|
|
19
|
+
* <PasswordInput.Container>
|
|
20
|
+
* <PasswordInput.Label>Password</PasswordInput.Label>
|
|
21
|
+
* <PasswordInput.InputGroup>
|
|
22
|
+
* <PasswordInput.Input
|
|
23
|
+
* autoComplete="current-password"
|
|
24
|
+
* placeholder="Enter password"
|
|
25
|
+
* />
|
|
26
|
+
* <PasswordInput.Addon>
|
|
27
|
+
* <PasswordInput.AddonVisibilityButton>
|
|
28
|
+
* <PasswordInput.AddonVisibleIcon></PasswordInput.AddonVisibleIcon>
|
|
29
|
+
* <PasswordInput.AddonHiddenIcon></PasswordInput.AddonHiddenIcon>
|
|
30
|
+
* </PasswordInput.AddonVisibilityButton>
|
|
31
|
+
* </PasswordInput.Addon>
|
|
32
|
+
* </PasswordInput.InputGroup>
|
|
33
|
+
* <PasswordInput.Description>Use your account password.</PasswordInput.Description>
|
|
34
|
+
* </PasswordInput.Container>
|
|
35
|
+
* </PasswordInput.Root>
|
|
36
|
+
* )
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* @example Start with the password visible
|
|
40
|
+
* // Visibility belongs to Root; the same icons and visibility button keep working.
|
|
41
|
+
* ;<PasswordInput.Root defaultVisible>
|
|
42
|
+
* {
|
|
43
|
+
* // Rest of components here
|
|
44
|
+
* }
|
|
45
|
+
* </PasswordInput.Root>
|
|
46
|
+
*/
|
|
47
|
+
export function Root({ children, id, tone = 'neutral', value, defaultValue, onValueChange, disabled = false, readOnly = false, required = false, name, form, ...props }) {
|
|
48
|
+
const generatedId = useId();
|
|
49
|
+
const inputId = id ?? generatedId;
|
|
50
|
+
const [valueInternalState, setValueInternalState] = useState(defaultValue ?? '');
|
|
51
|
+
const [connections, setConnections] = useState({
|
|
52
|
+
descriptionIds: [],
|
|
53
|
+
});
|
|
54
|
+
return (_jsx(RadixRoot, { ...props, id: inputId, children: _jsx(InputContext.Provider, { value: {
|
|
55
|
+
inputId,
|
|
56
|
+
disabled,
|
|
57
|
+
readOnly,
|
|
58
|
+
required,
|
|
59
|
+
value: value ?? valueInternalState,
|
|
60
|
+
defaultValue,
|
|
61
|
+
controlled: value !== undefined,
|
|
62
|
+
setValueInternalState,
|
|
63
|
+
onValueChange,
|
|
64
|
+
coreProps: { name, form },
|
|
65
|
+
connections,
|
|
66
|
+
setConnections,
|
|
67
|
+
}, children: _jsx(ToneProvider, { value: tone, children: children }) }) }));
|
|
68
|
+
}
|
|
69
|
+
export const Input = forwardRef(function Input({ disableStyle, className, 'aria-describedby': describedBy, ...props }, ref) {
|
|
70
|
+
const context = useInputContext();
|
|
71
|
+
const tone = useToneContext();
|
|
72
|
+
const inputRef = useRef(null);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const form = inputRef.current?.form;
|
|
75
|
+
if (!form || context.controlled)
|
|
76
|
+
return;
|
|
77
|
+
const reset = (event) => {
|
|
78
|
+
queueMicrotask(() => {
|
|
79
|
+
if (!event.defaultPrevented)
|
|
80
|
+
context.setValueInternalState(context.defaultValue ?? '');
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
form.addEventListener('reset', reset);
|
|
84
|
+
return () => form.removeEventListener('reset', reset);
|
|
85
|
+
}, [
|
|
86
|
+
context.controlled,
|
|
87
|
+
context.defaultValue,
|
|
88
|
+
context.setValueInternalState,
|
|
89
|
+
context.coreProps.form,
|
|
90
|
+
]);
|
|
91
|
+
return (_jsx(RadixInput, { asChild: true, id: context.inputId, children: _jsx(BaseInput, { ...context.coreProps, ...props, id: context.inputId, disabled: context.disabled, readOnly: context.readOnly, required: context.required, value: context.value, "data-tone": tone, "aria-invalid": tone === 'invalid' || props['aria-invalid'] || undefined, "aria-describedby": [describedBy, ...context.connections.descriptionIds]
|
|
92
|
+
.filter(Boolean)
|
|
93
|
+
.join(' ') || undefined, ref: (element) => {
|
|
94
|
+
inputRef.current = element;
|
|
95
|
+
if (typeof ref === 'function')
|
|
96
|
+
ref(inputRef.current);
|
|
97
|
+
else if (ref)
|
|
98
|
+
ref.current = inputRef.current;
|
|
99
|
+
}, onValueChange: (nextValue, details) => {
|
|
100
|
+
context.onValueChange?.(nextValue, details);
|
|
101
|
+
if (!details.isCanceled && !context.controlled)
|
|
102
|
+
context.setValueInternalState(nextValue);
|
|
103
|
+
}, "data-component": "passwordinput-input", "data-style-disabled": disableStyle ? '' : undefined, className: className }) }));
|
|
104
|
+
});
|
|
105
|
+
export const InputGroup = forwardRef(function InputGroup({ disableStyle, className, onClick, ...props }, ref) {
|
|
106
|
+
const attributes = usePartAttributes();
|
|
107
|
+
const forwardClick = useForwardClickToInput('input:not([type="hidden"])', onClick);
|
|
108
|
+
return (_jsx("div", { ...attributes, ...props, ref: ref, onClick: forwardClick, "data-component": "passwordinput-inputgroup", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
109
|
+
});
|
|
110
|
+
export const Container = forwardRef(function Container({ disableStyle, className, ...props }, ref) {
|
|
111
|
+
const attributes = usePartAttributes();
|
|
112
|
+
return (_jsx("div", { ...attributes, ...props, ref: ref, "data-component": "passwordinput-container", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
113
|
+
});
|
|
114
|
+
/** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
|
|
115
|
+
export const Label = forwardRef(function Label({ disableStyle, className, id, ...props }, ref) {
|
|
116
|
+
const context = useInputContext();
|
|
117
|
+
const labelId = id ?? context.inputId + '-label';
|
|
118
|
+
const attributes = usePartAttributes();
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
context.setConnections((current) => ({ ...current, labelId }));
|
|
121
|
+
return () => context.setConnections((current) => ({
|
|
122
|
+
...current,
|
|
123
|
+
labelId: current.labelId === labelId ? undefined : current.labelId,
|
|
124
|
+
}));
|
|
125
|
+
}, [labelId, context.setConnections]);
|
|
126
|
+
return (_jsx("label", { ...attributes, ...props, id: labelId, ref: ref, htmlFor: context.inputId, "data-component": "passwordinput-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
127
|
+
});
|
|
128
|
+
export const Description = forwardRef(function Description({ disableStyle, className, id, ...props }, ref) {
|
|
129
|
+
const messageId = useMessageId(id);
|
|
130
|
+
const attributes = usePartAttributes();
|
|
131
|
+
return (_jsx("div", { ...attributes, ...props, id: messageId, ref: ref, "data-component": "passwordinput-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
132
|
+
});
|
|
133
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
134
|
+
export const Error = forwardRef(function Error({ disableStyle, className, id, ...props }, ref) {
|
|
135
|
+
const messageId = useMessageId(id);
|
|
136
|
+
const attributes = usePartAttributes();
|
|
137
|
+
return (_jsx("div", { role: "alert", "aria-atomic": "true", ...attributes, ...props, id: messageId, ref: ref, "data-component": "passwordinput-error", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
138
|
+
});
|
|
139
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
140
|
+
export const Success = forwardRef(function Success({ disableStyle, className, id, ...props }, ref) {
|
|
141
|
+
const messageId = useMessageId(id);
|
|
142
|
+
const attributes = usePartAttributes();
|
|
143
|
+
return (_jsx("div", { role: "status", "aria-atomic": "true", ...attributes, ...props, id: messageId, ref: ref, "data-component": "passwordinput-success", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
144
|
+
});
|
|
145
|
+
export const Addon = forwardRef(function Addon({ disableStyle, className, variant = 'normal', ...props }, ref) {
|
|
146
|
+
const attributes = usePartAttributes();
|
|
147
|
+
return (_jsx("div", { ...attributes, ...props, ref: ref, "data-variant": variant, "data-component": "passwordinput-addon", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
148
|
+
});
|
|
149
|
+
export const AddonText = forwardRef(function AddonText({ disableStyle, className, ...props }, ref) {
|
|
150
|
+
const attributes = usePartAttributes();
|
|
151
|
+
return (_jsx("span", { ...attributes, ...props, ref: ref, "data-component": "passwordinput-addontext", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
152
|
+
});
|
|
153
|
+
/** Supply the decorative icon as a child. Its classes are preserved; interaction belongs to the surrounding control. */
|
|
154
|
+
export function AddonIcon({ disableStyle, children, className, ...props }) {
|
|
155
|
+
const attributes = usePartAttributes();
|
|
156
|
+
return cloneElement(children, {
|
|
157
|
+
...attributes,
|
|
158
|
+
...props,
|
|
159
|
+
'aria-hidden': true,
|
|
160
|
+
strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
|
|
161
|
+
...{
|
|
162
|
+
'data-component': 'passwordinput-addonicon',
|
|
163
|
+
'data-style-disabled': disableStyle ? '' : undefined,
|
|
164
|
+
},
|
|
165
|
+
className: twMerge(children.props.className, className),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
export const AddonButton = forwardRef(function AddonButton({ disableStyle, className, disabled, type = 'button', ...props }, ref) {
|
|
169
|
+
const context = useInputContext();
|
|
170
|
+
const attributes = usePartAttributes();
|
|
171
|
+
return (_jsx("button", { ...attributes, ...props, ref: ref, type: type, disabled: disabled || context.disabled || context.readOnly, "data-component": "passwordinput-addonbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
172
|
+
});
|
|
173
|
+
/** Built-in icon; no children needed. Use it inside its matching control. */
|
|
174
|
+
export const AddonLoadingIcon = forwardRef(function AddonLoadingIcon({ disableStyle, className, strokeWidth = 1.5, ...props }, ref) {
|
|
175
|
+
const attributes = usePartAttributes();
|
|
176
|
+
return (_jsx(LoaderCircle, { ...attributes, "aria-hidden": true, ...props, ref: ref, strokeWidth: strokeWidth, "data-component": "passwordinput-addonloadingicon", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
177
|
+
});
|
|
178
|
+
/** Toggles password visibility automatically; do not maintain another visibility state. */
|
|
179
|
+
export const AddonVisibilityButton = forwardRef(function AddonVisibilityButton({ disableStyle, className, disabled, id, ...props }, ref) {
|
|
180
|
+
const context = useInputContext();
|
|
181
|
+
const attributes = usePartAttributes();
|
|
182
|
+
return (_jsx(RadixToggle, { ...attributes, ...props, id: id ?? context.inputId + '-toggle', ref: ref, disabled: disabled || context.disabled || context.readOnly, "data-component": "passwordinput-addonvisibilitybutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
183
|
+
});
|
|
184
|
+
/** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
|
|
185
|
+
export function AddonVisibleIcon({ disableStyle, children = _jsx(EyeOff, {}), className, ...props }) {
|
|
186
|
+
const attributes = usePartAttributes();
|
|
187
|
+
const icon = cloneElement(children, {
|
|
188
|
+
...attributes,
|
|
189
|
+
...props,
|
|
190
|
+
...{ 'data-visible': '' },
|
|
191
|
+
'aria-hidden': true,
|
|
192
|
+
strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
|
|
193
|
+
...{
|
|
194
|
+
'data-component': 'passwordinput-addonvisibleicon',
|
|
195
|
+
'data-style-disabled': disableStyle ? '' : undefined,
|
|
196
|
+
},
|
|
197
|
+
className: twMerge(children.props.className, className),
|
|
198
|
+
});
|
|
199
|
+
return _jsx(RadixSlot, { visible: icon, hidden: null });
|
|
200
|
+
}
|
|
201
|
+
/** A default icon is supplied. Omit children for the usual case; pass an icon only to replace that visual. */
|
|
202
|
+
export function AddonHiddenIcon({ disableStyle, children = _jsx(Eye, {}), className, ...props }) {
|
|
203
|
+
const attributes = usePartAttributes();
|
|
204
|
+
const icon = cloneElement(children, {
|
|
205
|
+
...attributes,
|
|
206
|
+
...props,
|
|
207
|
+
...{ 'data-visible': undefined },
|
|
208
|
+
'aria-hidden': true,
|
|
209
|
+
strokeWidth: props.strokeWidth ?? children.props.strokeWidth ?? 1.5,
|
|
210
|
+
...{
|
|
211
|
+
'data-component': 'passwordinput-addonhiddenicon',
|
|
212
|
+
'data-style-disabled': disableStyle ? '' : undefined,
|
|
213
|
+
},
|
|
214
|
+
className: twMerge(children.props.className, className),
|
|
215
|
+
});
|
|
216
|
+
return _jsx(RadixSlot, { visible: null, hidden: icon });
|
|
217
|
+
}
|
|
218
|
+
const InputContext = createContext(null);
|
|
219
|
+
function useInputContext() {
|
|
220
|
+
const context = useContext(InputContext);
|
|
221
|
+
if (!context)
|
|
222
|
+
throw new globalThis.Error('Parts must be inside Root');
|
|
223
|
+
return context;
|
|
224
|
+
}
|
|
225
|
+
function usePartAttributes() {
|
|
226
|
+
const context = useInputContext();
|
|
227
|
+
const tone = useToneContext();
|
|
228
|
+
return {
|
|
229
|
+
'data-disabled': context.disabled ? '' : undefined,
|
|
230
|
+
'data-readonly': context.readOnly ? '' : undefined,
|
|
231
|
+
'data-required': context.required ? '' : undefined,
|
|
232
|
+
'data-tone': tone,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function useMessageId(id) {
|
|
236
|
+
const generatedId = useId();
|
|
237
|
+
const messageId = id ?? generatedId;
|
|
238
|
+
const context = useInputContext();
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
context.setConnections((current) => ({
|
|
241
|
+
...current,
|
|
242
|
+
descriptionIds: [...current.descriptionIds, messageId],
|
|
243
|
+
}));
|
|
244
|
+
return () => context.setConnections((current) => ({
|
|
245
|
+
...current,
|
|
246
|
+
descriptionIds: current.descriptionIds.filter((id) => id !== messageId),
|
|
247
|
+
}));
|
|
248
|
+
}, [messageId, context.setConnections]);
|
|
249
|
+
return messageId;
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/passwordinput/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,IAAI,IAAI,SAAS,EACjB,KAAK,IAAI,UAAU,EACnB,MAAM,IAAI,WAAW,EACrB,IAAI,IAAI,SAAS,GAClB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAC9E,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAA;AASd,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAgBnE;;;;;;;;;;;;;;;;;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C,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { StyleProps } from '../../types/Style.ts';
|
|
2
|
+
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
3
|
+
import type { ComponentPropsWithRef, ReactElement } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* OpenHandler and CloseHandler add behavior to their button children. Popup already includes its portal and positioner. Use Header/Body/Footer as needed; an Arrow is optional.
|
|
6
|
+
*
|
|
7
|
+
* @example Complete composition
|
|
8
|
+
* import { Button, Popover } from '@central-ui/react'
|
|
9
|
+
*
|
|
10
|
+
* function Example() {
|
|
11
|
+
* return (
|
|
12
|
+
* <Popover.Root>
|
|
13
|
+
* <Popover.OpenHandler>
|
|
14
|
+
* <Button.default variant="secondary">Account</Button.default>
|
|
15
|
+
* </Popover.OpenHandler>
|
|
16
|
+
* <Popover.Popup>
|
|
17
|
+
* <Popover.Header>
|
|
18
|
+
* <Popover.Title>Account</Popover.Title>
|
|
19
|
+
* <Popover.Description>Manage your account preferences.</Popover.Description>
|
|
20
|
+
* </Popover.Header>
|
|
21
|
+
* <Popover.Body>Account settings go here.</Popover.Body>
|
|
22
|
+
* <Popover.Footer>
|
|
23
|
+
* <Popover.CloseHandler>
|
|
24
|
+
* <Button.default variant="primary">Done</Button.default>
|
|
25
|
+
* </Popover.CloseHandler>
|
|
26
|
+
* </Popover.Footer>
|
|
27
|
+
* </Popover.Popup>
|
|
28
|
+
* </Popover.Root>
|
|
29
|
+
* )
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* @example Prefer a different side and show an arrow
|
|
33
|
+
* // Replace only Popup's configuration, keeping the same content sections.
|
|
34
|
+
* ;<Popover.Popup side="right" align="center">
|
|
35
|
+
* <Popover.Arrow />
|
|
36
|
+
* Details
|
|
37
|
+
* </Popover.Popup>
|
|
38
|
+
*/
|
|
39
|
+
export declare const Root: typeof BasePopover.Root;
|
|
40
|
+
/** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
|
|
41
|
+
export declare const OpenHandler: import("react").ForwardRefExoticComponent<Omit<Omit<BasePopover.Trigger.Props<unknown>, "children" | "className" | "render"> & {
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Supply your own accessible control. It receives the behavior; its own className owns the appearance. */
|
|
44
|
+
children: ReactElement;
|
|
45
|
+
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
export type PopupProps = Omit<ComponentPropsWithRef<typeof BasePopover.Popup>, 'className'> & {
|
|
47
|
+
className?: string;
|
|
48
|
+
} & Pick<BasePopover.Portal.Props, 'container' | 'keepMounted'> & Pick<BasePopover.Positioner.Props, 'anchor' | 'positionMethod' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'arrowPadding' | 'disableAnchorTracking' | 'collisionAvoidance'> & StyleProps;
|
|
49
|
+
/** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
|
|
50
|
+
export declare function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }: PopupProps & StyleProps): import("react").JSX.Element;
|
|
51
|
+
export declare const Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "children" | "dangerouslySetInnerHTML"> & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
52
|
+
/** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
|
|
53
|
+
export declare const CloseHandler: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverCloseProps, "children" | "className" | "render"> & {
|
|
54
|
+
className?: string;
|
|
55
|
+
/** Supply your own accessible control. It receives the behavior; its own className owns the appearance. */
|
|
56
|
+
children: ReactElement;
|
|
57
|
+
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
58
|
+
export declare const Header: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export declare const Body: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export declare const Footer: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
61
|
+
export declare const Title: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverTitleProps, "className"> & {
|
|
62
|
+
className?: string;
|
|
63
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
64
|
+
export declare const Description: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").PopoverDescriptionProps, "className"> & {
|
|
65
|
+
className?: string;
|
|
66
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,EAAkB,qBAAqB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,IAAI,yBAAmB,CAAA;AACpC,8IAA8I;AAC9I,eAAO,MAAM,WAAW;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jsx-runtime";
|
|
2
|
+
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* OpenHandler and CloseHandler add behavior to their button children. Popup already includes its portal and positioner. Use Header/Body/Footer as needed; an Arrow is optional.
|
|
6
|
+
*
|
|
7
|
+
* @example Complete composition
|
|
8
|
+
* import { Button, Popover } from '@central-ui/react'
|
|
9
|
+
*
|
|
10
|
+
* function Example() {
|
|
11
|
+
* return (
|
|
12
|
+
* <Popover.Root>
|
|
13
|
+
* <Popover.OpenHandler>
|
|
14
|
+
* <Button.default variant="secondary">Account</Button.default>
|
|
15
|
+
* </Popover.OpenHandler>
|
|
16
|
+
* <Popover.Popup>
|
|
17
|
+
* <Popover.Header>
|
|
18
|
+
* <Popover.Title>Account</Popover.Title>
|
|
19
|
+
* <Popover.Description>Manage your account preferences.</Popover.Description>
|
|
20
|
+
* </Popover.Header>
|
|
21
|
+
* <Popover.Body>Account settings go here.</Popover.Body>
|
|
22
|
+
* <Popover.Footer>
|
|
23
|
+
* <Popover.CloseHandler>
|
|
24
|
+
* <Button.default variant="primary">Done</Button.default>
|
|
25
|
+
* </Popover.CloseHandler>
|
|
26
|
+
* </Popover.Footer>
|
|
27
|
+
* </Popover.Popup>
|
|
28
|
+
* </Popover.Root>
|
|
29
|
+
* )
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* @example Prefer a different side and show an arrow
|
|
33
|
+
* // Replace only Popup's configuration, keeping the same content sections.
|
|
34
|
+
* ;<Popover.Popup side="right" align="center">
|
|
35
|
+
* <Popover.Arrow />
|
|
36
|
+
* Details
|
|
37
|
+
* </Popover.Popup>
|
|
38
|
+
*/
|
|
39
|
+
export const Root = BasePopover.Root;
|
|
40
|
+
/** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
|
|
41
|
+
export const OpenHandler = forwardRef(function OpenHandler({ children, ...props }, ref) {
|
|
42
|
+
return _jsx(BasePopover.Trigger, { ...props, ref: ref, render: children });
|
|
43
|
+
});
|
|
44
|
+
/** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
|
|
45
|
+
export function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side = 'bottom', sideOffset = 5, align = 'start', alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }) {
|
|
46
|
+
const baseStyle = {
|
|
47
|
+
maxHeight: 'var(--available-height)',
|
|
48
|
+
maxWidth: 'var(--available-width)',
|
|
49
|
+
};
|
|
50
|
+
return (_jsx(BasePopover.Portal, { container: container, keepMounted: keepMounted, children: _jsx(BasePopover.Positioner, { anchor: anchor, positionMethod: positionMethod, side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, collisionBoundary: collisionBoundary, collisionPadding: collisionPadding, sticky: sticky, arrowPadding: arrowPadding, disableAnchorTracking: disableAnchorTracking, collisionAvoidance: collisionAvoidance, style: { zIndex: 80, maxWidth: 'var(--available-width)' }, children: _jsx(BasePopover.Popup, { ...props, "data-component": "popover-popup", "data-style-disabled": disableStyle ? '' : undefined, className: className, style: typeof style === 'function'
|
|
51
|
+
? (state) => ({ ...baseStyle, ...style(state) })
|
|
52
|
+
: { ...baseStyle, ...style } }) }) }));
|
|
53
|
+
}
|
|
54
|
+
export const Arrow = forwardRef(function Arrow({ disableStyle, className, style, ...props }, ref) {
|
|
55
|
+
return (_jsxs(BasePopover.Arrow, { style: style, render: _jsx("svg", { ...props, ref: ref, "aria-hidden": true, width: "20", height: "10", viewBox: "0 0 20 10" }), "data-component": "popover-arrow", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: [_jsx("path", { d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z", "data-component": "popover-arrow-1" }), _jsx("path", { d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z", "data-component": "popover-arrow-2" }), _jsx("path", { d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z", "data-component": "popover-arrow-3" })] }));
|
|
56
|
+
});
|
|
57
|
+
/** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
|
|
58
|
+
export const CloseHandler = forwardRef(function CloseHandler({ children, ...props }, ref) {
|
|
59
|
+
return _jsx(BasePopover.Close, { ...props, ref: ref, render: children });
|
|
60
|
+
});
|
|
61
|
+
export const Header = forwardRef(function Header({ disableStyle, className, ...props }, ref) {
|
|
62
|
+
return (_jsx("div", { ...props, ref: ref, "data-component": "popover-header", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
63
|
+
});
|
|
64
|
+
export const Body = forwardRef(function Body({ disableStyle, className, ...props }, ref) {
|
|
65
|
+
return (_jsx("div", { ...props, ref: ref, "data-component": "popover-body", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
66
|
+
});
|
|
67
|
+
export const Footer = forwardRef(function Footer({ disableStyle, className, ...props }, ref) {
|
|
68
|
+
return (_jsx("div", { ...props, ref: ref, "data-component": "popover-footer", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
69
|
+
});
|
|
70
|
+
export const Title = forwardRef(function Title({ disableStyle, className, ...props }, ref) {
|
|
71
|
+
return (_jsx(BasePopover.Title, { ...props, ref: ref, "data-component": "popover-title", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
72
|
+
});
|
|
73
|
+
export const Description = forwardRef(function Description({ disableStyle, className, ...props }, ref) {
|
|
74
|
+
return (_jsx(BasePopover.Description, { ...props, ref: ref, "data-component": "popover-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/popover/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAA;AACpC,8IAA8I;AAC9I,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAOnC,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAChD,OAAO,KAAC,WAAW,CAAC,OAAO,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAI,CAAA;AACvE,CAAC,CAAC,CAAA;AA0BF,iIAAiI;AACjI,MAAM,UAAU,KAAK,CAAC,EACpB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,cAAc,EACd,IAAI,GAAG,QAAQ,EACf,UAAU,GAAG,CAAC,EACd,KAAK,GAAG,OAAO,EACf,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACgB;IACxB,MAAM,SAAS,GAA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ACpB,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAG9B,SAAS,MAAM,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC1D,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,oBACO,gBAAgB,yBACV,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAI7B,SAAS,KAAK,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACzD,OAAO,CACL,KAAC,WAAW,CAAC,KAAK,OACZ,KAAK,EACT,GAAG,EAAE,GAAG,oBACO,eAAe,yBACT,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAInC,SAAS,WAAW,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC/D,OAAO,CACL,KAAC,WAAW,CAAC,WAAW,OAClB,KAAK,EACT,GAAG,EAAE,GAAG,oBACO,qBAAqB,yBACf,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { StyleProps } from '../../types/Style.ts';
|
|
2
|
+
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';
|
|
3
|
+
import { Radio as BaseRadio } from '@base-ui/react/radio';
|
|
4
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
5
|
+
export type RootProps<Value = string> = Omit<BaseRadioGroup.Props<Value>, 'render' | 'className'> & {
|
|
6
|
+
/** Choose the visual tone. This does not validate data or show/hide feedback messages. */
|
|
7
|
+
tone?: 'neutral' | 'valid' | 'invalid';
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Root owns the chosen value. For each choice keep Item, ItemButton, ItemIndicator, and ItemLabel together. The indicator follows selection automatically; do not manage a separate checked state for each item.
|
|
11
|
+
*
|
|
12
|
+
* @example Complete composition
|
|
13
|
+
* import { Radio } from '@central-ui/react'
|
|
14
|
+
*
|
|
15
|
+
* const plans = [
|
|
16
|
+
* {
|
|
17
|
+
* value: 'basic',
|
|
18
|
+
* label: 'Basic',
|
|
19
|
+
* description: 'For personal use.',
|
|
20
|
+
* disabled: false,
|
|
21
|
+
* },
|
|
22
|
+
* {
|
|
23
|
+
* value: 'team',
|
|
24
|
+
* label: 'Team',
|
|
25
|
+
* description: 'For shared work.',
|
|
26
|
+
* disabled: false,
|
|
27
|
+
* },
|
|
28
|
+
* {
|
|
29
|
+
* value: 'enterprise',
|
|
30
|
+
* label: 'Enterprise',
|
|
31
|
+
* description: 'Unavailable right now.',
|
|
32
|
+
* disabled: true,
|
|
33
|
+
* },
|
|
34
|
+
* ]
|
|
35
|
+
* function Example() {
|
|
36
|
+
* return (
|
|
37
|
+
* <Radio.Root name="plan" defaultValue="basic">
|
|
38
|
+
* <Radio.Container>
|
|
39
|
+
* <Radio.Label>Plan</Radio.Label>
|
|
40
|
+
* <Radio.List>
|
|
41
|
+
* {plans.map((plan) => (
|
|
42
|
+
* <Radio.Item key={plan.value} value={plan.value} disabled={plan.disabled}>
|
|
43
|
+
* <Radio.ItemButton>
|
|
44
|
+
* <Radio.ItemIndicator />
|
|
45
|
+
* </Radio.ItemButton>
|
|
46
|
+
* <Radio.ItemLabel>{plan.label}</Radio.ItemLabel>
|
|
47
|
+
* <Radio.ItemDescription>{plan.description}</Radio.ItemDescription>
|
|
48
|
+
* </Radio.Item>
|
|
49
|
+
* ))}
|
|
50
|
+
* </Radio.List>
|
|
51
|
+
* <Radio.Description>Choose one plan.</Radio.Description>
|
|
52
|
+
* </Radio.Container>
|
|
53
|
+
* </Radio.Root>
|
|
54
|
+
* )
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* @example Choose the initial plan
|
|
58
|
+
* // Keep the same Item compositions; each Item still supplies its own value.
|
|
59
|
+
* ;<Radio.Root defaultValue="pro" name="plan">
|
|
60
|
+
* {
|
|
61
|
+
* // Rest of components here
|
|
62
|
+
* }
|
|
63
|
+
* </Radio.Root>
|
|
64
|
+
*/
|
|
65
|
+
export declare function Root<Value>({ children, tone, ...props }: RootProps<Value>): import("react").JSX.Element;
|
|
66
|
+
export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export declare const List: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
/** Labels the associated control automatically. Supply the visible text; do not wire a second label association. */
|
|
69
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
70
|
+
type ItemCoreKeys = 'value' | 'disabled' | 'readOnly' | 'required' | 'inputRef';
|
|
71
|
+
export type ItemProps<Value = string> = Omit<ComponentProps<'div'>, 'children'> & Pick<BaseRadio.Root.Props<Value>, ItemCoreKeys> & {
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
} & StyleProps;
|
|
74
|
+
export declare function Item<Value>({ disableStyle, children, value, disabled, readOnly, required, inputRef, id, className, ...props }: ItemProps<Value> & StyleProps): import("react").JSX.Element;
|
|
75
|
+
export declare const ItemButton: import("react").ForwardRefExoticComponent<Omit<Omit<BaseRadio.Root.Props<any>, "className" | "id" | "disabled" | "value" | "render" | "nativeButton" | "required" | "readOnly" | "inputRef"> & {
|
|
76
|
+
className?: string;
|
|
77
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
78
|
+
/** Tracks the surrounding item state automatically. Keep it mounted; do not add your own visibility condition. Use the supplied default visual unless customization is needed. */
|
|
79
|
+
export declare const ItemIndicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").RadioIndicatorProps, "className"> & {
|
|
80
|
+
className?: string;
|
|
81
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
82
|
+
export declare const ItemLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "htmlFor"> & StyleProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
83
|
+
export declare const ItemDescription: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
84
|
+
export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
85
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
86
|
+
export declare const Error: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
87
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
88
|
+
export declare const Success: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/radio/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAUzD,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EAIV,MAAM,OAAO,CAAA;AAId,MAAM,MAAM,SAAS,CAAC,KAAK,GAAG,MAAM,IAAI,IAAI,CAC1C,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,EAC3B,QAAQ,GAAG,WAAW,CACvB,GAAG;IACF,0FAA0F;IAC1F,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;CACvC,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,EAC1B,QAAQ,EACR,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,KAAK,CAAC,+BAsClB;AACD,eAAO,MAAM,SAAS,uNAapB,CAAA;AAEF,eAAO,MAAM,IAAI,uNAgBf,CAAA;AACF,oHAAoH;AACpH,eAAO,MAAM,KAAK,uNAyBhB,CAAA;AACF,KAAK,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAA;AAC/E,MAAM,MAAM,SAAS,CAAC,KAAK,GAAG,MAAM,IAAI,IAAI,CAC1C,cAAc,CAAC,KAAK,CAAC,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