@central-ui/react 0.0.0-stage → 0.1.1
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 +33 -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAS/C,OAAO,KAAK,EAEV,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACV,MAAM,OAAO,CAAA;AAId,MAAM,MAAM,SAAS,GAAG;IACtB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,UAAU,GAAG;IACvB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb,8DAA8D;IAC9D,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;CAC5B,CAAA;AACD,wGAAwG;AACxG,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAA;AAClE,sHAAsH;AACtH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;AAC3E,4HAA4H;AAC5H,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,IAClD,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/B,MAAM,MAAM,SAAS,CACnB,CAAC,SAAS,SAAS,UAAU,EAAE,EAC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iIAoBzB,CAAA;AAEF,kLAAkL;AAClL,eAAO,MAAM,aAAa;IAIpB,iFAAiF;eACtE,YAAY,CAAC,WAAW,CAAC;sEAqBxC,CAAA;AACF,eAAO,MAAM,aAAa;gBAE2C,MAAM;uEAgBzE,CAAA;AACF,eAAO,MAAM,eAAe;gBAGZ,MAAM;uEAoBpB,CAAA"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select as BaseSelect } from '@base-ui/react/select';
|
|
3
|
+
import { Check, ChevronDown, ChevronUp, ChevronsUpDown } from 'lucide-react';
|
|
4
|
+
import { cloneElement, createContext, forwardRef, useContext, useId, useState, } from 'react';
|
|
5
|
+
import { ToneProvider, useToneContext } from "../../utils/Tone.js";
|
|
6
|
+
/**
|
|
7
|
+
* Prepare groups in items. A flat-looking list is one group with an empty label and no GroupLabel; keep Group around ItemsList. OpenButtonValue already formats the selection: omit children unless a custom display is needed. Keep ScrollArea → GroupsList → Group → ItemsList → Item in Popup.
|
|
8
|
+
*
|
|
9
|
+
* @example Complete composition
|
|
10
|
+
* import { Select } from '@central-ui/react'
|
|
11
|
+
*
|
|
12
|
+
* const cities = [
|
|
13
|
+
* { value: 'rabat', label: 'Rabat', country: 'Morocco', population: 580000 },
|
|
14
|
+
* {
|
|
15
|
+
* value: 'casablanca',
|
|
16
|
+
* label: 'Casablanca',
|
|
17
|
+
* country: 'Morocco',
|
|
18
|
+
* population: 3359818,
|
|
19
|
+
* },
|
|
20
|
+
* {
|
|
21
|
+
* value: 'marrakesh',
|
|
22
|
+
* label: 'Marrakesh',
|
|
23
|
+
* country: 'Morocco',
|
|
24
|
+
* population: 928850,
|
|
25
|
+
* },
|
|
26
|
+
* ]
|
|
27
|
+
* const allCities = [{ label: '', items: cities }]
|
|
28
|
+
* type City = Select.ItemType<typeof allCities>
|
|
29
|
+
* type Country = Select.GroupType<typeof allCities>
|
|
30
|
+
* function Example() {
|
|
31
|
+
* return (
|
|
32
|
+
* <Select.Root items={allCities} name="city">
|
|
33
|
+
* <Select.Container>
|
|
34
|
+
* <Select.Label>City</Select.Label>
|
|
35
|
+
* <Select.OpenButton>
|
|
36
|
+
* <Select.OpenButtonValue placeholder="Choose a city" />
|
|
37
|
+
* <Select.OpenButtonIcon />
|
|
38
|
+
* </Select.OpenButton>
|
|
39
|
+
* <Select.Description>Choose a city.</Select.Description>
|
|
40
|
+
*
|
|
41
|
+
* <Select.Popup>
|
|
42
|
+
* <Select.ScrollArea // Required listbox and scrolling viewport.
|
|
43
|
+
* >
|
|
44
|
+
* <Select.GroupsList // Required groups container.
|
|
45
|
+
* >
|
|
46
|
+
* {(group: Country) => (
|
|
47
|
+
* <Select.Group
|
|
48
|
+
* key={group.label}
|
|
49
|
+
* items={group.items}
|
|
50
|
+
* aria-label={group.label}
|
|
51
|
+
* >
|
|
52
|
+
* <Select.ItemsList>
|
|
53
|
+
* {(city: City) => (
|
|
54
|
+
* <Select.Item
|
|
55
|
+
* key={city.value}
|
|
56
|
+
* value={city}
|
|
57
|
+
* disabled={city.value === 'marseille'}
|
|
58
|
+
* >
|
|
59
|
+
* <Select.ItemText>{city.label}</Select.ItemText>
|
|
60
|
+
* <Select.ItemIndicator />
|
|
61
|
+
* </Select.Item>
|
|
62
|
+
* )}
|
|
63
|
+
* </Select.ItemsList>
|
|
64
|
+
* </Select.Group>
|
|
65
|
+
* )}
|
|
66
|
+
* </Select.GroupsList>
|
|
67
|
+
* </Select.ScrollArea>
|
|
68
|
+
* </Select.Popup>
|
|
69
|
+
* </Select.Container>
|
|
70
|
+
* </Select.Root>
|
|
71
|
+
* )
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* @example Custom selection display only when needed
|
|
75
|
+
* // Default usage is <Select.OpenButtonValue /> with no children.
|
|
76
|
+
* // For this custom single-selection display, items={allCities} is passed to Root.
|
|
77
|
+
* ;<Select.OpenButtonValue>
|
|
78
|
+
* {(city: Select.ItemType<typeof allCities> | null) =>
|
|
79
|
+
* city ? city.label + ' — ' + city.country : 'Choose a city'
|
|
80
|
+
* }
|
|
81
|
+
* </Select.OpenButtonValue>
|
|
82
|
+
*
|
|
83
|
+
* @example Select more than one city
|
|
84
|
+
* // Keep the same popup items and OpenButtonValue; both already support multiple selection.
|
|
85
|
+
* ;<Select.Root items={allCities} multiple>
|
|
86
|
+
* {
|
|
87
|
+
* // Rest of components here
|
|
88
|
+
* }
|
|
89
|
+
* </Select.Root>
|
|
90
|
+
*/
|
|
91
|
+
export function Root({ children, items, id, tone = 'neutral', open, defaultOpen = false, onOpenChange, ...props }) {
|
|
92
|
+
const generatedId = useId();
|
|
93
|
+
const inputId = id ?? generatedId;
|
|
94
|
+
const [openInternalState, setOpenInternalState] = useState(defaultOpen);
|
|
95
|
+
return (_jsx(BaseSelect.Root, { ...props, items: items, id: inputId, open: open, defaultOpen: defaultOpen, isItemEqualToValue: (item, selected) => item.value === selected.value, onOpenChange: (nextOpen, details) => {
|
|
96
|
+
onOpenChange?.(nextOpen, details);
|
|
97
|
+
if (!details.isCanceled)
|
|
98
|
+
setOpenInternalState(nextOpen);
|
|
99
|
+
}, children: _jsx(SelectContext.Provider, { value: {
|
|
100
|
+
inputId,
|
|
101
|
+
groups: items,
|
|
102
|
+
open: open ?? openInternalState,
|
|
103
|
+
disabled: props.disabled ?? false,
|
|
104
|
+
readOnly: props.readOnly ?? false,
|
|
105
|
+
required: props.required ?? false,
|
|
106
|
+
}, children: _jsx(ToneProvider, { value: tone, children: children }) }) }));
|
|
107
|
+
}
|
|
108
|
+
export const Container = forwardRef(function Container({ disableStyle, className, ...props }, ref) {
|
|
109
|
+
return (_jsx("div", { ...props, ref: ref, "data-component": "select-container", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
110
|
+
});
|
|
111
|
+
export const Label = forwardRef(function Label({ disableStyle, className, ...props }, ref) {
|
|
112
|
+
const attributes = usePartAttributes();
|
|
113
|
+
return (_jsx(BaseSelect.Label, { ...attributes, ...props, ref: ref, "data-component": "select-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
114
|
+
});
|
|
115
|
+
export const Value = BaseSelect.Value;
|
|
116
|
+
/** Omit children to keep the built-in formatted value. Supply children only for a special display; do not format the selection yourself for the usual case. */
|
|
117
|
+
export function OpenButtonValue({ disableStyle, className, ...props }) {
|
|
118
|
+
return (_jsx(BaseSelect.Value, { ...props, "data-component": "select-openbuttonvalue", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
119
|
+
}
|
|
120
|
+
export const ScrollArea = forwardRef(function ScrollArea({ disableStyle, className, style, ...props }, ref) {
|
|
121
|
+
return (_jsx(BaseSelect.List, { ...props, ref: ref, style: style, "data-component": "select-scrollarea", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
122
|
+
});
|
|
123
|
+
/** Let this list render the groups. Manually annotate its children callback with Select.GroupType<typeof rootItems>, using the SAME items variable passed to Root. */
|
|
124
|
+
export function GroupsList({ disableStyle, children, className, style, ...props }) {
|
|
125
|
+
const { groups } = useSelectContext();
|
|
126
|
+
return (_jsx("div", { ...props, style: style, "data-component": "select-groupslist", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: typeof children === 'function'
|
|
127
|
+
? groups.map((group, index) => children(group, index))
|
|
128
|
+
: children }));
|
|
129
|
+
}
|
|
130
|
+
/** Let this list render the surrounding group. Manually annotate its callback with Select.ItemType<typeof rootItems>, using the SAME items variable passed to Root. */
|
|
131
|
+
export function ItemsList({ disableStyle, children, className, ...props }) {
|
|
132
|
+
const items = useItemsContext();
|
|
133
|
+
return (_jsx("div", { ...props, "data-component": "select-itemslist", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: items.map((item, index) => children(item, index)) }));
|
|
134
|
+
}
|
|
135
|
+
export function Group({ disableStyle, items, children, className, ...props }) {
|
|
136
|
+
return (_jsx(BaseSelect.Group, { ...props, "data-component": "select-group", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: _jsx(ItemsContext.Provider, { value: items, children: children }) }));
|
|
137
|
+
}
|
|
138
|
+
export function Item({ disableStyle, className, ...props }) {
|
|
139
|
+
return (_jsx(BaseSelect.Item, { ...props, "data-component": "select-item", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
140
|
+
}
|
|
141
|
+
/** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
|
|
142
|
+
export function Popup({ disableStyle, container, anchor, positionMethod, side = 'bottom', sideOffset = 5, align = 'start', alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, alignItemWithTrigger = false, className, style, ...props }) {
|
|
143
|
+
const baseStyle = {
|
|
144
|
+
maxHeight: 'var(--available-height)',
|
|
145
|
+
minWidth: 'var(--anchor-width)',
|
|
146
|
+
};
|
|
147
|
+
return (_jsx(BaseSelect.Portal, { container: container, children: _jsx(BaseSelect.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, alignItemWithTrigger: alignItemWithTrigger, style: { zIndex: 80, maxWidth: 'var(--available-width)' }, children: _jsx(BaseSelect.Popup, { ...props, "data-component": "select-popup", "data-style-disabled": disableStyle ? '' : undefined, className: className, style: typeof style === 'function'
|
|
148
|
+
? (state) => ({ ...baseStyle, ...style(state) })
|
|
149
|
+
: { ...baseStyle, ...style } }) }) }));
|
|
150
|
+
}
|
|
151
|
+
export const Arrow = forwardRef(function Arrow({ disableStyle, className, style, ...props }, ref) {
|
|
152
|
+
return (_jsxs(BaseSelect.Arrow, { style: style, render: _jsx("svg", { ...props, ref: ref, "aria-hidden": true, width: "20", height: "10", viewBox: "0 0 20 10" }), "data-component": "select-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": "select-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": "select-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": "select-arrow-3" })] }));
|
|
153
|
+
});
|
|
154
|
+
/** Behavior only: give your child control this action. Style the child itself; this wrapper has no preset appearance or disableStyle prop. */
|
|
155
|
+
export const PopupOpenHandler = forwardRef(function PopupOpenHandler({ children, ...props }, ref) {
|
|
156
|
+
return _jsx(BaseSelect.Trigger, { ...props, ref: ref, render: children });
|
|
157
|
+
});
|
|
158
|
+
export const OpenButton = forwardRef(function OpenButton({ disableStyle, className, ...props }, ref) {
|
|
159
|
+
const tone = useToneContext();
|
|
160
|
+
return (_jsx(BaseSelect.Trigger, { "data-tone": tone, ...props, ref: ref, "data-component": "select-openbutton", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
161
|
+
});
|
|
162
|
+
/** Omit for an unlabeled/flat-looking group; keep the Group wrapper. Supply the heading only when grouping should be visible. */
|
|
163
|
+
export const GroupLabel = forwardRef(function GroupLabel({ disableStyle, className, ...props }, ref) {
|
|
164
|
+
return (_jsx(BaseSelect.GroupLabel, { ...props, ref: ref, "data-component": "select-grouplabel", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
165
|
+
});
|
|
166
|
+
export const Separator = forwardRef(function Separator({ disableStyle, className, ...props }, ref) {
|
|
167
|
+
return (_jsx(BaseSelect.Separator, { ...props, ref: ref, "data-component": "select-separator", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
168
|
+
});
|
|
169
|
+
export const ItemText = forwardRef(function ItemText({ disableStyle, className, ...props }, ref) {
|
|
170
|
+
return (_jsx(BaseSelect.ItemText, { ...props, ref: ref, "data-component": "select-itemtext", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
171
|
+
});
|
|
172
|
+
export const Description = forwardRef(function Description({ disableStyle, className, ...props }, ref) {
|
|
173
|
+
const attributes = usePartAttributes();
|
|
174
|
+
return (_jsx("div", { ...attributes, ...props, ref: ref, "data-component": "select-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
175
|
+
});
|
|
176
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
177
|
+
export const Error = forwardRef(function Error({ disableStyle, className, ...props }, ref) {
|
|
178
|
+
const attributes = usePartAttributes();
|
|
179
|
+
return (_jsx("div", { role: "alert", "aria-atomic": "true", ...attributes, ...props, ref: ref, "data-component": "select-error", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
180
|
+
});
|
|
181
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
182
|
+
export const Success = forwardRef(function Success({ disableStyle, className, ...props }, ref) {
|
|
183
|
+
const attributes = usePartAttributes();
|
|
184
|
+
return (_jsx("div", { role: "status", "aria-atomic": "true", ...attributes, ...props, ref: ref, "data-component": "select-success", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
185
|
+
});
|
|
186
|
+
/** Built-in icon; no children needed. Use it inside its matching control. */
|
|
187
|
+
export const OpenButtonIcon = forwardRef(function OpenButtonIcon({ disableStyle, className, strokeWidth = 1.5, ...props }, ref) {
|
|
188
|
+
const attributes = usePartAttributes();
|
|
189
|
+
return (_jsx(ChevronsUpDown, { ...attributes, "aria-hidden": true, ...props, ref: ref, strokeWidth: strokeWidth, "data-component": "select-openbuttonicon", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
190
|
+
});
|
|
191
|
+
/** 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. */
|
|
192
|
+
export const ItemIndicator = forwardRef(function ItemIndicator({ disableStyle, children, keepMounted, ...props }, ref) {
|
|
193
|
+
const iconProps = {
|
|
194
|
+
'aria-hidden': true,
|
|
195
|
+
strokeWidth: 2,
|
|
196
|
+
...props,
|
|
197
|
+
ref,
|
|
198
|
+
'data-component': 'select-itemindicator',
|
|
199
|
+
'data-style-disabled': disableStyle ? '' : undefined,
|
|
200
|
+
};
|
|
201
|
+
return (_jsx(BaseSelect.ItemIndicator, { keepMounted: keepMounted, children: null, render: cloneElement(children ?? _jsx(Check, {}), iconProps) }));
|
|
202
|
+
});
|
|
203
|
+
export const ScrollUpArrow = forwardRef(function ScrollUpArrow({ disableStyle, children, className, ...props }, ref) {
|
|
204
|
+
return (_jsx(BaseSelect.ScrollUpArrow, { ...props, ref: ref, "data-component": "select-scrolluparrow", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children ?? (_jsx(ChevronUp, { "aria-hidden": true, "data-component": "select-scrolluparrow-1" })) }));
|
|
205
|
+
});
|
|
206
|
+
export const ScrollDownArrow = forwardRef(function ScrollDownArrow({ disableStyle, children, className, ...props }, ref) {
|
|
207
|
+
return (_jsx(BaseSelect.ScrollDownArrow, { ...props, ref: ref, "data-component": "select-scrolldownarrow", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: children ?? (_jsx(ChevronDown, { "aria-hidden": true, "data-component": "select-scrolldownarrow-1" })) }));
|
|
208
|
+
});
|
|
209
|
+
const ItemsContext = createContext(null);
|
|
210
|
+
function useItemsContext() {
|
|
211
|
+
const items = useContext(ItemsContext);
|
|
212
|
+
if (!items)
|
|
213
|
+
throw new globalThis.Error('Select.ItemsList must be inside Select.Group');
|
|
214
|
+
return items;
|
|
215
|
+
}
|
|
216
|
+
const SelectContext = createContext(null);
|
|
217
|
+
function useSelectContext() {
|
|
218
|
+
const context = useContext(SelectContext);
|
|
219
|
+
if (!context)
|
|
220
|
+
throw new globalThis.Error('Select parts must be inside Select.Root');
|
|
221
|
+
return context;
|
|
222
|
+
}
|
|
223
|
+
function usePartAttributes() {
|
|
224
|
+
const { open, disabled, readOnly, required } = useSelectContext();
|
|
225
|
+
const tone = useToneContext();
|
|
226
|
+
return {
|
|
227
|
+
'data-open': open ? '' : undefined,
|
|
228
|
+
'data-disabled': disabled ? '' : undefined,
|
|
229
|
+
'data-readonly': readOnly ? '' : undefined,
|
|
230
|
+
'data-required': required ? '' : undefined,
|
|
231
|
+
'data-tone': tone,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/select/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE5E,OAAO,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAA;AAQd,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAmCnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,MAAM,UAAU,IAAI,CAGlB,EACA,QAAQ,EACR,KAA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OAAO,KAAK,CAAA;AACd,CAAC;AACD,MAAM,aAAa,GAAG,aAAa,CAA4B,IAAI,CAAC,CAAA;AACpE,SAAS,gBAAgB;IACvB,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IACzC,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;IACvE,OAAO,OAAO,CAAA;AAChB,CAAC;AACD,SAAS,iBAAiB;IACxB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACjE,MAAM,IAAI,GAAG,cAAc,EAAE,CAAA;IAC7B,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAClC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,WAAW,EAAE,IAAI;KAClB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StyleProps } from '../../types/Style.ts';
|
|
2
|
+
import type { HTMLAttributes } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Use the default skeleton while your application is loading. Supply dimensions through className; the component does not detect request state.
|
|
5
|
+
*
|
|
6
|
+
* @example Complete composition
|
|
7
|
+
* import { Skeleton } from '@central-ui/react'
|
|
8
|
+
*
|
|
9
|
+
* function Example() {
|
|
10
|
+
* return (
|
|
11
|
+
* <div className="flex flex-col gap-2">
|
|
12
|
+
* <Skeleton.default className="h-4 w-full" />
|
|
13
|
+
* <Skeleton.default className="h-4 w-3/4" />
|
|
14
|
+
* </div>
|
|
15
|
+
* )
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
export default function Skeleton({ disableStyle, className, ...props }: HTMLAttributes<HTMLDivElement> & StyleProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,UAAU,+BAS7C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Use the default skeleton while your application is loading. Supply dimensions through className; the component does not detect request state.
|
|
4
|
+
*
|
|
5
|
+
* @example Complete composition
|
|
6
|
+
* import { Skeleton } from '@central-ui/react'
|
|
7
|
+
*
|
|
8
|
+
* function Example() {
|
|
9
|
+
* return (
|
|
10
|
+
* <div className="flex flex-col gap-2">
|
|
11
|
+
* <Skeleton.default className="h-4 w-full" />
|
|
12
|
+
* <Skeleton.default className="h-4 w-3/4" />
|
|
13
|
+
* </div>
|
|
14
|
+
* )
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
export default function Skeleton({ disableStyle, className, ...props }) {
|
|
18
|
+
return (_jsx("div", { "data-component": "skeleton-skeleton", "data-style-disabled": disableStyle ? '' : undefined, className: className, ...props }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/skeleton/index.tsx"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACoC;IAC5C,OAAO,CACL,gCACiB,mBAAmB,yBACb,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,SAAS,KAChB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { StyleProps } from '../../types/Style.ts';
|
|
2
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
export type RootProps<Value extends number | readonly number[] = number | readonly number[]> = Omit<BaseSlider.Root.Props<Value>, 'render' | 'className'> & {
|
|
5
|
+
/** Choose the visual tone. This does not validate data or show/hide feedback messages. */
|
|
6
|
+
tone?: 'neutral' | 'valid' | 'invalid';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Configure bounds and value on Root. Keep Track inside TrackGroup, then Indicator and indexed DragHandles inside Track. One handle adjusts a single value; a range needs a handle for each end. MarksList/Mark are optional labels, not interactive handles.
|
|
10
|
+
*
|
|
11
|
+
* @example Complete composition
|
|
12
|
+
* import { Slider } from '@central-ui/react'
|
|
13
|
+
*
|
|
14
|
+
* function Example() {
|
|
15
|
+
* return (
|
|
16
|
+
* <Slider.Root min={0} max={100} defaultValue={50}>
|
|
17
|
+
* <Slider.Container>
|
|
18
|
+
* <Slider.Label>Volume</Slider.Label>
|
|
19
|
+
* <Slider.Value />
|
|
20
|
+
* <Slider.TrackGroup>
|
|
21
|
+
* <Slider.Track>
|
|
22
|
+
* <Slider.Indicator />
|
|
23
|
+
* <Slider.DragHandle index={0} />{' '}
|
|
24
|
+
* </Slider.Track>
|
|
25
|
+
* </Slider.TrackGroup>
|
|
26
|
+
* <Slider.Description>Adjust the volume.</Slider.Description>
|
|
27
|
+
* </Slider.Container>
|
|
28
|
+
* </Slider.Root>
|
|
29
|
+
* )
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* @example Adjust both ends of a range
|
|
33
|
+
* // Configure Root defaultValue={[25, 75]}; replace its Track content with:
|
|
34
|
+
* ;<Slider.Track>
|
|
35
|
+
* <Slider.Indicator />
|
|
36
|
+
* <Slider.DragHandle index={0} aria-label="Minimum" />
|
|
37
|
+
* <Slider.DragHandle index={1} aria-label="Maximum" />
|
|
38
|
+
* </Slider.Track>
|
|
39
|
+
*/
|
|
40
|
+
export declare function Root<Value extends number | readonly number[]>({ children, tone, ...props }: RootProps<Value>): import("react").JSX.Element;
|
|
41
|
+
export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SliderLabelProps, "className"> & {
|
|
43
|
+
className?: string;
|
|
44
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export declare const Value: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SliderValueProps, "className"> & {
|
|
46
|
+
className?: string;
|
|
47
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLOutputElement>>;
|
|
48
|
+
export declare const TrackGroup: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SliderControlProps, "className"> & {
|
|
49
|
+
className?: string;
|
|
50
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export declare const Track: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SliderTrackProps, "className"> & {
|
|
52
|
+
className?: string;
|
|
53
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export declare const Indicator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SliderIndicatorProps, "className"> & {
|
|
55
|
+
className?: string;
|
|
56
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
57
|
+
export declare const DragHandle: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").SliderThumbProps, "className"> & {
|
|
58
|
+
className?: string;
|
|
59
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export declare const MarksList: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children"> & {
|
|
61
|
+
children: (value: number) => ReactNode;
|
|
62
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
63
|
+
export declare const Mark: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
64
|
+
/** Place this mark at the corresponding value within Root bounds; its position is calculated automatically. */
|
|
65
|
+
value: number;
|
|
66
|
+
} & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export declare const Description: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
69
|
+
export declare const Error: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
70
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
71
|
+
export declare const Success: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAY5D,OAAO,KAAK,EAEV,SAAS,EAIV,MAAM,OAAO,CAAA;AAId,MAAM,MAAM,SAAS,CACnB,KAAK,SAAS,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,IACnE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;IAC/D,0FAA0F;IAC1F,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;CACvC,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,IAAI,CAAC,KAAK,SAAS,MAAM,GAAG,SAAS,MAAM,EAAE,EAAE,EAC7D,QAAQ,EACR,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,KAAK,CAAC,+BAqBlB;AACD,eAAO,MAAM,SAAS,uNAkBpB,CAAA;AACF,eAAO,MAAM,KAAK;gBAE2C,MAAM;uEAYjE,CAAA;AAEF,eAAO,MAAM,KAAK;gBAE2C,MAAM;0EAYjE,CAAA;AAEF,eAAO,MAAM,UAAU;gBAEwC,MAAM;uEAYnE,CAAA;AAEF,eAAO,MAAM,KAAK;gBAE2C,MAAM;uEAYjE,CAAA;AAEF,eAAO,MAAM,SAAS;gBAE2C,MAAM;uEAcrE,CAAA;AACF,eAAO,MAAM,UAAU;gBAEsC,MAAM;uEAiBjE,CAAA;AACF,eAAO,MAAM,SAAS;cAGR,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS;uEAwBxC,CAAA;AACF,eAAO,MAAM,IAAI;IAGb,+GAA+G;WACxG,MAAM;uEAyCf,CAAA;AACF,eAAO,MAAM,WAAW,uNAmBtB,CAAA;AACF,iHAAiH;AACjH,eAAO,MAAM,KAAK,uNAqBhB,CAAA;AACF,iHAAiH;AACjH,eAAO,MAAM,OAAO,uNAqBlB,CAAA"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Slider as BaseSlider } from '@base-ui/react/slider';
|
|
3
|
+
import { useDirection } from '@base-ui/react/direction-provider';
|
|
4
|
+
import { Fragment as ReactFragment, createContext, useCallback, forwardRef, useContext, useEffect, useId, useState, } from 'react';
|
|
5
|
+
import { ToneProvider, useToneContext } from "../../utils/Tone.js";
|
|
6
|
+
/**
|
|
7
|
+
* Configure bounds and value on Root. Keep Track inside TrackGroup, then Indicator and indexed DragHandles inside Track. One handle adjusts a single value; a range needs a handle for each end. MarksList/Mark are optional labels, not interactive handles.
|
|
8
|
+
*
|
|
9
|
+
* @example Complete composition
|
|
10
|
+
* import { Slider } from '@central-ui/react'
|
|
11
|
+
*
|
|
12
|
+
* function Example() {
|
|
13
|
+
* return (
|
|
14
|
+
* <Slider.Root min={0} max={100} defaultValue={50}>
|
|
15
|
+
* <Slider.Container>
|
|
16
|
+
* <Slider.Label>Volume</Slider.Label>
|
|
17
|
+
* <Slider.Value />
|
|
18
|
+
* <Slider.TrackGroup>
|
|
19
|
+
* <Slider.Track>
|
|
20
|
+
* <Slider.Indicator />
|
|
21
|
+
* <Slider.DragHandle index={0} />{' '}
|
|
22
|
+
* </Slider.Track>
|
|
23
|
+
* </Slider.TrackGroup>
|
|
24
|
+
* <Slider.Description>Adjust the volume.</Slider.Description>
|
|
25
|
+
* </Slider.Container>
|
|
26
|
+
* </Slider.Root>
|
|
27
|
+
* )
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* @example Adjust both ends of a range
|
|
31
|
+
* // Configure Root defaultValue={[25, 75]}; replace its Track content with:
|
|
32
|
+
* ;<Slider.Track>
|
|
33
|
+
* <Slider.Indicator />
|
|
34
|
+
* <Slider.DragHandle index={0} aria-label="Minimum" />
|
|
35
|
+
* <Slider.DragHandle index={1} aria-label="Maximum" />
|
|
36
|
+
* </Slider.Track>
|
|
37
|
+
*/
|
|
38
|
+
export function Root({ children, tone = 'neutral', ...props }) {
|
|
39
|
+
const [messageIds, setMessageIds] = useState([]);
|
|
40
|
+
return (_jsx(ToneProvider, { value: tone, children: _jsx(BaseSlider.Root, { ...props, render: (rootProps, state) => {
|
|
41
|
+
const { children, ...elementProps } = rootProps;
|
|
42
|
+
return (_jsx(SliderContext.Provider, { value: { elementProps, state, messageIds, setMessageIds }, children: _jsx(_Fragment, { children: children }) }));
|
|
43
|
+
}, children: children }) }));
|
|
44
|
+
}
|
|
45
|
+
export const Container = forwardRef(function Container({ disableStyle, ...props }, ref) {
|
|
46
|
+
const context = useSliderContext();
|
|
47
|
+
const tone = useToneContext();
|
|
48
|
+
const { ref: nativeRef, ...nativeProps } = context.elementProps;
|
|
49
|
+
return (_jsx("div", { ...nativeProps, ...props, ref: useRootRef(nativeRef, ref), "data-tone": tone, "data-component": "slider-container", "data-style-disabled": disableStyle ? '' : undefined, className: props.className }));
|
|
50
|
+
});
|
|
51
|
+
export const Label = forwardRef(function Label({ disableStyle, className, ...props }, ref) {
|
|
52
|
+
return (_jsx(BaseSlider.Label, { ...props, ref: ref, "data-component": "slider-label", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
53
|
+
});
|
|
54
|
+
export const Value = forwardRef(function Value({ disableStyle, className, ...props }, ref) {
|
|
55
|
+
return (_jsx(BaseSlider.Value, { ...props, ref: ref, "data-component": "slider-value", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
56
|
+
});
|
|
57
|
+
export const TrackGroup = forwardRef(function TrackGroup({ disableStyle, className, ...props }, ref) {
|
|
58
|
+
return (_jsx(BaseSlider.Control, { ...props, ref: ref, "data-component": "slider-trackgroup", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
59
|
+
});
|
|
60
|
+
export const Track = forwardRef(function Track({ disableStyle, className, ...props }, ref) {
|
|
61
|
+
return (_jsx(BaseSlider.Track, { ...props, ref: ref, "data-component": "slider-track", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
62
|
+
});
|
|
63
|
+
export const Indicator = forwardRef(function Indicator({ disableStyle, className, ...props }, ref) {
|
|
64
|
+
const tone = useToneContext();
|
|
65
|
+
return (_jsx(BaseSlider.Indicator, { ...props, ref: ref, "data-tone": tone, "data-component": "slider-indicator", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
66
|
+
});
|
|
67
|
+
export const DragHandle = forwardRef(function DragHandle({ disableStyle, className, ...props }, ref) {
|
|
68
|
+
const { messageIds } = useSliderContext();
|
|
69
|
+
return (_jsx(BaseSlider.Thumb, { ...props, ref: ref, "aria-describedby": [props['aria-describedby'], ...messageIds].filter(Boolean).join(' ') ||
|
|
70
|
+
undefined, "data-component": "slider-draghandle", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
71
|
+
});
|
|
72
|
+
export const MarksList = forwardRef(function MarksList({ disableStyle, children, className, ...props }, ref) {
|
|
73
|
+
const { state } = useSliderContext();
|
|
74
|
+
const count = Math.floor(Number(((state.max - state.min) / state.step).toPrecision(15))) +
|
|
75
|
+
1;
|
|
76
|
+
return (_jsx("div", { ...props, ref: ref, "aria-hidden": true, "data-orientation": state.orientation, "data-component": "slider-markslist", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: Array.from({ length: count }, (_, index) => {
|
|
77
|
+
const value = Number((state.min + index * state.step).toPrecision(15));
|
|
78
|
+
return _jsx(ReactFragment, { children: children(value) }, value);
|
|
79
|
+
}) }));
|
|
80
|
+
});
|
|
81
|
+
export const Mark = forwardRef(function Mark({ disableStyle, value, children, className, style, ...props }, ref) {
|
|
82
|
+
const { state } = useSliderContext();
|
|
83
|
+
const direction = useDirection();
|
|
84
|
+
const percent = ((value - state.min) / (state.max - state.min)) * 100;
|
|
85
|
+
return (_jsxs("div", { ...props, ref: ref, "aria-hidden": true, dir: direction, "data-orientation": state.orientation, style: {
|
|
86
|
+
...(state.orientation === 'vertical'
|
|
87
|
+
? { bottom: percent + '%' }
|
|
88
|
+
: { insetInlineStart: percent + '%' }),
|
|
89
|
+
...style,
|
|
90
|
+
}, "data-component": "slider-mark", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: [_jsx("span", { "data-component": "slider-mark-1", "data-orientation": state.orientation }), children != null && (_jsx("span", { "data-orientation": state.orientation, "data-component": "slider-mark-2", children: children }))] }));
|
|
91
|
+
});
|
|
92
|
+
export const Description = forwardRef(function Description({ disableStyle, className, id, ...props }, ref) {
|
|
93
|
+
const messageId = useMessageId(id);
|
|
94
|
+
const context = useSliderContext();
|
|
95
|
+
const tone = useToneContext();
|
|
96
|
+
return (_jsx("div", { ...props, ref: ref, id: messageId, "data-disabled": context.state.disabled ? '' : undefined, "data-tone": tone, "data-component": "slider-description", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
97
|
+
});
|
|
98
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
99
|
+
export const Error = forwardRef(function Error({ disableStyle, className, id, ...props }, ref) {
|
|
100
|
+
const messageId = useMessageId(id);
|
|
101
|
+
const context = useSliderContext();
|
|
102
|
+
const tone = useToneContext();
|
|
103
|
+
return (_jsx("div", { role: "alert", "aria-atomic": "true", ...props, ref: ref, id: messageId, "data-disabled": context.state.disabled ? '' : undefined, "data-tone": tone, "data-component": "slider-error", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
104
|
+
});
|
|
105
|
+
/** You decide when to show this feedback. Changing tone does not validate data or render the message for you. */
|
|
106
|
+
export const Success = forwardRef(function Success({ disableStyle, className, id, ...props }, ref) {
|
|
107
|
+
const messageId = useMessageId(id);
|
|
108
|
+
const context = useSliderContext();
|
|
109
|
+
const tone = useToneContext();
|
|
110
|
+
return (_jsx("div", { role: "status", "aria-atomic": "true", ...props, ref: ref, id: messageId, "data-disabled": context.state.disabled ? '' : undefined, "data-tone": tone, "data-component": "slider-success", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
|
|
111
|
+
});
|
|
112
|
+
const SliderContext = createContext(null);
|
|
113
|
+
function useSliderContext() {
|
|
114
|
+
const context = useContext(SliderContext);
|
|
115
|
+
if (!context)
|
|
116
|
+
throw new globalThis.Error('Slider parts must be inside Slider.Root');
|
|
117
|
+
return context;
|
|
118
|
+
}
|
|
119
|
+
function useMessageId(id) {
|
|
120
|
+
const generatedId = useId();
|
|
121
|
+
const messageId = id ?? generatedId;
|
|
122
|
+
const { setMessageIds } = useSliderContext();
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
setMessageIds((current) => [...current, messageId]);
|
|
125
|
+
return () => setMessageIds((current) => current.filter((value) => value !== messageId));
|
|
126
|
+
}, [messageId, setMessageIds]);
|
|
127
|
+
return messageId;
|
|
128
|
+
}
|
|
129
|
+
function useRootRef(nativeRef, forwardedRef) {
|
|
130
|
+
return useCallback((element) => {
|
|
131
|
+
const nativeCleanup = typeof nativeRef === 'function'
|
|
132
|
+
? nativeRef(element)
|
|
133
|
+
: nativeRef
|
|
134
|
+
? ((nativeRef.current = element), undefined)
|
|
135
|
+
: undefined;
|
|
136
|
+
const forwardedCleanup = typeof forwardedRef === 'function'
|
|
137
|
+
? forwardedRef(element)
|
|
138
|
+
: forwardedRef
|
|
139
|
+
? ((forwardedRef.current = element), undefined)
|
|
140
|
+
: undefined;
|
|
141
|
+
if (typeof nativeCleanup === 'function' ||
|
|
142
|
+
typeof forwardedCleanup === 'function')
|
|
143
|
+
return () => {
|
|
144
|
+
if (typeof nativeCleanup === 'function')
|
|
145
|
+
nativeCleanup();
|
|
146
|
+
else if (typeof nativeRef === 'function')
|
|
147
|
+
nativeRef(null);
|
|
148
|
+
else if (nativeRef)
|
|
149
|
+
nativeRef.current = null;
|
|
150
|
+
if (typeof forwardedCleanup === 'function')
|
|
151
|
+
forwardedCleanup();
|
|
152
|
+
else if (typeof forwardedRef === 'function')
|
|
153
|
+
forwardedRef(null);
|
|
154
|
+
else if (forwardedRef)
|
|
155
|
+
forwardedRef.current = null;
|
|
156
|
+
};
|
|
157
|
+
}, [nativeRef, forwardedRef]);
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/slider/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAChE,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,aAAa,EACb,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,OAAO,CAAA;AAUd,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AAOnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,IAAI,CAA2C,EAC7D,QAAQ,EACR,IAAI,GAAG,SAAS,EAChB,GAAG,KAAK,EACS;IACjB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAA;IAC1D,OAAO,CACL,KAAC,YAAY,IAAC,KAAK,EAAE,IAAI,YACvB,KAAC,UAAU,CAAC,IAAI,OACV,KAAK,EACT,MAAM,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;gBAC3B,MAAM,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,GAAG,SAAS,CAAA;gBAC/C,OAAO,CACL,KAAC,aAAa,CAAC,QAA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qBACzD,IAAI,OAAO,YAAY,KAAK,UAAU;oBAAE,YAAY,CAAC,IAAI,CAAC,CAAA;qBAC1D,IAAI,YAAY;oBAAE,YAAY,CAAC,OAAO,GAAG,IAAI,CAAA;YACpD,CAAC,CAAA;IACL,CAAC,EACD,CAAC,SAAS,EAAE,YAAY,CAAC,CAC1B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StyleProps } from '../../types/Style.ts';
|
|
2
|
+
import type { LucideProps } from 'lucide-react';
|
|
3
|
+
/**
|
|
4
|
+
* Render Spinner only while your application is busy. It does not detect requests; provide an accessible loading message in the surrounding interface when needed.
|
|
5
|
+
*
|
|
6
|
+
* @example Complete composition
|
|
7
|
+
* import { Spinner } from '@central-ui/react'
|
|
8
|
+
*
|
|
9
|
+
* function Example() {
|
|
10
|
+
* return <Spinner.Spinner />
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export declare function Spinner({ disableStyle, className, ...props }: LucideProps & StyleProps): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,UAAU,+BA4B1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Render Spinner only while your application is busy. It does not detect requests; provide an accessible loading message in the surrounding interface when needed.
|
|
4
|
+
*
|
|
5
|
+
* @example Complete composition
|
|
6
|
+
* import { Spinner } from '@central-ui/react'
|
|
7
|
+
*
|
|
8
|
+
* function Example() {
|
|
9
|
+
* return <Spinner.Spinner />
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export function Spinner({ disableStyle, className, ...props }) {
|
|
13
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", "data-component": "spinner-spinner", "data-style-disabled": disableStyle ? '' : undefined, className: className, strokeWidth: 3, ...props, children: [_jsx("circle", { cx: 12, cy: 12, r: 10, "data-component": "spinner-track" }), _jsx("circle", { cx: 12, cy: 12, r: 10, pathLength: 1, "data-component": "spinner-indicator" }), props.children] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|