pixelize-design-library 2.4.2-beta.3 → 2.4.2-beta.30
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/Components/Accordion/Accordion.js +5 -3
- package/dist/Components/AppSwitcher/AppMark.d.ts +19 -0
- package/dist/Components/AppSwitcher/AppMark.js +62 -0
- package/dist/Components/AppSwitcher/AppSwitcher.d.ts +4 -0
- package/dist/Components/AppSwitcher/AppSwitcher.js +315 -0
- package/dist/Components/AppSwitcher/AppSwitcherProps.d.ts +64 -0
- package/dist/Components/AppSwitcher/AppSwitcherProps.js +86 -0
- package/dist/Components/AppSwitcher/useAppSwitcherShortcut.d.ts +3 -0
- package/dist/Components/AppSwitcher/useAppSwitcherShortcut.js +31 -0
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +2 -1
- package/dist/Components/Button/Button.d.ts +2 -2
- package/dist/Components/Button/Button.js +4 -3
- package/dist/Components/Button/Button.styles.js +62 -15
- package/dist/Components/Button/ButtonProps.d.ts +6 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
- package/dist/Components/Card/Card.d.ts +1 -1
- package/dist/Components/Card/Card.js +2 -2
- package/dist/Components/Card/CardProps.d.ts +0 -1
- package/dist/Components/Card/PaymentCard/PaymentCard.js +7 -7
- package/dist/Components/Checkbox/Checkbox.js +1 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +12 -7
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +6 -2
- package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/Components/DatePicker/CalendarPanel.d.ts +5 -0
- package/dist/Components/DatePicker/CalendarPanel.js +24 -5
- package/dist/Components/DatePicker/DatePickerProps.d.ts +21 -0
- package/dist/Components/DatePicker/RangeDatePicker.js +4 -4
- package/dist/Components/DatePicker/SingleDatePicker.js +2 -2
- package/dist/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/Components/DatePicker/dayStates.d.ts +56 -0
- package/dist/Components/DatePicker/dayStates.js +87 -0
- package/dist/Components/Dropdown/DropDown.js +7 -15
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/Components/EmptyState/EmptyState.js +2 -1
- package/dist/Components/FilePreview/FilePreview.js +1 -1
- package/dist/Components/FileUpload/FileUpload.js +5 -4
- package/dist/Components/FileUpload/FileUploadProps.d.ts +3 -1
- package/dist/Components/FileUpload/constants.js +1 -0
- package/dist/Components/FilterSidebar/FilterSidebar.js +4 -4
- package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +0 -9
- package/dist/Components/FilterSidebar/filterHoverStyle.js +4 -10
- package/dist/Components/Form/FormWrapper.js +1 -1
- package/dist/Components/Header/components/mobileMenu.js +12 -3
- package/dist/Components/Input/TextInput.styles.js +6 -4
- package/dist/Components/InputTextArea/InputTextArea.style.js +5 -4
- package/dist/Components/KanbanBoard/KanbanBoard.js +5 -45
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +4 -5
- package/dist/Components/Loading/Loading.js +15 -14
- package/dist/Components/MultiSelect/MultiSelect.js +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +3 -3
- package/dist/Components/NoteTextArea/NoteTextArea.js +9 -4
- package/dist/Components/NumberInput/NumberInput.js +3 -1
- package/dist/Components/NumberInput/NumberInput.styles.js +5 -4
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- package/dist/Components/PdfViewer/PdfViewer.js +6 -1
- package/dist/Components/PinInput/PinInput.js +1 -1
- package/dist/Components/PlanPill/PlanPill.js +5 -5
- package/dist/Components/PlanPill/planPillGradient.d.ts +2 -14
- package/dist/Components/PlanPill/planPillGradient.js +3 -15
- package/dist/Components/Primitives/Primitives.d.ts +6 -0
- package/dist/Components/Primitives/Primitives.js +113 -0
- package/dist/Components/ProductCard/ProductPrice.js +1 -1
- package/dist/Components/ProductCard/ProductReview.js +6 -1
- package/dist/Components/ProductCard/ProductTags.js +1 -1
- package/dist/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/Components/RadioButton/RadioButton.js +3 -2
- package/dist/Components/Reorder/Reorder.js +1 -1
- package/dist/Components/ScrollToTop/ScrollToTop.js +2 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +13 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
- package/dist/Components/Search/Search.js +2 -2
- package/dist/Components/SearchSelect/SearchSelect.js +14 -9
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +2 -0
- package/dist/Components/SegmentedControl/SegmentedControl.js +58 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +16 -0
- package/dist/Components/SegmentedControl/SegmentedControlProps.js +2 -0
- package/dist/Components/Select/Select.d.ts +1 -1
- package/dist/Components/Select/Select.js +4 -2
- package/dist/Components/Select/Select.styles.js +3 -2
- package/dist/Components/Select/SelectProps.d.ts +3 -0
- package/dist/Components/SelectSearch/SelectSearch.js +7 -4
- package/dist/Components/SelectV2/SelectV2.js +18 -14
- package/dist/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/Components/SideBar/SideBar.js +1 -1
- package/dist/Components/SideBar/components/MenuPopoverContent.js +2 -2
- package/dist/Components/Slider/Slider.js +8 -1
- package/dist/Components/StageProgress/StageProgress.js +2 -9
- package/dist/Components/StageProgress/StepperStage.js +2 -2
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +17 -24
- package/dist/Components/Table/TableProps.d.ts +4 -0
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/components/TableActions.js +2 -2
- package/dist/Components/Table/components/TableBody.js +41 -12
- package/dist/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/Components/Table/components/TableHeader.js +21 -8
- package/dist/Components/Table/components/TableSearch.js +1 -1
- package/dist/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/Components/Table/settings/ManageColumns.js +4 -17
- package/dist/Components/Table/settings/TableSettings.js +5 -11
- package/dist/Components/Table/variants/TableVariantContext.d.ts +4 -0
- package/dist/Components/Table/variants/TableVariantContext.js +17 -0
- package/dist/Components/Table/variants/classic.d.ts +6 -0
- package/dist/Components/Table/variants/classic.js +47 -0
- package/dist/Components/Table/variants/index.d.ts +7 -0
- package/dist/Components/Table/variants/index.js +27 -0
- package/dist/Components/Table/variants/pillInk.d.ts +6 -0
- package/dist/Components/Table/variants/pillInk.js +21 -0
- package/dist/Components/Table/variants/studio.d.ts +6 -0
- package/dist/Components/Table/variants/studio.js +50 -0
- package/dist/Components/Table/variants/tokens.d.ts +49 -0
- package/dist/Components/Table/variants/tokens.js +2 -0
- package/dist/Components/Tag/Tag.styles.js +3 -4
- package/dist/Components/Timeline/Timeline.js +2 -2
- package/dist/Components/Toaster/Toaster.js +1 -1
- package/dist/Components/Toggle/TableToggle.js +11 -7
- package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +2 -0
- package/dist/Components/ToggleSwitch/ToggleSwitch.js +18 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.d.ts +11 -0
- package/dist/Components/ToggleSwitch/ToggleSwitchProps.js +2 -0
- package/dist/Components/ToolTip/ToolTip.js +6 -6
- package/dist/Components/ToolTip/ToolTipProps.d.ts +3 -1
- package/dist/Components/Trail/TrailWorks.js +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +3 -3
- package/dist/Constants/Sidebar.js +3 -2
- package/dist/Theme/assertPalette.d.ts +1 -1
- package/dist/Theme/assertPalette.js +3 -2
- package/dist/Theme/chakra/Menu.styles.d.ts +3 -0
- package/dist/Theme/chakra/Menu.styles.js +5 -0
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -0
- package/dist/Theme/chakra/Popover.styles.js +5 -1
- package/dist/Theme/chakra/componentStyles.d.ts +6 -0
- package/dist/Theme/chakra/createBrandTheme.js +10 -16
- package/dist/Theme/chakra/focusRing.styles.d.ts +52 -0
- package/dist/Theme/chakra/focusRing.styles.js +46 -0
- package/dist/Theme/provider/ThemeSwitcher.js +5 -2
- package/dist/Theme/tokens/brands/index.js +6 -1
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +1 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.js +6 -1
- package/dist/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/Theme/tokens/builders/focusRing.d.ts +52 -0
- package/dist/Theme/tokens/builders/focusRing.js +92 -0
- package/dist/Theme/tokens/builders/gradientInk.d.ts +22 -0
- package/dist/Theme/tokens/builders/gradientInk.js +28 -0
- package/dist/Theme/tokens/builders/index.d.ts +4 -0
- package/dist/Theme/tokens/builders/index.js +4 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +46 -3
- package/dist/Theme/tokens/builders/outlineRung.js +101 -5
- package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
- package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +5 -1
- package/dist/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/Theme/tokens/builders/rowStates.d.ts +13 -0
- package/dist/Theme/tokens/builders/rowStates.js +19 -0
- package/dist/Theme/tokens/builders/scrollbar.d.ts +12 -0
- package/dist/Theme/tokens/builders/scrollbar.js +57 -0
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +20 -5
- package/dist/Theme/tokens/types.d.ts +21 -1
- package/dist/esm/Components/Accordion/Accordion.js +5 -3
- package/dist/esm/Components/AppSwitcher/AppMark.js +56 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +280 -0
- package/dist/esm/Components/AppSwitcher/AppSwitcherProps.js +78 -0
- package/dist/esm/Components/AppSwitcher/useAppSwitcherShortcut.js +27 -0
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +2 -1
- package/dist/esm/Components/Button/Button.js +5 -4
- package/dist/esm/Components/Button/Button.styles.js +63 -16
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
- package/dist/esm/Components/Card/Card.js +2 -2
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +7 -7
- package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +13 -8
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +7 -3
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +24 -5
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +4 -4
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +2 -2
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/esm/Components/DatePicker/dayStates.js +79 -0
- package/dist/esm/Components/Dropdown/DropDown.js +7 -15
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/esm/Components/EmptyState/EmptyState.js +2 -1
- package/dist/esm/Components/FilePreview/FilePreview.js +1 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +6 -5
- package/dist/esm/Components/FileUpload/constants.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +4 -4
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +4 -10
- package/dist/esm/Components/Form/FormWrapper.js +1 -1
- package/dist/esm/Components/Header/components/mobileMenu.js +12 -3
- package/dist/esm/Components/Input/TextInput.styles.js +6 -4
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +5 -4
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +5 -45
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -5
- package/dist/esm/Components/Loading/Loading.js +12 -11
- package/dist/esm/Components/MultiSelect/MultiSelect.js +1 -1
- package/dist/esm/Components/NavigationBar/NavigationBar.js +3 -3
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +9 -4
- package/dist/esm/Components/NumberInput/NumberInput.js +4 -2
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +5 -4
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- package/dist/esm/Components/PdfViewer/PdfViewer.js +6 -1
- package/dist/esm/Components/PinInput/PinInput.js +1 -1
- package/dist/esm/Components/PlanPill/PlanPill.js +6 -6
- package/dist/esm/Components/PlanPill/planPillGradient.js +3 -15
- package/dist/esm/Components/Primitives/Primitives.js +6 -0
- package/dist/esm/Components/ProductCard/ProductPrice.js +1 -1
- package/dist/esm/Components/ProductCard/ProductReview.js +6 -1
- package/dist/esm/Components/ProductCard/ProductTags.js +1 -1
- package/dist/esm/Components/ProfileCard/ProfileCard.js +1 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +3 -2
- package/dist/esm/Components/Reorder/Reorder.js +1 -1
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +2 -0
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -0
- package/dist/esm/Components/Search/Search.js +2 -2
- package/dist/esm/Components/SearchSelect/SearchSelect.js +14 -9
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +55 -0
- package/dist/esm/Components/SegmentedControl/SegmentedControlProps.js +1 -0
- package/dist/esm/Components/Select/Select.js +5 -3
- package/dist/esm/Components/Select/Select.styles.js +3 -2
- package/dist/esm/Components/SelectSearch/SelectSearch.js +7 -4
- package/dist/esm/Components/SelectV2/SelectV2.js +18 -14
- package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/esm/Components/SideBar/SideBar.js +1 -1
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +2 -2
- package/dist/esm/Components/Slider/Slider.js +8 -1
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -2
- package/dist/esm/Components/Table/Table.js +17 -24
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/components/TableActions.js +2 -2
- package/dist/esm/Components/Table/components/TableBody.js +42 -13
- package/dist/esm/Components/Table/components/TableGroupRow.js +1 -1
- package/dist/esm/Components/Table/components/TableHeader.js +21 -8
- package/dist/esm/Components/Table/components/TableSearch.js +1 -1
- package/dist/esm/Components/Table/filters/ActiveFilters.js +2 -18
- package/dist/esm/Components/Table/settings/ManageColumns.js +4 -17
- package/dist/esm/Components/Table/settings/TableSettings.js +5 -11
- package/dist/esm/Components/Table/variants/TableVariantContext.js +13 -0
- package/dist/esm/Components/Table/variants/classic.js +43 -0
- package/dist/esm/Components/Table/variants/index.js +9 -0
- package/dist/esm/Components/Table/variants/pillInk.js +18 -0
- package/dist/esm/Components/Table/variants/studio.js +46 -0
- package/dist/esm/Components/Table/variants/tokens.js +1 -0
- package/dist/esm/Components/Tag/Tag.styles.js +3 -4
- package/dist/esm/Components/Timeline/Timeline.js +2 -2
- package/dist/esm/Components/Toaster/Toaster.js +1 -1
- package/dist/esm/Components/Toggle/TableToggle.js +11 -7
- package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +15 -0
- package/dist/esm/Components/ToggleSwitch/ToggleSwitchProps.js +1 -0
- package/dist/esm/Components/ToolTip/ToolTip.js +6 -6
- package/dist/esm/Components/Trail/TrailWorks.js +1 -1
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +3 -3
- package/dist/esm/Constants/Sidebar.js +3 -2
- package/dist/esm/Theme/assertPalette.js +3 -2
- package/dist/esm/Theme/chakra/Menu.styles.js +5 -0
- package/dist/esm/Theme/chakra/Popover.styles.js +5 -1
- package/dist/esm/Theme/chakra/createBrandTheme.js +10 -16
- package/dist/esm/Theme/chakra/focusRing.styles.js +40 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +5 -2
- package/dist/esm/Theme/tokens/brands/index.js +6 -1
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +6 -1
- package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/esm/Theme/tokens/builders/focusRing.js +85 -0
- package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
- package/dist/esm/Theme/tokens/builders/index.js +4 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +96 -4
- package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +7 -2
- package/dist/esm/Theme/tokens/builders/rowStates.js +15 -0
- package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -5
- package/dist/esm/index.js +24 -1
- package/dist/index.d.ts +27 -3
- package/dist/index.js +64 -4
- package/package.json +8 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { type ComponentWithAs } from "@chakra-ui/react";
|
|
1
2
|
import { ButtonProps } from "./ButtonProps";
|
|
2
|
-
declare
|
|
3
|
-
declare const _default: import("react").MemoExoticComponent<typeof Button>;
|
|
3
|
+
declare const _default: ComponentWithAs<"button", ButtonProps>;
|
|
4
4
|
export default _default;
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const react_2 = require("@chakra-ui/react");
|
|
6
|
-
function Button({ label, children, onClick, opacity, variant = "solid", leftIcon, rightIcon, size, isDisabled = false, isLoading = false, loadingText = "Loading", type, width, sx, colorScheme,
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
const Button = (0, react_1.forwardRef)(function Button({ label, children, onClick, opacity, variant = "solid", leftIcon, rightIcon, size, isDisabled = false, isLoading = false, loadingText = "Loading", type, width, w, sx, colorScheme, border, borderRadius, onMouseEnter, onMouseLeave, ...aria }, ref) {
|
|
7
|
+
const isIconOnly = !children && !label && !!(leftIcon || rightIcon);
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Button, { ...aria, type: type, onClick: onClick, width: width || w || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, iconSpacing: isIconOnly ? 0 : undefined, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children !== null && children !== void 0 ? children : label }));
|
|
9
|
+
});
|
|
9
10
|
exports.default = (0, react_1.memo)(Button);
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Button = void 0;
|
|
4
4
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
5
|
+
const color_1 = require("../../Theme/tokens/builders/color");
|
|
6
|
+
const gradientInk_1 = require("../../Theme/tokens/builders/gradientInk");
|
|
7
|
+
const focusRing_styles_1 = require("../../Theme/chakra/focusRing.styles");
|
|
5
8
|
/**
|
|
6
9
|
* Outline/ghost/link text sits ON the canvas, so it needs a rung that stays readable there —
|
|
7
10
|
* `[500]` is pinned dark enough to carry a white label on the solid variant and measures only
|
|
@@ -29,14 +32,50 @@ const onCanvasHoverBg = (theme, colorScheme, step) => {
|
|
|
29
32
|
* ~3.2 contrast.
|
|
30
33
|
*/
|
|
31
34
|
const FILL_STEP_RUNGS = { light: [600, 700], dark: [400, 300] };
|
|
35
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
36
|
+
const AA_NORMAL_TEXT = 4.5;
|
|
37
|
+
// Semantic scales (red/green) carry no opacity ramp; brand scales do and keep their own [500].
|
|
38
|
+
const solidRung = (theme, colorScheme) => {
|
|
39
|
+
const scale = theme.colors[colorScheme];
|
|
40
|
+
const white = theme.colors.white;
|
|
41
|
+
if ("opacity" in scale)
|
|
42
|
+
return 500;
|
|
43
|
+
if ((0, color_1.contrastRatio)(scale[500], white) >= AA_NORMAL_TEXT)
|
|
44
|
+
return 500;
|
|
45
|
+
const passing = RUNGS.filter((r) => scale[r] && (0, color_1.contrastRatio)(scale[r], white) >= AA_NORMAL_TEXT);
|
|
46
|
+
if (!passing.length)
|
|
47
|
+
return 500;
|
|
48
|
+
return passing.reduce((a, b) => (0, color_1.contrastRatio)(scale[a], white) <= (0, color_1.contrastRatio)(scale[b], white) ? a : b);
|
|
49
|
+
};
|
|
50
|
+
const steppedRung = (theme, base, step) => {
|
|
51
|
+
const dir = (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main) ? -100 : 100;
|
|
52
|
+
return Math.min(900, Math.max(50, base + dir * step));
|
|
53
|
+
};
|
|
32
54
|
const darkerFill = (theme, colorScheme, step) => {
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
var _a;
|
|
56
|
+
const scale = theme.colors[colorScheme];
|
|
57
|
+
const base = solidRung(theme, colorScheme);
|
|
58
|
+
if (base === 500) {
|
|
59
|
+
const mode = (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main) ? "dark" : "light";
|
|
60
|
+
return scale[FILL_STEP_RUNGS[mode][step]];
|
|
61
|
+
}
|
|
62
|
+
return (_a = scale[steppedRung(theme, base, step === 0 ? 1 : 2)]) !== null && _a !== void 0 ? _a : scale[base];
|
|
35
63
|
};
|
|
36
64
|
/** Label for the solid variant's filled bg — derived from THAT fill, since hover/active swap it. */
|
|
37
65
|
const labelFor = (theme, fill) => (0, accentText_1.onFilled)(fill, theme.colors.white, theme.colors.black);
|
|
66
|
+
/**
|
|
67
|
+
* The two-tone `:focus-visible` ring, from the palette's derived `focusRing` pair.
|
|
68
|
+
*
|
|
69
|
+
* Every variant spreads this. Before it, none of them defined `_focusVisible` at all, so every
|
|
70
|
+
* button in every consuming app fell through to Chakra's stock `shadows.outline` — one fixed blue
|
|
71
|
+
* that measured 1.83:1 on the canvas and 1.38:1 on a primary fill, failing WCAG 1.4.11 (3:1) on
|
|
72
|
+
* all nine brands. `focusRing.test.ts` is the gate that keeps this true.
|
|
73
|
+
*/
|
|
74
|
+
const focusRing = (theme) => (0, focusRing_styles_1.focusVisibleStyles)(theme.colors);
|
|
38
75
|
exports.Button = {
|
|
39
|
-
|
|
76
|
+
// The ring is repeated on every variant below AND here, so a variant name this file does not
|
|
77
|
+
// define (a consumer's own, or an `IconButton` falling through) still gets an indicator.
|
|
78
|
+
baseStyle: ({ theme }) => ({
|
|
40
79
|
borderRadius: "lg",
|
|
41
80
|
fontWeight: 500,
|
|
42
81
|
fontSize: "1rem",
|
|
@@ -45,10 +84,11 @@ exports.Button = {
|
|
|
45
84
|
opacity: 0.6,
|
|
46
85
|
cursor: "not-allowed",
|
|
47
86
|
},
|
|
87
|
+
...focusRing(theme),
|
|
48
88
|
}),
|
|
49
89
|
variants: {
|
|
50
90
|
solid: ({ theme, colorScheme = "primary" }) => {
|
|
51
|
-
const fill = theme.colors[colorScheme][
|
|
91
|
+
const fill = theme.colors[colorScheme][solidRung(theme, colorScheme)];
|
|
52
92
|
const hoverFill = darkerFill(theme, colorScheme, 0);
|
|
53
93
|
const activeFill = darkerFill(theme, colorScheme, 1);
|
|
54
94
|
const hoverLabel = labelFor(theme, hoverFill);
|
|
@@ -77,25 +117,26 @@ exports.Button = {
|
|
|
77
117
|
color: hoverLabel,
|
|
78
118
|
},
|
|
79
119
|
},
|
|
120
|
+
...focusRing(theme),
|
|
80
121
|
};
|
|
81
122
|
},
|
|
82
123
|
outline: ({ theme, colorScheme = "primary" }) => {
|
|
83
|
-
|
|
124
|
+
// Same rung as `solid`'s fill, not raw [500] — keeps hover bg AA-safe for white text.
|
|
125
|
+
const hoverFill = theme.colors[colorScheme][solidRung(theme, colorScheme)];
|
|
84
126
|
const activeFill = darkerFill(theme, colorScheme, 0);
|
|
127
|
+
const ink = onCanvasText(theme, colorScheme);
|
|
85
128
|
return {
|
|
86
129
|
border: "0.1rem solid",
|
|
87
|
-
borderColor:
|
|
88
|
-
color:
|
|
130
|
+
borderColor: ink,
|
|
131
|
+
color: ink,
|
|
89
132
|
bg: "transparent",
|
|
90
133
|
_hover: {
|
|
91
134
|
bg: hoverFill,
|
|
92
135
|
borderColor: activeFill,
|
|
93
|
-
// Was a hardcoded `theme.colors.white` — fails AA for any colorScheme whose [500]
|
|
94
|
-
// doesn't clear white contrast (e.g. emerald/rosewood primary in dark, 3.38/3.46).
|
|
95
136
|
color: labelFor(theme, hoverFill),
|
|
96
137
|
_disabled: {
|
|
97
138
|
// bg: theme.colors[colorScheme][500],
|
|
98
|
-
color:
|
|
139
|
+
color: ink,
|
|
99
140
|
},
|
|
100
141
|
},
|
|
101
142
|
_active: {
|
|
@@ -104,8 +145,9 @@ exports.Button = {
|
|
|
104
145
|
},
|
|
105
146
|
_loading: {
|
|
106
147
|
// bg: theme.colors[colorScheme][500],
|
|
107
|
-
color:
|
|
148
|
+
color: ink,
|
|
108
149
|
},
|
|
150
|
+
...focusRing(theme),
|
|
109
151
|
};
|
|
110
152
|
},
|
|
111
153
|
ghost: ({ theme, colorScheme = "primary" }) => ({
|
|
@@ -118,6 +160,7 @@ exports.Button = {
|
|
|
118
160
|
_active: {
|
|
119
161
|
bg: onCanvasHoverBg(theme, colorScheme, 24),
|
|
120
162
|
},
|
|
163
|
+
...focusRing(theme),
|
|
121
164
|
}),
|
|
122
165
|
link: ({ theme, colorScheme = "primary" }) => ({
|
|
123
166
|
color: onCanvasText(theme, colorScheme),
|
|
@@ -130,22 +173,25 @@ exports.Button = {
|
|
|
130
173
|
_active: {
|
|
131
174
|
color: onCanvasText(theme, colorScheme),
|
|
132
175
|
},
|
|
176
|
+
...focusRing(theme),
|
|
133
177
|
}),
|
|
134
|
-
unstyled:
|
|
178
|
+
// `unstyled` drops the fill, not the affordance: a focus indicator is not styling.
|
|
179
|
+
unstyled: ({ theme }) => ({
|
|
135
180
|
bg: "transparent",
|
|
136
181
|
color: "inherit",
|
|
137
182
|
_hover: {
|
|
138
183
|
bg: "transparent",
|
|
139
184
|
},
|
|
185
|
+
...focusRing(theme),
|
|
140
186
|
}),
|
|
141
187
|
// Theme-based two-tone gradient: each theme defines its own `gradient` {from,to} pair.
|
|
142
188
|
// Ignores colorScheme; hover/active shift brightness so it works for any pair.
|
|
143
189
|
gradient: ({ theme }) => {
|
|
144
|
-
const g = theme.colors.gradient;
|
|
145
|
-
const bg =
|
|
190
|
+
const g = (0, gradientInk_1.resolveGradient)(theme.colors.gradient, theme.colors.white, theme.colors.black);
|
|
191
|
+
const bg = (0, gradientInk_1.gradientCss)(g);
|
|
146
192
|
return {
|
|
147
193
|
bgImage: bg,
|
|
148
|
-
color:
|
|
194
|
+
color: g.ink,
|
|
149
195
|
border: "none",
|
|
150
196
|
_hover: {
|
|
151
197
|
bgImage: bg,
|
|
@@ -163,6 +209,7 @@ exports.Button = {
|
|
|
163
209
|
filter: "brightness(0.92)",
|
|
164
210
|
_hover: { bgImage: bg, filter: "brightness(0.92)" },
|
|
165
211
|
},
|
|
212
|
+
...focusRing(theme),
|
|
166
213
|
};
|
|
167
214
|
},
|
|
168
215
|
},
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ButtonProps as ChakraButtonProps } from "@chakra-ui/react";
|
|
2
|
-
|
|
2
|
+
type LayoutProps = Pick<ChakraButtonProps, "as" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "p" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "w" | "minW" | "maxW" | "h" | "minH" | "maxH" | "boxSize" | "flex" | "flexShrink" | "flexGrow" | "alignSelf" | "justifyContent" | "cursor" | "fontWeight" | "fontSize" | "textAlign" | "whiteSpace" | "_hover" | "_active" | "_focus" | "_focusVisible" | "_disabled" | "isActive" | "onKeyDown" | "onFocus" | "onBlur" | "onPointerDown" | "tabIndex" | "form" | "name" | "value" | "autoFocus" | "role">;
|
|
3
|
+
type DataAttributes = {
|
|
4
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type ButtonProps = LayoutProps & DataAttributes & Pick<ChakraButtonProps, "onClick" | "leftIcon" | "rightIcon" | "isDisabled" | "isLoading" | "loadingText" | "spinner" | "sx" | "border" | "borderRadius" | "onMouseEnter" | "onMouseLeave" | "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-expanded" | "aria-haspopup" | "aria-controls" | "aria-pressed" | "aria-current" | "id" | "title"> & {
|
|
3
7
|
label?: string;
|
|
4
8
|
width?: string | number;
|
|
5
9
|
size?: "lg" | "md" | "sm" | "xs" | "xl";
|
|
@@ -10,3 +14,4 @@ export type ButtonProps = Pick<ChakraButtonProps, "onClick" | "leftIcon" | "righ
|
|
|
10
14
|
children?: React.ReactNode;
|
|
11
15
|
opacity?: number;
|
|
12
16
|
};
|
|
17
|
+
export {};
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_2 = require("@chakra-ui/react");
|
|
7
7
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
|
-
const
|
|
8
|
+
const gradientInk_1 = require("../../Theme/tokens/builders/gradientInk");
|
|
9
9
|
const color_1 = require("../../Theme/tokens/builders/color");
|
|
10
10
|
const rafThrottle_1 = require("../../Utils/rafThrottle");
|
|
11
11
|
function ButtonGroupIcon({ leftIcon, rightIcon, onLeftIconClick, onRightIconClick, buttonText, onButtonClick, onButtongroupClick, size, variant, color, buttonGroupStyle, buttonGroupLeftIconStyle, buttonGroupRightIconStyle, buttonStyle, onBlurLeftIcon, onBlurRightIcon, dropdownOptions, // New prop for dropdown options
|
|
@@ -49,9 +49,9 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
49
49
|
// keep the segments transparent (so it doesn't restart per button/icon), with a
|
|
50
50
|
// translucent-white hover overlay for per-segment feedback.
|
|
51
51
|
const isGradient = variant === "gradient";
|
|
52
|
-
const gradientStops = theme.colors.gradient;
|
|
53
|
-
const gradientBg =
|
|
54
|
-
const gradientInk =
|
|
52
|
+
const gradientStops = (0, gradientInk_1.resolveGradient)(theme.colors.gradient, theme.colors.white, theme.colors.black);
|
|
53
|
+
const gradientBg = (0, gradientInk_1.gradientCss)(gradientStops);
|
|
54
|
+
const gradientInk = gradientStops.ink;
|
|
55
55
|
const whiteRgb = (0, color_1.hexToRgb)(theme.colors.white);
|
|
56
56
|
const whiteOverlay = (alpha) => `rgba(${whiteRgb.r}, ${whiteRgb.g}, ${whiteRgb.b}, ${alpha})`;
|
|
57
57
|
const gradientItemSx = isGradient
|
|
@@ -72,7 +72,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
72
72
|
// this theme-swap app never triggers) — our `bg` prop above only recolors the list
|
|
73
73
|
// itself, not the inherited var, so items fell back to white until hover/focus (which
|
|
74
74
|
// our own sx already overrides). Setting the var here fixes the rest state too.
|
|
75
|
-
sx: { "--menu-bg": theme.colors.backgroundColor.light },
|
|
75
|
+
sx: { "--menu-bg": theme.colors.backgroundColor.light }, borderRadius: "xl", boxShadow: "lg", py: "0.375rem", minW: "12rem", overflow: "hidden", children: dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => ((0, jsx_runtime_1.jsxs)(react_2.MenuItem, { onClick: (event) => handleMenuClick(event, option), style: menuItemStyle, sx: {
|
|
76
76
|
display: "flex",
|
|
77
77
|
alignItems: "center",
|
|
78
78
|
gap: "0.5rem",
|
|
@@ -90,7 +90,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
90
90
|
mx: 0,
|
|
91
91
|
borderRadius: "none",
|
|
92
92
|
borderBottom: "1px solid",
|
|
93
|
-
borderColor: theme.colors.boxborder[
|
|
93
|
+
borderColor: theme.colors.boxborder[200],
|
|
94
94
|
}
|
|
95
95
|
: {}),
|
|
96
96
|
_hover: { bg: theme.colors.primary[50], color: theme.colors.primary[700] },
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CardProps } from "./CardProps";
|
|
2
|
-
export default function Card({
|
|
2
|
+
export default function Card({ maxW, align, variant, direction, justify, children, size, color, overflow, sx, }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = Card;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@chakra-ui/react");
|
|
6
|
-
function Card({
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Card, { maxW: maxW, align: align, variant: variant, direction: direction, justify: justify, size: size, overflow: overflow, colorScheme: color, p: 4, sx: sx, children: children }
|
|
6
|
+
function Card({ maxW, align, variant, direction, justify, children, size, color, overflow, sx, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Card, { maxW: maxW, align: align, variant: variant, direction: direction, justify: justify, size: size, overflow: overflow, colorScheme: color, p: 4, sx: sx, children: children }));
|
|
8
8
|
}
|
|
@@ -6,7 +6,6 @@ export type CardProps = Pick<ChakraCardProps, "direction" | "maxW" | "align" | "
|
|
|
6
6
|
variant?: "elevated" | "outline" | "filled" | "unstyled";
|
|
7
7
|
size?: "sm" | "md" | "lg";
|
|
8
8
|
color?: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
|
|
9
|
-
key?: string;
|
|
10
9
|
dividercolor?: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
|
|
11
10
|
dividersize?: string;
|
|
12
11
|
dividervariant?: "solid" | "dashed";
|
|
@@ -20,6 +20,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
20
20
|
badgeColor: `0.125rem solid ${theme.colors.green[500]}`,
|
|
21
21
|
buttonColor: theme.colors.green[500],
|
|
22
22
|
buttonColor50: theme.colors.green[50],
|
|
23
|
+
colorScheme: "green",
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
if (isNextUpgrade) {
|
|
@@ -28,6 +29,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
28
29
|
badgeColor: `0.125rem solid ${theme.colors.primary[500]}`,
|
|
29
30
|
buttonColor: theme.colors.primary[500],
|
|
30
31
|
buttonColor50: theme.colors.primary[50],
|
|
32
|
+
colorScheme: "primary",
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
if (popular) {
|
|
@@ -36,6 +38,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
36
38
|
badgeColor: `0.125rem solid ${theme.colors.primary[500]}`,
|
|
37
39
|
buttonColor: theme.colors.primary[500],
|
|
38
40
|
buttonColor50: theme.colors.primary[50],
|
|
41
|
+
colorScheme: "primary",
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
return withOnButtonColor({
|
|
@@ -43,17 +46,14 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
43
46
|
badgeColor: "",
|
|
44
47
|
buttonColor: theme.colors.primary[500],
|
|
45
48
|
buttonColor50: theme.colors.primary[50],
|
|
49
|
+
colorScheme: "primary",
|
|
46
50
|
});
|
|
47
51
|
};
|
|
48
52
|
const PaymentCard = ({ plan, isActive = false, isNextUpgrade = false, billingCycle, onSelect, onHover, buttonLoading, isLoading = false, isRenewal = false, }) => {
|
|
49
53
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
50
|
-
const { badgeText, badgeColor, buttonColor, buttonColor50, onButtonColor } = getCardStyles(isActive, isNextUpgrade, !!plan.popular, theme);
|
|
54
|
+
const { badgeText, badgeColor, buttonColor, buttonColor50, onButtonColor, colorScheme } = getCardStyles(isActive, isNextUpgrade, !!plan.popular, theme);
|
|
51
55
|
const variantStyles = plan.buttonVariant === "outline"
|
|
52
|
-
? {
|
|
53
|
-
borderColor: buttonColor,
|
|
54
|
-
color: buttonColor,
|
|
55
|
-
_hover: { bg: buttonColor50 },
|
|
56
|
-
}
|
|
56
|
+
? {}
|
|
57
57
|
: {
|
|
58
58
|
bg: buttonColor,
|
|
59
59
|
color: onButtonColor,
|
|
@@ -65,6 +65,6 @@ const PaymentCard = ({ plan, isActive = false, isNextUpgrade = false, billingCyc
|
|
|
65
65
|
// 🔹 Actual Card Content
|
|
66
66
|
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [badgeText && ((0, jsx_runtime_1.jsx)(react_1.Badge, { position: "absolute", top: "-0.75rem", left: "50%", transform: "translateX(-50%)", bg: buttonColor, color: onButtonColor, fontSize: "sm", px: 4, py: 1, borderRadius: "full", children: badgeText })), (0, jsx_runtime_1.jsxs)(react_1.Box, { textAlign: "center", mb: 6, children: [(0, jsx_runtime_1.jsx)(react_1.Flex, { justify: "center", align: "center", w: "3.125rem", h: "3.125rem", borderRadius: "lg", bg: buttonColor50, color: buttonColor, mx: "auto", mb: 4, children: plan.icon }), (0, jsx_runtime_1.jsx)(react_1.Heading, { as: "h3", size: "lg", mb: 4, color: theme.colors.gray[800], children: plan.name }), (plan.yearlyPrice !== 0 || plan.monthlyPrice !== 0) && ((0, jsx_runtime_1.jsxs)(react_1.Heading, { as: "h4", size: "2xl", mb: 1, color: theme.colors.gray[800], display: "flex", justifyContent: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { fontSize: "1.5rem", children: "\u20B9" }), billingCycle === "yearly"
|
|
67
67
|
? plan.yearlyPrice
|
|
68
|
-
: plan.monthlyPrice, (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", justifyContent: "end", ml: 1, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.9rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.billing }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.7rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.tax })] })] })), plan.priceDescription && ((0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.green[800], mt: 2, children: plan === null || plan === void 0 ? void 0 : plan.priceDescription })), (0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.gray[600], mt: 2, children: plan.description })] }), ((!isActive && plan.buttonText) || isRenewal) && ((0, jsx_runtime_1.jsx)(Button_1.default, { isLoading: plan.plan_id === buttonLoading, loadingText: plan.buttonLoadingText, width: "full", variant: plan.buttonVariant, size: "lg", onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id), onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false), ...variantStyles, children: plan.buttonText })), (0, jsx_runtime_1.jsx)(react_1.VStack, { align: "start", spacing: 3, mt: 6, children: plan.features.map((feature, i) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.Check, color: theme.colors.green[500], mr: 2 }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", children: feature })] }, i))) })] })) }) }));
|
|
68
|
+
: plan.monthlyPrice, (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", justifyContent: "end", ml: 1, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.9rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.billing }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.7rem", fontWeight: "normal", color: theme.colors.gray[600], children: plan.tax })] })] })), plan.priceDescription && ((0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.green[800], mt: 2, children: plan === null || plan === void 0 ? void 0 : plan.priceDescription })), (0, jsx_runtime_1.jsx)(react_1.Text, { color: theme.colors.gray[600], mt: 2, children: plan.description })] }), ((!isActive && plan.buttonText) || isRenewal) && ((0, jsx_runtime_1.jsx)(Button_1.default, { isLoading: plan.plan_id === buttonLoading, loadingText: plan.buttonLoadingText, width: "full", variant: plan.buttonVariant, colorScheme: colorScheme, size: "lg", onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id), onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false), ...variantStyles, children: plan.buttonText })), (0, jsx_runtime_1.jsx)(react_1.VStack, { align: "start", spacing: 3, mt: 6, children: plan.features.map((feature, i) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.Check, color: theme.colors.green[500], mr: 2 }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", children: feature })] }, i))) })] })) }) }));
|
|
69
69
|
};
|
|
70
70
|
exports.default = PaymentCard;
|
|
@@ -27,7 +27,7 @@ function CheckBox({ label, labelFontSize, showLabelTooltip, labelTooltip, labelC
|
|
|
27
27
|
...labelSx,
|
|
28
28
|
}
|
|
29
29
|
: { ...labelSx };
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Checkbox, { ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Checkbox, { ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], display: "flex", alignItems: "center", sx: {
|
|
31
31
|
...sx,
|
|
32
32
|
".chakra-checkbox__control": { w: controlSize, h: controlSize },
|
|
33
33
|
}, children: label && (showLabelTooltip ? ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: labelTooltip !== null && labelTooltip !== void 0 ? labelTooltip : label, hasArrow: true, placement: "top", fontSize: "0.75rem", children: (0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.8125rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }) })) : ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.8125rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }))) }), error && (0, jsx_runtime_1.jsx)(ErrorMessage_1.default, { errorMessage: errorMessage }), helperText && !error && (0, jsx_runtime_1.jsx)(HelperText_1.default, { helperText: helperText })] }));
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Checkbox = void 0;
|
|
4
4
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
5
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
5
6
|
exports.Checkbox = {
|
|
6
7
|
baseStyle: ({ theme, colorScheme = "primary" }) => {
|
|
7
8
|
var _a;
|
|
8
9
|
const palette = (_a = theme.colors[colorScheme]) !== null && _a !== void 0 ? _a : theme.colors.primary;
|
|
9
|
-
//
|
|
10
|
-
// Chakra's stock control also carries a checked-hover at `_checked._hover` (this override
|
|
11
|
-
// nests the other way, `_hover._checked`) — two different key paths landing on the same
|
|
12
|
-
// selector, so whichever one the cascade picks must still differ from resting. Setting both
|
|
13
|
-
// paths to the same lifted value removes that ambiguity outright.
|
|
10
|
+
// Both `_checked._hover` and `_hover._checked` paths get the same lifted value.
|
|
14
11
|
const hoverChecked = (0, outlineRung_1.resolveHoverTint)(palette[600], palette[600]);
|
|
12
|
+
const checkedIcon = (0, accentText_1.onFilled)(palette[600], theme.colors.white, theme.colors.black);
|
|
13
|
+
const hoverCheckedIcon = (0, accentText_1.onFilled)(hoverChecked, theme.colors.white, theme.colors.black);
|
|
14
|
+
const focusRing = (0, outlineRung_1.liftToContrast)(palette[300], theme.colors.backgroundColor.main, outlineRung_1.AA_NON_TEXT);
|
|
15
15
|
return {
|
|
16
16
|
control: {
|
|
17
17
|
width: "1.25rem",
|
|
18
18
|
height: "1.25rem",
|
|
19
19
|
borderWidth: "1.6px",
|
|
20
20
|
borderRadius: "base",
|
|
21
|
+
// Without a resting colour Chakra falls back to its own gray.500.
|
|
22
|
+
borderColor: theme.colors.boxborder[500],
|
|
21
23
|
transition: "background 0.15s, border-color 0.15s, box-shadow 0.15s",
|
|
22
24
|
_disabled: {
|
|
23
25
|
bg: theme.colors.background[50],
|
|
@@ -52,7 +54,7 @@ exports.Checkbox = {
|
|
|
52
54
|
},
|
|
53
55
|
},
|
|
54
56
|
_focus: {
|
|
55
|
-
boxShadow: `0 0 0 2px ${
|
|
57
|
+
boxShadow: `0 0 0 2px ${focusRing}`,
|
|
56
58
|
borderColor: palette[500],
|
|
57
59
|
},
|
|
58
60
|
_active: {
|
|
@@ -61,7 +63,10 @@ exports.Checkbox = {
|
|
|
61
63
|
},
|
|
62
64
|
},
|
|
63
65
|
icon: {
|
|
64
|
-
color:
|
|
66
|
+
color: checkedIcon,
|
|
67
|
+
_hover: {
|
|
68
|
+
color: hoverCheckedIcon,
|
|
69
|
+
},
|
|
65
70
|
},
|
|
66
71
|
};
|
|
67
72
|
},
|
|
@@ -14,7 +14,7 @@ exports.FIELD_TRANSITION = "border-color 0.2s, box-shadow 0.2s";
|
|
|
14
14
|
const getFieldStateStyles = (theme, { error = false, focused = false } = {}) => {
|
|
15
15
|
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
|
|
16
16
|
// up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
17
|
-
const idleBorder = theme.colors.boxborder[
|
|
17
|
+
const idleBorder = theme.colors.boxborder[500];
|
|
18
18
|
const primary = theme.colors.primary[500];
|
|
19
19
|
const errorColor = theme.colors.semanticText.error;
|
|
20
20
|
const ringPrimary = theme.colors.boxShadow.primary;
|
|
@@ -9,6 +9,7 @@ const react_2 = require("@chakra-ui/react");
|
|
|
9
9
|
const lucide_react_1 = require("lucide-react");
|
|
10
10
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
11
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
12
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
12
13
|
const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
13
14
|
const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Copied!", tooltip = "Copy", feedbackDuration = 1500, iconSize = 16, size = "sm", onCopy, }) => {
|
|
14
15
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -34,12 +35,15 @@ const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Co
|
|
|
34
35
|
const accent = (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, theme.colors.backgroundColor.main);
|
|
35
36
|
const success = theme.colors.semanticText.success;
|
|
36
37
|
if (variant === "menu-item") {
|
|
37
|
-
|
|
38
|
+
// Ink also sits on the row's own hover fill (gray[100]), not just the canvas — resolve against it.
|
|
39
|
+
const hoverAccent = (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, theme.colors.gray[100]);
|
|
40
|
+
const hoverSuccess = (0, outlineRung_1.liftToContrast)(theme.colors.semantic.success[500], theme.colors.gray[100], accentText_1.AA_NORMAL_TEXT);
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "0.5rem", px: "12px", py: "8px", width: "100%", cursor: "pointer", borderRadius: "md", transition: "background 0.15s ease", _hover: { bg: theme.colors.gray[100] }, onClick: handleCopy, children: [copied ? ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: iconSize, color: hoverSuccess })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { size: iconSize, color: hoverAccent })), (0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: "14px", fontWeight: 500, color: copied ? hoverSuccess : hoverAccent, children: copied ? copiedLabel : label })] }));
|
|
38
42
|
}
|
|
39
43
|
if (variant === "button") {
|
|
40
44
|
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
|
|
41
45
|
// [800], not [500]: a real control boundary needs >=3:1 on every surface up to `muted`.
|
|
42
|
-
borderColor: copied ? success : theme.colors.boxborder[
|
|
46
|
+
borderColor: copied ? success : theme.colors.boxborder[500], bg: "transparent", color: copied ? success : theme.colors.gray[700], fontSize: "14px", fontWeight: 500, transition: "all 0.15s ease", _hover: { borderColor: accent, color: accent }, onClick: handleCopy, children: [copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: iconSize }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { size: iconSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { children: copied ? copiedLabel : label })] }));
|
|
43
47
|
}
|
|
44
48
|
return ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: copied ? copiedLabel : tooltip, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": tooltip, size: size, variant: "ghost", onClick: handleCopy, color: copied ? success : theme.colors.gray[500], _hover: { color: accent, bg: theme.colors.primary[50] }, icon: copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: iconSize }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { size: iconSize }) }) }));
|
|
45
49
|
};
|
|
@@ -19,6 +19,6 @@ const EditModuleModal = ({ isOpen, onClose, initialName, isLoading, onSubmit, la
|
|
|
19
19
|
// [200] is the decorative divider rung (~1.2:1, correct for the ModalHeader border
|
|
20
20
|
// above) — a real control's resting outline needs 1.4.11's 3:1, which is what every
|
|
21
21
|
// other input in this library (TextInput, NumberInput, DatePicker) reads from [800].
|
|
22
|
-
borderColor: colors.boxborder[
|
|
22
|
+
borderColor: colors.boxborder[500], mb: 5 }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { justifyContent: "flex-end", spacing: 3, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "gray", size: "sm" }), (0, jsx_runtime_1.jsx)(Button_1.default, { label: labels.update, onClick: () => onSubmit(name.trim()), colorScheme: "primary", size: "sm", isLoading: isLoading, isDisabled: !name.trim() })] })] })] })] }));
|
|
23
23
|
};
|
|
24
24
|
exports.default = EditModuleModal;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type DayStates, type RenderDayContent } from "./dayStates";
|
|
2
3
|
export type CalendarPanelProps = {
|
|
3
4
|
currentMonth: Date;
|
|
4
5
|
setCurrentMonth: (updater: (prev: Date) => Date) => void;
|
|
@@ -19,6 +20,10 @@ export type CalendarPanelProps = {
|
|
|
19
20
|
hoveredDate?: Date | null;
|
|
20
21
|
onDayHover?: (d: Date | null) => void;
|
|
21
22
|
renderWeekdays?: React.ReactNode;
|
|
23
|
+
/** Marks individual days (weekly off, holiday, …). See `dayStates.ts`. Omit for the plain grid. */
|
|
24
|
+
dayStates?: DayStates;
|
|
25
|
+
/** Custom content inside a day cell, replacing that day's built-in marker dot. */
|
|
26
|
+
renderDayContent?: RenderDayContent;
|
|
22
27
|
};
|
|
23
28
|
export declare const CalendarPanel: React.FC<CalendarPanelProps>;
|
|
24
29
|
export default CalendarPanel;
|
|
@@ -11,7 +11,8 @@ const lucide_react_1 = require("lucide-react");
|
|
|
11
11
|
const Button_1 = __importDefault(require("../Button/Button"));
|
|
12
12
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
13
13
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
14
|
-
const
|
|
14
|
+
const dayStates_1 = require("./dayStates");
|
|
15
|
+
const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, tempDate, tempRangeStart, tempRangeEnd, isSameDay, isBefore, isAfter, minDate, maxDate, disablePastDates, disableFutureDates, disableToday, onDaySelect, hoveredDate, onDayHover, renderWeekdays, dayStates, renderDayContent, }) => {
|
|
15
16
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
16
17
|
const rangeBg = theme.colors.primary.opacity[16];
|
|
17
18
|
const isViewingCurrentMonth = currentMonth.getFullYear() === today.getFullYear() &&
|
|
@@ -26,7 +27,7 @@ const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, tempDate
|
|
|
26
27
|
const hasRange = !!(rangeStart && rangeEnd && !isSameDay(rangeStart, rangeEnd));
|
|
27
28
|
const selectStyles = {
|
|
28
29
|
border: "1px solid",
|
|
29
|
-
// boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[
|
|
30
|
+
// boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[200]
|
|
30
31
|
// is decorative and measured 1.85:1 on the dark canvas — the select read as borderless.
|
|
31
32
|
borderColor: theme.colors.boxborder[500],
|
|
32
33
|
borderRadius: "md",
|
|
@@ -51,6 +52,7 @@ const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, tempDate
|
|
|
51
52
|
},
|
|
52
53
|
};
|
|
53
54
|
const renderDays = () => {
|
|
55
|
+
var _a;
|
|
54
56
|
const monthStart = (0, date_fns_1.startOfMonth)(currentMonth);
|
|
55
57
|
const monthEnd = (0, date_fns_1.endOfMonth)(currentMonth);
|
|
56
58
|
const startDate = (0, date_fns_1.startOfWeek)(monthStart);
|
|
@@ -69,12 +71,17 @@ const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, tempDate
|
|
|
69
71
|
const isSelected = !!(!isRange && tempDate && isSameDay(thisDay, tempDate));
|
|
70
72
|
const isTentativeEnd = isEnd && isTentative;
|
|
71
73
|
const circleSolid = !!(isSelected || (isRange && isStart) || (isEnd && !isTentative));
|
|
74
|
+
// Marking is not disabling: only the `disabled` state key blocks selection, and only
|
|
75
|
+
// because the caller asked for it by name.
|
|
76
|
+
const states = (_a = dayStates === null || dayStates === void 0 ? void 0 : dayStates(thisDay)) !== null && _a !== void 0 ? _a : [];
|
|
77
|
+
const stateVisual = states.length ? (0, dayStates_1.resolveDayStateVisual)(states, theme.colors) : null;
|
|
72
78
|
const disabled = !isInCurrentMonth ||
|
|
73
79
|
!!(minDate && isBefore(thisDay, minDate)) ||
|
|
74
80
|
!!(maxDate && isAfter(thisDay, maxDate)) ||
|
|
75
81
|
!!(disablePastDates && isBefore(thisDay, today) && !isSameDay(thisDay, today)) ||
|
|
76
82
|
!!(disableFutureDates && isAfter(thisDay, today) && !isSameDay(thisDay, today)) ||
|
|
77
|
-
!!(disableToday && isToday)
|
|
83
|
+
!!(disableToday && isToday) ||
|
|
84
|
+
!!(stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.blocksSelection);
|
|
78
85
|
// Connected range band painted on the cell background; start/end use a
|
|
79
86
|
// half gradient so the band meets the solid day circle cleanly.
|
|
80
87
|
let cellBg;
|
|
@@ -88,6 +95,9 @@ const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, tempDate
|
|
|
88
95
|
else if (isEnd)
|
|
89
96
|
cellBg = `linear-gradient(to right, ${rangeBg} 50%, transparent 50%)`;
|
|
90
97
|
}
|
|
98
|
+
// Selection feedback outranks a state tint — the band is what tells the user what they picked.
|
|
99
|
+
if (!cellBg && (stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.cellBg))
|
|
100
|
+
cellBg = stateVisual.cellBg;
|
|
91
101
|
// Solid fill (selected/range-endpoint) needs the ink checked against that
|
|
92
102
|
// specific fill — `primary[500]` doesn't reliably clear AA for white text on
|
|
93
103
|
// every brand/mode (same gap the solid Button variant already accounts for).
|
|
@@ -108,11 +118,20 @@ const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, tempDate
|
|
|
108
118
|
: isToday
|
|
109
119
|
? `1px solid ${theme.colors.primary[300]}`
|
|
110
120
|
: "1px solid transparent";
|
|
111
|
-
|
|
121
|
+
// A filled circle owns its own ink (checked against that fill by `onFilled`), so a state
|
|
122
|
+
// never repaints a selected day — it would undo that contrast guarantee.
|
|
123
|
+
const dayColor = !circleSolid && (stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.color) ? stateVisual.color : circleColor;
|
|
124
|
+
const dayBorder = !circleSolid && (stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.border) ? stateVisual.border : circleBorder;
|
|
125
|
+
const customContent = renderDayContent ? renderDayContent(thisDay, states) : null;
|
|
126
|
+
const markerColor = customContent == null && (stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.markerColor) ? stateVisual.markerColor : null;
|
|
127
|
+
const hasDayOverlay = customContent != null || markerColor != null;
|
|
128
|
+
days.push((0, jsx_runtime_1.jsx)(react_1.Box, { h: "2rem", display: "flex", alignItems: "center", justifyContent: "center", style: cellBg ? { background: cellBg } : undefined, children: (0, jsx_runtime_1.jsxs)(react_1.Box, { as: "button", type: "button", disabled: disabled, className: dayStates ? (0, dayStates_1.dayStateClassName)(states) : undefined, "aria-label": dayStates ? (0, dayStates_1.dayAccessibleName)((0, date_fns_1.format)(thisDay, "d MMMM yyyy"), states) : undefined, onClick: () => !disabled && onDaySelect(new Date(thisDay)), onMouseEnter: () => !disabled && (onDayHover === null || onDayHover === void 0 ? void 0 : onDayHover(new Date(thisDay))), position: hasDayOverlay ? "relative" : undefined, w: "1.75rem", h: "1.75rem", borderRadius: "full", display: "flex", alignItems: "center", justifyContent: "center", fontSize: "0.8125rem", fontWeight: circleSolid ? 600 : 500, lineHeight: "1", cursor: disabled ? "not-allowed" : "pointer", bg: circleSolid ? solidFill : "transparent", color: dayColor, textDecoration: (stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.strikethrough) ? "line-through" : undefined, border: dayBorder, transition: "background 0.12s, color 0.12s", _hover: disabled
|
|
112
129
|
? {}
|
|
113
130
|
: circleSolid
|
|
114
131
|
? { bg: solidHoverFill, color: circleHoverColor }
|
|
115
|
-
: { bg: rangeBg }, children: (0, date_fns_1.format)(thisDay, "d")
|
|
132
|
+
: { bg: rangeBg }, children: [(0, date_fns_1.format)(thisDay, "d"), hasDayOverlay && ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", className: `${dayStates_1.DAY_CLASS}__content`, position: "absolute", left: 0, right: 0, bottom: "0.0625rem", display: "flex", alignItems: "flex-end", justifyContent: "center", lineHeight: "1", fontSize: "0.5rem",
|
|
133
|
+
// The overlay is decoration: clicks belong to the day button under it.
|
|
134
|
+
pointerEvents: "none", children: customContent !== null && customContent !== void 0 ? customContent : ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", className: `${dayStates_1.DAY_CLASS}__marker`, w: "0.25rem", h: "0.25rem", borderRadius: "full", bg: markerColor })) }))] }) }, thisDay.toString()));
|
|
116
135
|
day = (0, date_fns_1.addDays)(day, 1);
|
|
117
136
|
}
|
|
118
137
|
rows.push((0, jsx_runtime_1.jsx)(react_1.Grid, { templateColumns: "repeat(7, 1fr)", gap: 0, children: days }, day.toString()));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DayStates, RenderDayContent } from "./dayStates";
|
|
1
2
|
export type PickerType = "date" | "time" | "datetime";
|
|
2
3
|
export type BaseDatePickerProps = {
|
|
3
4
|
id?: string;
|
|
@@ -40,6 +41,26 @@ export type RangeDatePickerProps = BaseDatePickerProps & {
|
|
|
40
41
|
/** Alias for `selectedDate` (legacy / form libraries). */
|
|
41
42
|
value?: RangeDate | null;
|
|
42
43
|
onChange: (range: RangeDate | null) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Marks individual days with zero or more state keys — `["weekly-off"]`, `["Onam", "holiday"]`,
|
|
46
|
+
* `["excluded"]`. The keys in `DAY_STATE_KEYS` (`weekly-off`, `holiday`, `optional-holiday`,
|
|
47
|
+
* `excluded`, `disabled`) carry built-in, token-driven styling; any other key is announced to a
|
|
48
|
+
* screen reader but left unstyled, which is how a day gets named without a second prop.
|
|
49
|
+
*
|
|
50
|
+
* Marking is not disabling: a marked day stays selectable unless the caller also returns
|
|
51
|
+
* `"disabled"`, or blocks the day with `minDate`/`maxDate`/`disablePastDates`/`disableFutureDates`.
|
|
52
|
+
*
|
|
53
|
+
* Supplying this also spells each day's accessible name out in full — "16 September 2025, Onam,
|
|
54
|
+
* holiday" instead of "16". Called once per rendered day (42 per month), so keep it cheap and pure.
|
|
55
|
+
*/
|
|
56
|
+
dayStates?: DayStates;
|
|
57
|
+
/**
|
|
58
|
+
* Custom content rendered inside the day cell, centred under the day number — a dot, a short
|
|
59
|
+
* label, a tooltip trigger. Receives that day's resolved state keys. Returning a node replaces
|
|
60
|
+
* the built-in marker dot for that day; the number, the accessible name and hit target are
|
|
61
|
+
* unchanged (the overlay does not take pointer events).
|
|
62
|
+
*/
|
|
63
|
+
renderDayContent?: RenderDayContent;
|
|
43
64
|
};
|
|
44
65
|
export type DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;
|
|
45
66
|
export type TimePickerProps = {
|