@chassis-ui/react 0.1.2 → 0.2.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/dist/accordion.d.ts +2 -0
- package/dist/accordion.js +1 -0
- package/dist/autocomplete.d.ts +2 -0
- package/dist/autocomplete.js +1 -0
- package/dist/avatar.d.ts +2 -0
- package/dist/avatar.js +1 -0
- package/dist/badge.d.ts +2 -0
- package/dist/badge.js +1 -0
- package/dist/breadcrumb.d.ts +2 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/button-group.d.ts +2 -0
- package/dist/button-group.js +1 -0
- package/dist/button.d.ts +3 -0
- package/dist/button.js +1 -0
- package/dist/calendar.d.ts +3 -0
- package/dist/calendar.js +1 -0
- package/dist/card.d.ts +2 -0
- package/dist/card.js +1 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +1 -0
- package/dist/checkbox.d.ts +3 -0
- package/dist/checkbox.js +1 -0
- package/dist/chip-input.d.ts +2 -0
- package/dist/chip-input.js +1 -0
- package/dist/chip.d.ts +2 -0
- package/dist/chip.js +1 -0
- package/dist/chunks/Button-Cptd4Yk7.d.ts +65 -0
- package/dist/chunks/Button-I0aUy5h-.js +1 -0
- package/dist/chunks/Chip-D0Cw0mAr.js +1 -0
- package/dist/chunks/CloseButton-DJM7FRKh.js +1 -0
- package/dist/chunks/ComboboxItem-C9TpoJOI.d.ts +54 -0
- package/dist/chunks/ComboboxListBox-BhO8uRNg.js +1 -0
- package/dist/chunks/FormHelp-Be2PQL0y.js +1 -0
- package/dist/chunks/FormLabel-CYcQiFUI.js +1 -0
- package/dist/chunks/Icon-BIwkD-kx.js +1 -0
- package/dist/chunks/Icon-CioraWLF.d.ts +36 -0
- package/dist/chunks/Link-B0Y1xgYi.d.ts +69 -0
- package/dist/chunks/Link-Cq7FNWpm.js +1 -0
- package/dist/chunks/MenuItemDef-D0VDtYIQ.d.ts +82 -0
- package/dist/chunks/RangeCalendar-COnSfurr.js +1 -0
- package/dist/chunks/accordion-okRicuG5.js +1 -0
- package/dist/chunks/autocomplete-B0xTc6kg.js +1 -0
- package/dist/chunks/avatar-Bjm0DlPO.js +1 -0
- package/dist/chunks/badge-Bj8mf8lu.js +1 -0
- package/dist/chunks/breadcrumb-DDxnx_iS.js +1 -0
- package/dist/chunks/breakpoints-SLMTNHF9.d.ts +5 -0
- package/dist/chunks/breakpoints-o_2Ev7ir.js +1 -0
- package/dist/chunks/button-group-CPZYA6aZ.js +1 -0
- package/dist/chunks/card-DfF2K_5p.js +1 -0
- package/dist/chunks/carousel-DEvwcA7H.js +1 -0
- package/dist/chunks/checkbox-BFPS0pD6.js +1 -0
- package/dist/chunks/chip-input-CB1lE6vP.js +1 -0
- package/dist/chunks/collapse-WifcChO8.js +1 -0
- package/dist/chunks/color-input-CyRaLR_G.js +1 -0
- package/dist/chunks/combobox-DWEj-Sv7.js +1 -0
- package/dist/chunks/datagrid-nbnNThsT.js +2 -0
- package/dist/chunks/dateRangePresets-R1FtA1zp.d.ts +41 -0
- package/dist/chunks/datepicker-CslLKMm1.js +1 -0
- package/dist/chunks/dialogTransition-i9vw0i2Z.js +1 -0
- package/dist/chunks/direction-CPhdeL3A.js +1 -0
- package/dist/chunks/drawer-zReFjoJG.js +1 -0
- package/dist/chunks/file-input-RRqZSzjH.js +1 -0
- package/dist/chunks/flex-BTvpgaRv.js +1 -0
- package/dist/chunks/floating-input-CIC9Lm2a.js +1 -0
- package/dist/chunks/focus-ring-SR_LwaN7.js +1 -0
- package/dist/chunks/focusRedirect-BrvK3U_o.js +1 -0
- package/dist/chunks/form-GpdAyWWi.js +1 -0
- package/dist/chunks/form-field-BjQ9SIjx.js +1 -0
- package/dist/chunks/grid-CuFw89yV.js +1 -0
- package/dist/chunks/icon-mxYpL5nL.js +1 -0
- package/dist/chunks/iconConfig-Bu6Pt9o3.d.ts +69 -0
- package/dist/chunks/iconSlot-BmWxJh27.js +1 -0
- package/dist/chunks/index--0_IpTDT.d.ts +17 -0
- package/dist/chunks/index-6uob77s9.d.ts +80 -0
- package/dist/chunks/index-8PhBSbNQ.d.ts +93 -0
- package/dist/chunks/index-B0-8n-Gs.d.ts +105 -0
- package/dist/chunks/index-B8uaSJA9.d.ts +95 -0
- package/dist/chunks/index-BA-raEMm.d.ts +28 -0
- package/dist/chunks/index-BDfh8YBc.d.ts +39 -0
- package/dist/chunks/index-BKMW0rkw.d.ts +80 -0
- package/dist/chunks/index-BO9jLOIb.d.ts +58 -0
- package/dist/chunks/index-BO_1MN66.d.ts +87 -0
- package/dist/chunks/index-BTDgfLxK.d.ts +94 -0
- package/dist/chunks/index-BTTeKpiE.d.ts +363 -0
- package/dist/chunks/index-BVGGIaPX.d.ts +110 -0
- package/dist/chunks/index-Bi8FFadV.d.ts +98 -0
- package/dist/chunks/index-Bkj17NEQ.d.ts +50 -0
- package/dist/chunks/index-BlgkO3dn.d.ts +280 -0
- package/dist/chunks/index-BxTlIaZu.d.ts +301 -0
- package/dist/chunks/index-C61tPIJ-.d.ts +50 -0
- package/dist/chunks/index-CCXJXToc.d.ts +52 -0
- package/dist/chunks/index-CJzKu7QI.d.ts +40 -0
- package/dist/chunks/index-COsIPd8L.d.ts +62 -0
- package/dist/chunks/index-COsYSDrz.d.ts +109 -0
- package/dist/chunks/index-CRfm7W6C.d.ts +230 -0
- package/dist/chunks/index-CVUMS0x7.d.ts +73 -0
- package/dist/chunks/index-CaQ1JY5D.d.ts +49 -0
- package/dist/chunks/index-Cf2n0l0U.d.ts +138 -0
- package/dist/chunks/index-CftERHnE.d.ts +24 -0
- package/dist/chunks/index-ClT3E_hv.d.ts +302 -0
- package/dist/chunks/index-CsMIgBsd.d.ts +39 -0
- package/dist/chunks/index-Ctuk1xBU.d.ts +99 -0
- package/dist/chunks/index-D2VVO8rx.d.ts +49 -0
- package/dist/chunks/index-D949AidR.d.ts +40 -0
- package/dist/chunks/index-D9PZHY_I.d.ts +135 -0
- package/dist/chunks/index-DAoPg59I.d.ts +80 -0
- package/dist/chunks/index-DB_ToPdz.d.ts +202 -0
- package/dist/chunks/index-DEb9zXlC.d.ts +210 -0
- package/dist/chunks/index-DHGgezXU.d.ts +58 -0
- package/dist/chunks/index-DJJocp_q.d.ts +132 -0
- package/dist/chunks/index-DKma0jQw.d.ts +104 -0
- package/dist/chunks/index-DPV62IdF.d.ts +118 -0
- package/dist/chunks/index-DR8sYtvd.d.ts +296 -0
- package/dist/chunks/index-Dcc_W6Kv.d.ts +146 -0
- package/dist/chunks/index-Dfg4Ftb8.d.ts +68 -0
- package/dist/chunks/index-Dfy1YW5j.d.ts +73 -0
- package/dist/chunks/index-Dh5CaHTP.d.ts +44 -0
- package/dist/chunks/index-DtbUXxjz.d.ts +53 -0
- package/dist/chunks/index-Dum6Y9XR.d.ts +187 -0
- package/dist/chunks/index-HrKN6s8z.d.ts +66 -0
- package/dist/chunks/index-JllMXhVx.d.ts +176 -0
- package/dist/chunks/index-XjLvaH4G.d.ts +67 -0
- package/dist/chunks/index-dh3TKanY.d.ts +235 -0
- package/dist/chunks/index-nklPDKlC.d.ts +137 -0
- package/dist/chunks/index-qgZ5VGmc.d.ts +177 -0
- package/dist/chunks/index-tOodmT36.d.ts +129 -0
- package/dist/chunks/index-t_x6jj7l.d.ts +96 -0
- package/dist/chunks/input-adorn-C_EHML68.js +1 -0
- package/dist/chunks/input-group-iI7azfvE.js +1 -0
- package/dist/chunks/list-CMr-wB9d.js +1 -0
- package/dist/chunks/menu-CXUc-Gva.js +1 -0
- package/dist/chunks/modal-ByIj71Mq.js +1 -0
- package/dist/chunks/nav-BldxFo_B.js +1 -0
- package/dist/chunks/navbar-BwcsQuBk.js +1 -0
- package/dist/chunks/notification-DdqigVB1.js +1 -0
- package/dist/chunks/otp-input-CXe_wkII.js +1 -0
- package/dist/chunks/overlayPlacement-B7843a-Q.d.ts +6 -0
- package/dist/chunks/overlayPlacement-BtS90IVf.js +1 -0
- package/dist/chunks/pagination-BOpEAYW2.js +1 -0
- package/dist/chunks/password-strength-BfLiYiGj.js +1 -0
- package/dist/chunks/placeholder-pg95KELl.js +1 -0
- package/dist/chunks/polymorphic-CACPOv1_.js +1 -0
- package/dist/chunks/polymorphic-CVHbTHSN.d.ts +40 -0
- package/dist/chunks/popover-BpSfnZzk.js +1 -0
- package/dist/chunks/progress-DlrZ71aV.js +1 -0
- package/dist/chunks/radio-BV7Sq6D1.js +1 -0
- package/dist/chunks/range-input-BN3430j-.js +1 -0
- package/dist/chunks/renderFormCheck-BXBs6_ov.js +1 -0
- package/dist/chunks/renderFormCheck-CYWG-Rbt.d.ts +23 -0
- package/dist/chunks/renderFormField-fBEny6JV.d.ts +14 -0
- package/dist/chunks/renderFormField-wiaxvvLG.js +1 -0
- package/dist/chunks/renderMenuItemContent-CmqT3YUQ.js +1 -0
- package/dist/chunks/select-CclIIux8.js +1 -0
- package/dist/chunks/skeleton-CKq76sE_.js +1 -0
- package/dist/chunks/spacingClassName-DVhk8m3P.js +1 -0
- package/dist/chunks/spinner-BEq4PAlu.js +1 -0
- package/dist/chunks/stack-D3retZ-W.js +1 -0
- package/dist/chunks/static-table-D0M4oc_t.js +1 -0
- package/dist/chunks/stepper-CTa6e8uv.js +1 -0
- package/dist/chunks/switch-BmHpq4tL.js +1 -0
- package/dist/chunks/table-Fme9GbAR.js +1 -0
- package/dist/chunks/tableClassName-CZA2Bse8.js +1 -0
- package/dist/chunks/tabs-BnbMJM_b.js +1 -0
- package/dist/chunks/text-input-DD3d08Yf.js +1 -0
- package/dist/chunks/textarea-C0qQdCcu.js +1 -0
- package/dist/chunks/toast-BQhZ2pv5.js +1 -0
- package/dist/chunks/tooltip-DHtVAYUo.js +1 -0
- package/dist/chunks/triggerElement-BIqA4KqZ.js +1 -0
- package/dist/chunks/types-CS_40Txv.d.ts +34 -0
- package/dist/chunks/useButtonSemantics-CILM_lhi.js +1 -0
- package/dist/chunks/useDialogElement-BRIU60cT.js +1 -0
- package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js +1 -0
- package/dist/chunks/useFloatingOverlay-CcmDZKMK.js +1 -0
- package/dist/chunks/useForkedRef-DVEfT-KI.js +1 -0
- package/dist/chunks/useFormField-BOqmBTC4.js +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js +1 -0
- package/dist/chunks/useToastRegionQueue-BH6bWZ73.js +1 -0
- package/dist/chunks/validationClassName-gRGs4KBm.js +1 -0
- package/dist/close-button.d.ts +2 -0
- package/dist/close-button.js +1 -0
- package/dist/collapse.d.ts +2 -0
- package/dist/collapse.js +1 -0
- package/dist/color-input.d.ts +2 -0
- package/dist/color-input.js +1 -0
- package/dist/combobox.d.ts +3 -0
- package/dist/combobox.js +1 -0
- package/dist/datagrid.d.ts +2 -0
- package/dist/datagrid.js +1 -0
- package/dist/datepicker.d.ts +2 -0
- package/dist/datepicker.js +1 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +1 -0
- package/dist/file-input.d.ts +2 -0
- package/dist/file-input.js +1 -0
- package/dist/flex.d.ts +2 -0
- package/dist/flex.js +1 -0
- package/dist/floating-input.d.ts +2 -0
- package/dist/floating-input.js +1 -0
- package/dist/form-field.d.ts +2 -0
- package/dist/form-field.js +1 -0
- package/dist/form.d.ts +2 -0
- package/dist/form.js +1 -0
- package/dist/grid.d.ts +2 -0
- package/dist/grid.js +1 -0
- package/dist/icon.d.ts +4 -0
- package/dist/icon.js +1 -0
- package/dist/index.d.ts +72 -6354
- package/dist/index.js +1 -2
- package/dist/input-adorn.d.ts +2 -0
- package/dist/input-adorn.js +1 -0
- package/dist/input-group.d.ts +2 -0
- package/dist/input-group.js +1 -0
- package/dist/link.d.ts +3 -0
- package/dist/link.js +1 -0
- package/dist/list.d.ts +2 -0
- package/dist/list.js +1 -0
- package/dist/menu.d.ts +3 -0
- package/dist/menu.js +1 -0
- package/dist/modal.d.ts +2 -0
- package/dist/modal.js +1 -0
- package/dist/nav.d.ts +2 -0
- package/dist/nav.js +1 -0
- package/dist/navbar.d.ts +2 -0
- package/dist/navbar.js +1 -0
- package/dist/notification.d.ts +2 -0
- package/dist/notification.js +1 -0
- package/dist/otp-input.d.ts +2 -0
- package/dist/otp-input.js +1 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +1 -0
- package/dist/password-strength.d.ts +2 -0
- package/dist/password-strength.js +1 -0
- package/dist/placeholder.d.ts +2 -0
- package/dist/placeholder.js +1 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +1 -0
- package/dist/progress.d.ts +2 -0
- package/dist/progress.js +1 -0
- package/dist/radio.d.ts +2 -0
- package/dist/radio.js +1 -0
- package/dist/range-input.d.ts +2 -0
- package/dist/range-input.js +1 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +1 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/skeleton.js +1 -0
- package/dist/spinner.d.ts +2 -0
- package/dist/spinner.js +1 -0
- package/dist/stack.d.ts +2 -0
- package/dist/stack.js +1 -0
- package/dist/static-table.d.ts +2 -0
- package/dist/static-table.js +1 -0
- package/dist/stepper.d.ts +2 -0
- package/dist/stepper.js +1 -0
- package/dist/style.css +1 -1
- package/dist/switch.d.ts +2 -0
- package/dist/switch.js +1 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.js +1 -0
- package/dist/tabs.d.ts +2 -0
- package/dist/tabs.js +1 -0
- package/dist/text-input.d.ts +2 -0
- package/dist/text-input.js +1 -0
- package/dist/textarea.d.ts +2 -0
- package/dist/textarea.js +1 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.js +1 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +1 -0
- package/package.json +62 -4
- package/src/components/accordion/index.ts +4 -0
- package/src/components/autocomplete/index.ts +4 -0
- package/src/components/avatar/index.ts +4 -0
- package/src/components/badge/index.ts +4 -0
- package/src/components/breadcrumb/index.ts +4 -0
- package/src/components/button/index.ts +4 -0
- package/src/components/button-group/index.ts +4 -0
- package/src/components/calendar/index.ts +4 -0
- package/src/components/card/index.ts +4 -0
- package/src/components/carousel/CarouselControlButton.tsx +11 -4
- package/src/components/carousel/CarouselControlNext.tsx +6 -0
- package/src/components/carousel/CarouselControlPrev.tsx +6 -0
- package/src/components/carousel/CarouselPlayPause.tsx +27 -4
- package/src/components/carousel/index.ts +4 -0
- package/src/components/checkbox/Checkbox.tsx +19 -4
- package/src/components/checkbox/index.ts +4 -0
- package/src/components/chip/index.ts +4 -0
- package/src/components/chip-input/index.ts +4 -0
- package/src/components/close-button/index.ts +4 -0
- package/src/components/collapse/index.ts +4 -0
- package/src/components/color-input/index.ts +4 -0
- package/src/components/combobox/ComboboxListBox.tsx +2 -2
- package/src/components/combobox/index.ts +4 -0
- package/src/components/datagrid/index.ts +4 -0
- package/src/components/datepicker/index.ts +4 -0
- package/src/components/drawer/index.ts +8 -0
- package/src/components/file-input/index.ts +4 -0
- package/src/components/flex/index.ts +4 -0
- package/src/components/floating-input/index.ts +4 -0
- package/src/components/form/index.ts +4 -0
- package/src/components/form-field/index.ts +4 -0
- package/src/components/grid/index.ts +4 -0
- package/src/components/icon/Icon.tsx +69 -38
- package/src/components/icon/IconProvider.tsx +40 -0
- package/src/components/icon/index.ts +7 -0
- package/src/components/input-adorn/index.ts +4 -0
- package/src/components/input-group/index.ts +4 -0
- package/src/components/link/index.ts +4 -0
- package/src/components/list/index.ts +4 -0
- package/src/components/menu/index.ts +4 -0
- package/src/components/modal/index.ts +8 -0
- package/src/components/nav/index.ts +4 -0
- package/src/components/navbar/NavbarToggler.tsx +9 -3
- package/src/components/navbar/index.ts +4 -0
- package/src/components/notification/Notification.tsx +6 -5
- package/src/components/notification/index.ts +8 -0
- package/src/components/otp-input/index.ts +4 -0
- package/src/components/pagination/Pagination.tsx +16 -3
- package/src/components/pagination/index.ts +8 -0
- package/src/components/password-strength/index.ts +4 -0
- package/src/components/placeholder/index.ts +4 -0
- package/src/components/popover/index.ts +4 -0
- package/src/components/progress/index.ts +4 -0
- package/src/components/radio/Radio.tsx +13 -3
- package/src/components/radio/index.ts +4 -0
- package/src/components/range-input/index.ts +4 -0
- package/src/components/select/index.ts +4 -0
- package/src/components/skeleton/SkeletonLoader.tsx +13 -6
- package/src/components/skeleton/index.ts +4 -0
- package/src/components/spinner/index.ts +4 -0
- package/src/components/stack/index.ts +4 -0
- package/src/components/static-table/StaticTable.tsx +78 -0
- package/src/components/static-table/index.ts +8 -0
- package/src/components/stepper/index.ts +4 -0
- package/src/components/switch/Switch.tsx +16 -3
- package/src/components/switch/index.ts +4 -0
- package/src/components/table/Table.tsx +14 -22
- package/src/components/table/index.ts +4 -0
- package/src/components/tabs/index.ts +4 -0
- package/src/components/text-input/index.ts +4 -0
- package/src/components/textarea/index.ts +4 -0
- package/src/components/toast/Toast.tsx +2 -1
- package/src/components/toast/ToastHeader.tsx +4 -3
- package/src/components/toast/index.ts +8 -0
- package/src/components/tooltip/index.ts +4 -0
- package/src/hooks/useIconConfig.ts +6 -0
- package/src/index.ts +24 -4
- package/src/utils/iconConfig.ts +88 -0
- package/src/utils/iconSlot.tsx +41 -0
- package/src/utils/polymorphic.ts +49 -2
- package/src/utils/renderMenuItemContent.tsx +4 -9
- package/src/utils/slot.tsx +78 -0
- package/src/utils/tableClassName.ts +93 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
+
import { t as Placement } from "./overlayPlacement-B7843a-Q.js";
|
|
3
|
+
import { FC, ReactElement, ReactNode } from "react";
|
|
4
|
+
//#region src/components/tooltip/Tooltip.d.ts
|
|
5
|
+
interface TooltipProps {
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
/**
|
|
8
|
+
* Content node for your component.
|
|
9
|
+
*/
|
|
10
|
+
content: ReactNode | string;
|
|
11
|
+
/**
|
|
12
|
+
* Offset of the tooltip relative to its target, as `[crossAxis, mainAxis]`.
|
|
13
|
+
*/
|
|
14
|
+
offset?: [number, number];
|
|
15
|
+
/**
|
|
16
|
+
* Callback fired when the component requests to be hidden.
|
|
17
|
+
*/
|
|
18
|
+
onHide?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Callback fired when the component requests to be shown.
|
|
21
|
+
*/
|
|
22
|
+
onShow?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Describes the preferred placement of your component. Chassis will flip it to keep it in
|
|
25
|
+
* view.
|
|
26
|
+
*/
|
|
27
|
+
placement?: Placement;
|
|
28
|
+
/**
|
|
29
|
+
* Tooltips always show on focus, since keyboard/screen-reader users need them too. Set to
|
|
30
|
+
* `'focus'` to disable the hover trigger and show on focus only.
|
|
31
|
+
*/
|
|
32
|
+
trigger?: 'hover' | 'focus';
|
|
33
|
+
/**
|
|
34
|
+
* Toggle the visibility of the tooltip component.
|
|
35
|
+
*/
|
|
36
|
+
visible?: boolean;
|
|
37
|
+
}
|
|
38
|
+
declare const Tooltip: FC<TooltipProps>;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { TooltipProps as n, Tooltip as t };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
+
import { n as PolymorphicRef, r as PolymorphicRefWithFallback, t as PolymorphicComponentProps } from "./polymorphic-CVHbTHSN.js";
|
|
3
|
+
import { i as ExtendedSizing, n as ContextColor } from "./types-CS_40Txv.js";
|
|
4
|
+
import React, { ElementType, ImgHTMLAttributes, ReactElement, ReactNode } from "react";
|
|
5
|
+
//#region src/components/avatar/Avatar.d.ts
|
|
6
|
+
type AvatarOwnProps<C extends ElementType> = {
|
|
7
|
+
/**
|
|
8
|
+
* A string of all className you want applied to the component.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the color of the component to one of Chassis context colors.
|
|
13
|
+
*/
|
|
14
|
+
color?: ContextColor;
|
|
15
|
+
/**
|
|
16
|
+
* Toggle the disabled state for the component. Only applies when `component` is `a` or `button`.
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Renders the smooth (tinted background) context variant instead of the solid default.
|
|
21
|
+
*/
|
|
22
|
+
smooth?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the size of the component to one of Chassis component sizes.
|
|
25
|
+
*/
|
|
26
|
+
size?: ExtendedSizing;
|
|
27
|
+
/**
|
|
28
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
29
|
+
* Defaults to `span`, or `a` when `href` is set. Set explicitly to `button` (or another
|
|
30
|
+
* interactive element/component) to make a non-link avatar focusable and clickable.
|
|
31
|
+
*/
|
|
32
|
+
component?: C;
|
|
33
|
+
/**
|
|
34
|
+
* Image source. When set, renders an `AvatarImage` in place of `children`.
|
|
35
|
+
*/
|
|
36
|
+
src?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Alt text for the image rendered when `src` is set.
|
|
39
|
+
*/
|
|
40
|
+
alt?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Renders the avatar as a link to this URL. Defaults `component` to `a`. Passed through to a
|
|
43
|
+
* custom `component` too, regardless of whether it resolves to a native `a`/`button`.
|
|
44
|
+
*/
|
|
45
|
+
href?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Renders a status badge in the bottom-end corner, in one of the Chassis themed colors.
|
|
48
|
+
*/
|
|
49
|
+
status?: ContextColor;
|
|
50
|
+
/**
|
|
51
|
+
* Accessible label for the status badge, exposed to assistive tech as visually hidden text.
|
|
52
|
+
* Falls back to the `status` value itself.
|
|
53
|
+
*/
|
|
54
|
+
statusLabel?: string;
|
|
55
|
+
};
|
|
56
|
+
type AvatarProps<C extends ElementType = 'span'> = PolymorphicComponentProps<C, AvatarOwnProps<C>>;
|
|
57
|
+
type AvatarComponent = (<C extends ElementType = 'span'>(props: AvatarProps<C> & {
|
|
58
|
+
ref?: PolymorphicRefWithFallback<C, HTMLSpanElement | HTMLAnchorElement>;
|
|
59
|
+
}) => ReactElement | null) & {
|
|
60
|
+
displayName?: string;
|
|
61
|
+
};
|
|
62
|
+
declare const Avatar: AvatarComponent;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/components/avatar/AvatarImage.d.ts
|
|
65
|
+
interface AvatarImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
66
|
+
/**
|
|
67
|
+
* A string of all className you want applied to the component.
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/avatar/AvatarStack.d.ts
|
|
74
|
+
interface AvatarStackItemDef {
|
|
75
|
+
/**
|
|
76
|
+
* React key for the rendered `Avatar`. Falls back to the item's index in `data`.
|
|
77
|
+
*/
|
|
78
|
+
key?: string | number;
|
|
79
|
+
/**
|
|
80
|
+
* Image source, rendered via `AvatarImage`.
|
|
81
|
+
*/
|
|
82
|
+
src?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Alt text for the image rendered when `src` is set.
|
|
85
|
+
*/
|
|
86
|
+
alt?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Renders the avatar as a link to this URL.
|
|
89
|
+
*/
|
|
90
|
+
href?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Renders a status badge in one of the Chassis themed colors.
|
|
93
|
+
*/
|
|
94
|
+
status?: ContextColor;
|
|
95
|
+
/**
|
|
96
|
+
* Accessible label for the status badge.
|
|
97
|
+
*/
|
|
98
|
+
statusLabel?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Content to render when `src` isn't set, e.g. initials or a "+5" overflow count.
|
|
101
|
+
*/
|
|
102
|
+
content?: ReactNode;
|
|
103
|
+
/**
|
|
104
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
105
|
+
*/
|
|
106
|
+
component?: ElementType;
|
|
107
|
+
}
|
|
108
|
+
type AvatarStackOwnProps<C extends ElementType> = {
|
|
109
|
+
/**
|
|
110
|
+
* A string of all className you want applied to the component.
|
|
111
|
+
*/
|
|
112
|
+
className?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
115
|
+
*/
|
|
116
|
+
component?: C;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the size of every `Avatar` in the stack to one of Chassis component sizes.
|
|
119
|
+
*/
|
|
120
|
+
size?: ExtendedSizing;
|
|
121
|
+
/**
|
|
122
|
+
* Renders a `Avatar` for each item, ahead of any JSX `children` (handy for a trailing "+N"
|
|
123
|
+
* overflow avatar).
|
|
124
|
+
*/
|
|
125
|
+
items?: AvatarStackItemDef[];
|
|
126
|
+
};
|
|
127
|
+
type AvatarStackProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, AvatarStackOwnProps<C>>;
|
|
128
|
+
type AvatarStackComponent = (<C extends ElementType = 'div'>(props: AvatarStackProps<C> & {
|
|
129
|
+
ref?: PolymorphicRef<C>;
|
|
130
|
+
}) => ReactElement | null) & {
|
|
131
|
+
displayName?: string;
|
|
132
|
+
};
|
|
133
|
+
declare const AvatarStack: AvatarStackComponent;
|
|
134
|
+
//#endregion
|
|
135
|
+
export { AvatarImageProps as a, AvatarImage as i, AvatarStackItemDef as n, Avatar as o, AvatarStackProps as r, AvatarProps as s, AvatarStack as t };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
+
import { n as PolymorphicRef, t as PolymorphicComponentProps } from "./polymorphic-CVHbTHSN.js";
|
|
3
|
+
import React, { ElementType, FormHTMLAttributes, LabelHTMLAttributes, ReactElement } from "react";
|
|
4
|
+
//#region src/components/form/Form.d.ts
|
|
5
|
+
interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
6
|
+
/**
|
|
7
|
+
* A string of all className you want applied to the component.
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Mark a form as validated. If you set it `true`, all validation styles will be applied to the forms component.
|
|
12
|
+
*/
|
|
13
|
+
validated?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/form/FormLabel.d.ts
|
|
18
|
+
interface FormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
19
|
+
/**
|
|
20
|
+
* A string of all className you want applied to the component.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A string of all className you want to be applied to the component, and override standard className value.
|
|
25
|
+
*/
|
|
26
|
+
customClassName?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/form/FormHelp.d.ts
|
|
31
|
+
type FormHelpOwnProps<C extends ElementType> = {
|
|
32
|
+
/**
|
|
33
|
+
* A string of all className you want applied to the component.
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
38
|
+
*/
|
|
39
|
+
component?: C;
|
|
40
|
+
};
|
|
41
|
+
type FormHelpProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FormHelpOwnProps<C>>;
|
|
42
|
+
type FormHelpComponent = (<C extends ElementType = 'div'>(props: FormHelpProps<C> & {
|
|
43
|
+
ref?: PolymorphicRef<C>;
|
|
44
|
+
}) => ReactElement | null) & {
|
|
45
|
+
displayName?: string;
|
|
46
|
+
};
|
|
47
|
+
declare const FormHelp: FormHelpComponent;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/form/FormFeedback.d.ts
|
|
50
|
+
type FormFeedbackOwnProps<C extends ElementType> = {
|
|
51
|
+
/**
|
|
52
|
+
* A string of all className you want applied to the component.
|
|
53
|
+
*/
|
|
54
|
+
className?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
57
|
+
*/
|
|
58
|
+
component?: C;
|
|
59
|
+
/**
|
|
60
|
+
* Set component validation state to invalid.
|
|
61
|
+
*/
|
|
62
|
+
invalid?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* If your form layout allows it, you can display validation feedback in a styled tooltip.
|
|
65
|
+
*/
|
|
66
|
+
tooltip?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Set component validation state to valid.
|
|
69
|
+
*/
|
|
70
|
+
valid?: boolean;
|
|
71
|
+
};
|
|
72
|
+
type FormFeedbackProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, FormFeedbackOwnProps<C>>;
|
|
73
|
+
type FormFeedbackComponent = (<C extends ElementType = 'div'>(props: FormFeedbackProps<C> & {
|
|
74
|
+
ref?: PolymorphicRef<C>;
|
|
75
|
+
}) => ReactElement | null) & {
|
|
76
|
+
displayName?: string;
|
|
77
|
+
};
|
|
78
|
+
declare const FormFeedback: FormFeedbackComponent;
|
|
79
|
+
//#endregion
|
|
80
|
+
export { FormLabel as a, FormProps as c, FormHelpProps as i, FormFeedbackProps as n, FormLabelProps as o, FormHelp as r, Form as s, FormFeedback as t };
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
+
import { n as CalendarLabels, t as DateRangePreset } from "./dateRangePresets-R1FtA1zp.js";
|
|
3
|
+
import React, { HTMLAttributes } from "react";
|
|
4
|
+
import { RangeValue } from "react-aria";
|
|
5
|
+
import { DateValue as DateValue$1 } from "react-stately";
|
|
6
|
+
//#region src/components/calendar/Calendar.d.ts
|
|
7
|
+
interface CalendarBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
8
|
+
/**
|
|
9
|
+
* An accessible label for the calendar, used when there's no visible label. Required for
|
|
10
|
+
* standalone use — a calendar grid has no other accessible name of its own.
|
|
11
|
+
*/
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Identifies a visible label element for the calendar.
|
|
15
|
+
*/
|
|
16
|
+
'aria-labelledby'?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to automatically focus the calendar when it mounts.
|
|
19
|
+
*/
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* A string of all className you want applied to the base component.
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Prevents the calendar from being focused or interacted with.
|
|
27
|
+
*/
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The day that starts the week, overriding the default set by the active locale.
|
|
31
|
+
*
|
|
32
|
+
* @default 'mon'
|
|
33
|
+
*/
|
|
34
|
+
firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
35
|
+
/**
|
|
36
|
+
* Callback that is called for each date in the calendar. If it returns `true`, that date is
|
|
37
|
+
* shown but cannot be selected.
|
|
38
|
+
*/
|
|
39
|
+
isDateUnavailable?: (date: DateValue$1) => boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Overrides for the handful of strings this component renders itself rather than getting from
|
|
42
|
+
* the active locale (the year view's paging arrows, its live-region announcements, and the
|
|
43
|
+
* month/year header buttons). Everything else — month and weekday names, the calendar system —
|
|
44
|
+
* follows `I18nProvider`'s locale via react-aria and needs no override. Merged over the English
|
|
45
|
+
* defaults, so passing one key leaves the rest alone.
|
|
46
|
+
*/
|
|
47
|
+
labels?: Partial<CalendarLabels>;
|
|
48
|
+
/**
|
|
49
|
+
* The maximum allowed date that a user may select.
|
|
50
|
+
*/
|
|
51
|
+
maxValue?: DateValue$1 | null;
|
|
52
|
+
/**
|
|
53
|
+
* The minimum allowed date that a user may select.
|
|
54
|
+
*/
|
|
55
|
+
minValue?: DateValue$1 | null;
|
|
56
|
+
/**
|
|
57
|
+
* ISO 8601 dates (`YYYY-MM-DD`) to mark unselectable, as a convenience alternative to
|
|
58
|
+
* `isDateUnavailable` for data-driven cases (e.g. booked dates fetched from an API). Composed
|
|
59
|
+
* with `isDateUnavailable` when both are given — a date unavailable by either is unavailable.
|
|
60
|
+
*/
|
|
61
|
+
unavailableDates?: string[];
|
|
62
|
+
/**
|
|
63
|
+
* Number of months to display side by side, sharing one selection. Wraps to multiple rows in
|
|
64
|
+
* a narrow container (e.g. a popover on a sm screen) rather than overflowing — the wrap is
|
|
65
|
+
* driven by the calendar's own width, not the viewport, so it adapts correctly regardless of
|
|
66
|
+
* where the calendar is embedded.
|
|
67
|
+
*
|
|
68
|
+
* @default 1
|
|
69
|
+
*/
|
|
70
|
+
visibleMonths?: number;
|
|
71
|
+
}
|
|
72
|
+
interface CalendarSingleProps extends CalendarBaseProps {
|
|
73
|
+
/**
|
|
74
|
+
* The initial selected date (uncontrolled).
|
|
75
|
+
*/
|
|
76
|
+
defaultValue?: DateValue$1 | null;
|
|
77
|
+
/**
|
|
78
|
+
* Callback fired when the selected date changes. Unlike `DatePicker`'s `onChange` (whose
|
|
79
|
+
* segmented field can be cleared to `null`), a calendar selection is always a concrete date.
|
|
80
|
+
*/
|
|
81
|
+
onChange?: (value: DateValue$1) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Whether a single date or multiple, independently toggled dates can be selected.
|
|
84
|
+
*
|
|
85
|
+
* @default 'single'
|
|
86
|
+
*/
|
|
87
|
+
selectionMode?: 'single';
|
|
88
|
+
/**
|
|
89
|
+
* The selected date (controlled).
|
|
90
|
+
*/
|
|
91
|
+
value?: DateValue$1 | null;
|
|
92
|
+
}
|
|
93
|
+
interface CalendarMultipleProps extends CalendarBaseProps {
|
|
94
|
+
/**
|
|
95
|
+
* The initial selected dates (uncontrolled).
|
|
96
|
+
*/
|
|
97
|
+
defaultValue?: DateValue$1[] | null;
|
|
98
|
+
/**
|
|
99
|
+
* Callback fired when the set of selected dates changes.
|
|
100
|
+
*/
|
|
101
|
+
onChange?: (value: DateValue$1[]) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Whether a single date or multiple, independently toggled dates can be selected.
|
|
104
|
+
*
|
|
105
|
+
* @default 'single'
|
|
106
|
+
*/
|
|
107
|
+
selectionMode: 'multiple';
|
|
108
|
+
/**
|
|
109
|
+
* The selected dates (controlled).
|
|
110
|
+
*/
|
|
111
|
+
value?: DateValue$1[] | null;
|
|
112
|
+
}
|
|
113
|
+
type CalendarProps = CalendarSingleProps | CalendarMultipleProps;
|
|
114
|
+
declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/components/calendar/RangeCalendar.d.ts
|
|
117
|
+
interface RangeCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
118
|
+
/**
|
|
119
|
+
* An accessible label for the calendar, used when there's no visible label. Required for
|
|
120
|
+
* standalone use — a calendar grid has no other accessible name of its own.
|
|
121
|
+
*/
|
|
122
|
+
'aria-label'?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Identifies a visible label element for the calendar.
|
|
125
|
+
*/
|
|
126
|
+
'aria-labelledby'?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Whether to automatically focus the calendar when it mounts.
|
|
129
|
+
*/
|
|
130
|
+
autoFocus?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* A string of all className you want applied to the base component.
|
|
133
|
+
*/
|
|
134
|
+
className?: string;
|
|
135
|
+
/**
|
|
136
|
+
* The initial selected date range (uncontrolled).
|
|
137
|
+
*/
|
|
138
|
+
defaultValue?: RangeValue<DateValue$1> | null;
|
|
139
|
+
/**
|
|
140
|
+
* Prevents the calendar from being focused or interacted with.
|
|
141
|
+
*/
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* The day that starts the week, overriding the default set by the active locale.
|
|
145
|
+
*
|
|
146
|
+
* @default 'mon'
|
|
147
|
+
*/
|
|
148
|
+
firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
149
|
+
/**
|
|
150
|
+
* Callback that is called for each date in the calendar. If it returns `true`, that date is
|
|
151
|
+
* shown but cannot be selected.
|
|
152
|
+
*/
|
|
153
|
+
isDateUnavailable?: (date: DateValue$1) => boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Overrides for the handful of strings this component renders itself rather than getting from
|
|
156
|
+
* the active locale (the year view's paging arrows, its live-region announcements, and the
|
|
157
|
+
* month/year header buttons). Everything else — month and weekday names, the calendar system —
|
|
158
|
+
* follows `I18nProvider`'s locale via react-aria and needs no override. Merged over the English
|
|
159
|
+
* defaults, so passing one key leaves the rest alone.
|
|
160
|
+
*/
|
|
161
|
+
labels?: Partial<CalendarLabels>;
|
|
162
|
+
/**
|
|
163
|
+
* The maximum allowed date that a user may select.
|
|
164
|
+
*/
|
|
165
|
+
maxValue?: DateValue$1 | null;
|
|
166
|
+
/**
|
|
167
|
+
* The minimum allowed date that a user may select.
|
|
168
|
+
*/
|
|
169
|
+
minValue?: DateValue$1 | null;
|
|
170
|
+
/**
|
|
171
|
+
* Callback fired when a complete range is selected (both a start and end date).
|
|
172
|
+
*/
|
|
173
|
+
onChange?: (value: RangeValue<DateValue$1>) => void;
|
|
174
|
+
/**
|
|
175
|
+
* A list of quick-select range presets shown beside the calendar. Selecting a preset commits
|
|
176
|
+
* its range immediately, the same as picking a start and end date from the grid. The preset
|
|
177
|
+
* matching the current selection (if any) is marked selected. Omit to not show a preset list.
|
|
178
|
+
*/
|
|
179
|
+
presets?: DateRangePreset[];
|
|
180
|
+
/**
|
|
181
|
+
* ISO 8601 dates (`YYYY-MM-DD`) to mark unselectable, as a convenience alternative to
|
|
182
|
+
* `isDateUnavailable` for data-driven cases (e.g. booked dates fetched from an API). Composed
|
|
183
|
+
* with `isDateUnavailable` when both are given — a date unavailable by either is unavailable.
|
|
184
|
+
*/
|
|
185
|
+
unavailableDates?: string[];
|
|
186
|
+
/**
|
|
187
|
+
* The selected date range (controlled).
|
|
188
|
+
*/
|
|
189
|
+
value?: RangeValue<DateValue$1> | null;
|
|
190
|
+
/**
|
|
191
|
+
* Number of months to display side by side, sharing one selection. Wraps to multiple rows in
|
|
192
|
+
* a narrow container (e.g. a popover on a sm screen) rather than overflowing — the wrap is
|
|
193
|
+
* driven by the calendar's own width, not the viewport, so it adapts correctly regardless of
|
|
194
|
+
* where the calendar is embedded.
|
|
195
|
+
*
|
|
196
|
+
* @default 1
|
|
197
|
+
*/
|
|
198
|
+
visibleMonths?: number;
|
|
199
|
+
}
|
|
200
|
+
declare const RangeCalendar: React.ForwardRefExoticComponent<RangeCalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
201
|
+
//#endregion
|
|
202
|
+
export { CalendarProps as a, CalendarMultipleProps as i, RangeCalendarProps as n, CalendarSingleProps as o, Calendar as r, RangeCalendar as t };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
+
import { n as PolymorphicRef, t as PolymorphicComponentProps } from "./polymorphic-CVHbTHSN.js";
|
|
3
|
+
import { s as Spacing, t as Breakpoint } from "./types-CS_40Txv.js";
|
|
4
|
+
import { n as Span } from "./breakpoints-SLMTNHF9.js";
|
|
5
|
+
import React, { ElementType, HTMLAttributes, ReactElement } from "react";
|
|
6
|
+
//#region src/components/grid/Col.d.ts
|
|
7
|
+
interface ColLayout {
|
|
8
|
+
/**
|
|
9
|
+
* Columns (of 12) this Col spans, or `'auto'`/`true` for a natural-width column.
|
|
10
|
+
*
|
|
11
|
+
* @type { 'auto' | number | string | boolean }
|
|
12
|
+
*/
|
|
13
|
+
span?: Span;
|
|
14
|
+
/**
|
|
15
|
+
* Columns to offset the start of this Col by.
|
|
16
|
+
*/
|
|
17
|
+
offset?: number | string;
|
|
18
|
+
/**
|
|
19
|
+
* Visual order relative to sibling columns.
|
|
20
|
+
*
|
|
21
|
+
* @type { 'first' | 'last' | number | string }
|
|
22
|
+
*/
|
|
23
|
+
order?: 'first' | 'last' | number | string;
|
|
24
|
+
}
|
|
25
|
+
interface ColProps extends HTMLAttributes<HTMLDivElement>, ColLayout {
|
|
26
|
+
/**
|
|
27
|
+
* A string of all className you want applied to the base component.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Overrides `span`/`offset`/`order` at a breakpoint and up.
|
|
32
|
+
*
|
|
33
|
+
* @type { Partial<Record<'sm' | 'md' | 'lg' | 'xl' | '2xl', { span?: 'auto' | number | string | boolean, offset?: number | string, order?: 'first' | 'last' | number | string }>> }
|
|
34
|
+
*/
|
|
35
|
+
responsive?: Partial<Record<Breakpoint, ColLayout>>;
|
|
36
|
+
}
|
|
37
|
+
declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/grid/Container.d.ts
|
|
40
|
+
type ContainerOwnProps<C extends ElementType> = {
|
|
41
|
+
/**
|
|
42
|
+
* A string of all className you want applied to the base component.
|
|
43
|
+
*/
|
|
44
|
+
className?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
47
|
+
*/
|
|
48
|
+
component?: C;
|
|
49
|
+
/**
|
|
50
|
+
* Set container 100% wide until the given breakpoint, after which it scales up with `max-width`
|
|
51
|
+
* at every larger breakpoint.
|
|
52
|
+
*
|
|
53
|
+
* @type Breakpoint
|
|
54
|
+
*/
|
|
55
|
+
fluidUntil?: Breakpoint;
|
|
56
|
+
/**
|
|
57
|
+
* Set container 100% wide, spanning the entire width of the viewport.
|
|
58
|
+
*/
|
|
59
|
+
fluid?: boolean;
|
|
60
|
+
};
|
|
61
|
+
type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, ContainerOwnProps<C>>;
|
|
62
|
+
type ContainerComponent = (<C extends ElementType = 'div'>(props: ContainerProps<C> & {
|
|
63
|
+
ref?: PolymorphicRef<C>;
|
|
64
|
+
}) => ReactElement | null) & {
|
|
65
|
+
displayName?: string;
|
|
66
|
+
};
|
|
67
|
+
declare const Container: ContainerComponent;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/grid/Grid.d.ts
|
|
70
|
+
type GridOwnProps<C extends ElementType> = {
|
|
71
|
+
/**
|
|
72
|
+
* A string of all className you want applied to the base component.
|
|
73
|
+
*/
|
|
74
|
+
className?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
77
|
+
*/
|
|
78
|
+
component?: C;
|
|
79
|
+
/**
|
|
80
|
+
* Number of columns in the grid template, set via the `--cx-grid-columns` custom property
|
|
81
|
+
* (defaults to `12` in CSS when omitted). Has no effect when `fill` is set.
|
|
82
|
+
*/
|
|
83
|
+
columns?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Number of rows in the grid template, set via the `--cx-grid-rows` custom property (defaults
|
|
86
|
+
* to `1` in CSS when omitted). Has no effect when `fill` is set.
|
|
87
|
+
*/
|
|
88
|
+
rows?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Gap between grid items, set via the `--cx-grid-gap` custom property (or `--cx-gap` when
|
|
91
|
+
* `fill` is set). Accepts a `Spacing` token (mapped to the matching `--cx-space-*` custom
|
|
92
|
+
* property) or any raw CSS `gap` value, including a `"{row} {column}"` pair.
|
|
93
|
+
*
|
|
94
|
+
* @type { Spacing | string }
|
|
95
|
+
*/
|
|
96
|
+
gap?: Spacing | (string & {});
|
|
97
|
+
/**
|
|
98
|
+
* Renders `.grid-fill` instead of `.grid` — columns expand equally to fill the available
|
|
99
|
+
* width, with the column count determined by the number of children rather than `columns`.
|
|
100
|
+
*/
|
|
101
|
+
fill?: boolean;
|
|
102
|
+
};
|
|
103
|
+
type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps<C>>;
|
|
104
|
+
type GridComponent = (<C extends ElementType = 'div'>(props: GridProps<C> & {
|
|
105
|
+
ref?: PolymorphicRef<C>;
|
|
106
|
+
}) => ReactElement | null) & {
|
|
107
|
+
displayName?: string;
|
|
108
|
+
};
|
|
109
|
+
declare const Grid: GridComponent;
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/grid/GridItem.d.ts
|
|
112
|
+
interface GridItemLayout {
|
|
113
|
+
/**
|
|
114
|
+
* Number of grid column tracks (of the parent `<Grid>`'s `columns`) this item spans, mapped to
|
|
115
|
+
* the `g-col-{n}` class.
|
|
116
|
+
*/
|
|
117
|
+
span?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Grid column line to start this item at, mapped to the `g-start-{n}` class.
|
|
120
|
+
*/
|
|
121
|
+
start?: number;
|
|
122
|
+
}
|
|
123
|
+
type GridItemOwnProps<C extends ElementType> = GridItemLayout & {
|
|
124
|
+
/**
|
|
125
|
+
* A string of all className you want applied to the base component.
|
|
126
|
+
*/
|
|
127
|
+
className?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
130
|
+
*/
|
|
131
|
+
component?: C;
|
|
132
|
+
/**
|
|
133
|
+
* Overrides `span`/`start` at a breakpoint and up.
|
|
134
|
+
*
|
|
135
|
+
* @type { Partial<Record<'sm' | 'md' | 'lg' | 'xl' | '2xl', { span?: number, start?: number }>> }
|
|
136
|
+
*/
|
|
137
|
+
responsive?: Partial<Record<Breakpoint, GridItemLayout>>;
|
|
138
|
+
/**
|
|
139
|
+
* Turns this item into a nested subgrid: adds `.grid`/`.grid-cols-subgrid` alongside its
|
|
140
|
+
* `g-col-{n}`/`g-start-{n}` placement classes, so its own children inherit the parent
|
|
141
|
+
* `<Grid>`'s column tracks instead of defining new ones. Combine with `span` — a subgrid
|
|
142
|
+
* item must itself be a grid item of the parent for `grid-template-columns: subgrid` to take
|
|
143
|
+
* effect, which is why `subgrid` lives on `<GridItem>` (the element actually placed as a grid
|
|
144
|
+
* item) rather than on a `<Grid>` nested inside it.
|
|
145
|
+
*/
|
|
146
|
+
subgrid?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Number of rows in the subgrid's own row template, set via the `--cx-grid-rows` custom
|
|
149
|
+
* property (defaults to `1` in CSS when omitted). Only relevant when `subgrid` is set —
|
|
150
|
+
* subgrid only inherits the parent's column tracks, not its rows.
|
|
151
|
+
*/
|
|
152
|
+
rows?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Gap between the subgrid's children, set via the `--cx-grid-gap` custom property. Only
|
|
155
|
+
* relevant when `subgrid` is set — a subgrid doesn't inherit its parent's gap.
|
|
156
|
+
*
|
|
157
|
+
* @type { Spacing | string }
|
|
158
|
+
*/
|
|
159
|
+
gap?: Spacing | (string & {});
|
|
160
|
+
};
|
|
161
|
+
type GridItemProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridItemOwnProps<C>>;
|
|
162
|
+
type GridItemComponent = (<C extends ElementType = 'div'>(props: GridItemProps<C> & {
|
|
163
|
+
ref?: PolymorphicRef<C>;
|
|
164
|
+
}) => ReactElement | null) & {
|
|
165
|
+
displayName?: string;
|
|
166
|
+
};
|
|
167
|
+
declare const GridItem: GridItemComponent;
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/components/grid/Row.d.ts
|
|
170
|
+
interface RowLayout {
|
|
171
|
+
/**
|
|
172
|
+
* Equal-width columns per row, or `'auto'` for content-sized columns.
|
|
173
|
+
*
|
|
174
|
+
* @type { 'auto' | number | string }
|
|
175
|
+
*/
|
|
176
|
+
cols?: 'auto' | number | string;
|
|
177
|
+
/**
|
|
178
|
+
* Gutter width on both axes.
|
|
179
|
+
*
|
|
180
|
+
* @type { Spacing | 0 }
|
|
181
|
+
*/
|
|
182
|
+
gutter?: Spacing | 0;
|
|
183
|
+
/**
|
|
184
|
+
* Horizontal gutter width.
|
|
185
|
+
*
|
|
186
|
+
* @type { Spacing | 0 }
|
|
187
|
+
*/
|
|
188
|
+
gutterX?: Spacing | 0;
|
|
189
|
+
/**
|
|
190
|
+
* Vertical gutter width.
|
|
191
|
+
*
|
|
192
|
+
* @type { Spacing | 0 }
|
|
193
|
+
*/
|
|
194
|
+
gutterY?: Spacing | 0;
|
|
195
|
+
}
|
|
196
|
+
interface RowProps extends HTMLAttributes<HTMLDivElement>, RowLayout {
|
|
197
|
+
/**
|
|
198
|
+
* A string of all className you want applied to the base component.
|
|
199
|
+
*/
|
|
200
|
+
className?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Overrides `cols`/`gutter`/`gutterX`/`gutterY` at a breakpoint and up.
|
|
203
|
+
*
|
|
204
|
+
* @type { Partial<Record<'sm' | 'md' | 'lg' | 'xl' | '2xl', { cols?: 'auto' | number | string, gutter?: Spacing | 0, gutterX?: Spacing | 0, gutterY?: Spacing | 0 }>> }
|
|
205
|
+
*/
|
|
206
|
+
responsive?: Partial<Record<Breakpoint, RowLayout>>;
|
|
207
|
+
}
|
|
208
|
+
declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLDivElement>>;
|
|
209
|
+
//#endregion
|
|
210
|
+
export { GridItemProps as a, Container as c, ColProps as d, GridItemLayout as i, ContainerProps as l, RowProps as n, Grid as o, GridItem as r, GridProps as s, Row as t, Col as u };
|