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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.studioPreset = void 0;
|
|
4
|
+
const outlineRung_1 = require("../../../Theme/tokens/builders/outlineRung");
|
|
5
|
+
const tableRowHoverStyle_1 = require("../components/tableRowHoverStyle");
|
|
6
|
+
/**
|
|
7
|
+
* Quieter chrome, one rule instead of a grid, and a slot that rests on the row
|
|
8
|
+
* number. Every colour is lifted against the surface it actually sits on.
|
|
9
|
+
*/
|
|
10
|
+
const studioPreset = (colors, isDark) => {
|
|
11
|
+
const surface = colors.background[50];
|
|
12
|
+
// Studio drops the per-column rule, so the one line left has to be visible on
|
|
13
|
+
// every brand — `boxborder[200]` measures as low as 1.09:1 on some of them.
|
|
14
|
+
const rule = (0, outlineRung_1.liftToContrast)(colors.boxborder[200], surface, outlineRung_1.CHROME_RULE);
|
|
15
|
+
return {
|
|
16
|
+
header: {
|
|
17
|
+
bg: surface,
|
|
18
|
+
ink: colors.text[500],
|
|
19
|
+
fontSize: 11,
|
|
20
|
+
fontWeight: 600,
|
|
21
|
+
textTransform: "uppercase",
|
|
22
|
+
letterSpacing: "0.06em",
|
|
23
|
+
height: "40px",
|
|
24
|
+
ruleColor: rule,
|
|
25
|
+
showColumnRule: false,
|
|
26
|
+
actions: "hover",
|
|
27
|
+
},
|
|
28
|
+
row: {
|
|
29
|
+
hoverBg: (0, tableRowHoverStyle_1.getTableRowHoverStyle)(colors, isDark).backgroundColor,
|
|
30
|
+
hoverScope: "row",
|
|
31
|
+
ruleColor: rule,
|
|
32
|
+
frozenRuleColor: rule,
|
|
33
|
+
selectedBg: (0, outlineRung_1.liftToContrast)(colors.primary[50], surface, outlineRung_1.MIN_PERCEPTIBLE_STEP),
|
|
34
|
+
selectedBarColor: colors.primary[500],
|
|
35
|
+
showSelectedBar: true,
|
|
36
|
+
},
|
|
37
|
+
slot: {
|
|
38
|
+
width: "3.5rem",
|
|
39
|
+
rest: "index",
|
|
40
|
+
indexInk: colors.textMuted,
|
|
41
|
+
centered: true,
|
|
42
|
+
},
|
|
43
|
+
cells: {
|
|
44
|
+
ink: colors.text[500],
|
|
45
|
+
statusFill: "pill",
|
|
46
|
+
pillRadius: "0.375rem",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.studioPreset = studioPreset;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A variant is a resolved token set, never a branch. Components read named tokens;
|
|
3
|
+
* only `Table.tsx` knows which variant is active.
|
|
4
|
+
*
|
|
5
|
+
* PURITY: presets take a palette and return values — no Chakra, no React, no CSS.
|
|
6
|
+
*/
|
|
7
|
+
import type { PaletteProps } from "../../../Theme/tokens/types";
|
|
8
|
+
export type TableVariant = "classic" | "studio";
|
|
9
|
+
export type TableSlotRest = "checkbox" | "index";
|
|
10
|
+
export type TableStatusFill = "bleed" | "pill";
|
|
11
|
+
export type TableHoverScope = "cell" | "row";
|
|
12
|
+
export type TableChromeReveal = "always" | "hover";
|
|
13
|
+
/** Every field required: a preset that forgets one is a compile error, not a runtime gap. */
|
|
14
|
+
export type TableVariantTokens = {
|
|
15
|
+
header: {
|
|
16
|
+
bg: string;
|
|
17
|
+
ink: string;
|
|
18
|
+
fontSize: number;
|
|
19
|
+
fontWeight: number;
|
|
20
|
+
textTransform: "capitalize" | "uppercase";
|
|
21
|
+
letterSpacing: string;
|
|
22
|
+
height: string;
|
|
23
|
+
ruleColor: string;
|
|
24
|
+
showColumnRule: boolean;
|
|
25
|
+
/** When the per-column filter kebab appears. Active columns always show it. */
|
|
26
|
+
actions: TableChromeReveal;
|
|
27
|
+
};
|
|
28
|
+
row: {
|
|
29
|
+
hoverBg: string;
|
|
30
|
+
hoverScope: TableHoverScope;
|
|
31
|
+
ruleColor: string;
|
|
32
|
+
frozenRuleColor: string;
|
|
33
|
+
selectedBg: string;
|
|
34
|
+
selectedBarColor: string;
|
|
35
|
+
showSelectedBar: boolean;
|
|
36
|
+
};
|
|
37
|
+
slot: {
|
|
38
|
+
width: string;
|
|
39
|
+
rest: TableSlotRest;
|
|
40
|
+
indexInk: string;
|
|
41
|
+
centered: boolean;
|
|
42
|
+
};
|
|
43
|
+
cells: {
|
|
44
|
+
ink: string;
|
|
45
|
+
statusFill: TableStatusFill;
|
|
46
|
+
pillRadius: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type TableVariantPreset = (colors: PaletteProps, isDark: boolean) => TableVariantTokens;
|
|
@@ -74,13 +74,12 @@ exports.Tag = {
|
|
|
74
74
|
outline: ({ theme, colorScheme = "primary" }) => {
|
|
75
75
|
const c = swatch(theme, colorScheme);
|
|
76
76
|
const canvas = theme.colors.backgroundColor.main;
|
|
77
|
+
const ink = (0, accentText_1.accentTextOnCanvas)(c, canvas);
|
|
77
78
|
return {
|
|
78
79
|
container: {
|
|
79
80
|
border: "0.094rem solid",
|
|
80
|
-
borderColor:
|
|
81
|
-
|
|
82
|
-
// hues (orange 2.51, green 2.94, red 4.09); use the canvas-text helper instead.
|
|
83
|
-
color: (0, accentText_1.accentTextOnCanvas)(c, canvas),
|
|
81
|
+
borderColor: ink,
|
|
82
|
+
color: ink,
|
|
84
83
|
bg: "transparent",
|
|
85
84
|
_hover: { bg: c[50] },
|
|
86
85
|
_active: { bg: c[100] },
|
|
@@ -168,7 +168,7 @@ const EventCard = react_2.default.memo(function EventCard({ event, index, accent
|
|
|
168
168
|
const scale = getEventScale(colors, event.title);
|
|
169
169
|
const changes = (0, react_3.useMemo)(() => parseChanges(event.changes), [event.changes]);
|
|
170
170
|
const clickable = typeof onEventClick === "function";
|
|
171
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { _hover: { ".timeline-add-note": { opacity: 1 } }, _focusWithin: { ".timeline-add-note": { opacity: 1 } }, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { as: clickable ? "button" : undefined, type: clickable ? "button" : undefined, display: clickable ? "block" : undefined, w: clickable ? "100%" : undefined, textAlign: clickable ? "start" : undefined, position: "relative", zIndex: 1, bg: colors.background[50], border: `0.063rem solid ${colors.boxborder[
|
|
171
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { _hover: { ".timeline-add-note": { opacity: 1 } }, _focusWithin: { ".timeline-add-note": { opacity: 1 } }, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { as: clickable ? "button" : undefined, type: clickable ? "button" : undefined, display: clickable ? "block" : undefined, w: clickable ? "100%" : undefined, textAlign: clickable ? "start" : undefined, position: "relative", zIndex: 1, bg: colors.background[50], border: `0.063rem solid ${colors.boxborder[200]}`, borderInlineStartWidth: accent === "left" ? "0.1875rem" : undefined, borderInlineEndWidth: accent === "right" ? "0.1875rem" : undefined, borderInlineStartColor: accent === "left" ? scale[400] : undefined, borderInlineEndColor: accent === "right" ? scale[400] : undefined, borderRadius: "xl", px: 3.5, py: 2.5, transition: "all 0.15s ease", cursor: clickable ? "pointer" : "default", onClick: clickable ? () => onEventClick(event, index) : undefined, _hover: {
|
|
172
172
|
borderColor: scale[300],
|
|
173
173
|
boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.md,
|
|
174
174
|
transform: clickable ? "translateY(-1px)" : undefined,
|
|
@@ -229,7 +229,7 @@ const Timeline = ({ timelineEvents, onEventClick, onAddNote, onEditNote, onDelet
|
|
|
229
229
|
// -------------------------------------------------------------------------
|
|
230
230
|
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { position: "relative", maxW: "60rem", mx: "auto", px: 4, py: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Box, { position: "absolute", left: "50%", top: "0.5rem", bottom: "0.5rem", w: "0.015rem", borderRadius: "full", bg: colors.gray[300], transform: "translateX(-50%)" }), Object.keys(groupedEvents).map((date) => {
|
|
231
231
|
var _a;
|
|
232
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { mb: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Flex, { justify: "center", mb: 5, mt: 3, position: "relative", zIndex: 2, children: (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.75rem", fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.02em", color: colors.textMuted, bg: colors.background[50], border: `0.063rem solid ${colors.boxborder[
|
|
232
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { mb: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Flex, { justify: "center", mb: 5, mt: 3, position: "relative", zIndex: 2, children: (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "0.75rem", fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.02em", color: colors.textMuted, bg: colors.background[50], border: `0.063rem solid ${colors.boxborder[200]}`, boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.xs, borderRadius: "full", px: 4, py: 1.5, whiteSpace: "nowrap", children: date }) }), groupedEvents[date].map(({ event, globalIndex }, index) => {
|
|
233
233
|
var _a;
|
|
234
234
|
const isLeft = index % 2 === 0;
|
|
235
235
|
const scale = getEventScale(colors, event.title);
|
|
@@ -50,7 +50,7 @@ function ToastCard({ onClose, title, description, actions, isClosable, duration,
|
|
|
50
50
|
initial: { opacity: 0, x: 24 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 24 }, transition: { duration: 0.24, ease: [0.22, 1, 0.36, 1] }, onHoverStart: () => setPaused(true), onHoverEnd: () => setPaused(false), position: "relative",
|
|
51
51
|
// Surface token, not `colors.white`: `white` is a foreground token and stays
|
|
52
52
|
// white in dark mode. `background[50]` is #ffffff in light, near-black in dark.
|
|
53
|
-
bg: c.background[50], border: `0.063rem solid ${c.boxborder[
|
|
53
|
+
bg: c.background[50], border: `0.063rem solid ${c.boxborder[200]}`, boxShadow: shadowLg !== null && shadowLg !== void 0 ? shadowLg : "lg", borderRadius: "2xl", overflow: "hidden", minW: "22.5rem", maxW: "26rem", willChange: "transform, opacity", sx: {
|
|
54
54
|
transition: "box-shadow 0.18s ease",
|
|
55
55
|
_hover: { boxShadow: "xl" },
|
|
56
56
|
}, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { p: 3.5, gap: 3, align: actions ? "flex-start" : "center", children: [(0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: "2rem", minW: "2rem", borderRadius: "full", bg: tone.bg, color: tone.fg, sx: {
|
|
@@ -7,14 +7,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("@chakra-ui/react");
|
|
8
8
|
const lucide_react_1 = require("lucide-react");
|
|
9
9
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
10
|
+
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
10
11
|
const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
11
12
|
const TableToggle = ({ value, onChange }) => {
|
|
12
13
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
14
|
+
const { colors } = theme;
|
|
15
|
+
const restInk = (0, outlineRung_1.liftToContrast)(colors.background[800], colors.background[600], outlineRung_1.AA_NON_TEXT);
|
|
16
|
+
const hoverInk = (0, outlineRung_1.liftToContrast)(colors.background[900], colors.background[400], outlineRung_1.AA_NON_TEXT);
|
|
13
17
|
const styles = {
|
|
14
18
|
container: {
|
|
15
19
|
display: "flex",
|
|
16
20
|
alignItems: "center",
|
|
17
|
-
bg:
|
|
21
|
+
bg: colors.background[600],
|
|
18
22
|
p: "0.125rem",
|
|
19
23
|
borderRadius: "md",
|
|
20
24
|
height: "2rem",
|
|
@@ -22,19 +26,19 @@ const TableToggle = ({ value, onChange }) => {
|
|
|
22
26
|
width: "6.3rem",
|
|
23
27
|
},
|
|
24
28
|
button: (mode) => ({
|
|
25
|
-
bg: value === mode ?
|
|
29
|
+
bg: value === mode ? colors.background[50] : "transparent",
|
|
26
30
|
boxShadow: value === mode ? "md" : "none",
|
|
27
|
-
color: value === mode ?
|
|
31
|
+
color: value === mode ? colors.text[900] : restInk,
|
|
28
32
|
borderRadius: "base",
|
|
29
33
|
height: "1.75rem",
|
|
30
34
|
border: "0.031rem solid",
|
|
31
|
-
borderColor: value === mode ?
|
|
35
|
+
borderColor: value === mode ? colors.background[400] : "transparent",
|
|
32
36
|
padding: "0.313rem 0.813rem",
|
|
33
37
|
_hover: {
|
|
34
38
|
bg: value === mode
|
|
35
|
-
?
|
|
36
|
-
:
|
|
37
|
-
color: value === mode ?
|
|
39
|
+
? colors.background[50]
|
|
40
|
+
: colors.background[400],
|
|
41
|
+
color: value === mode ? colors.text[900] : hoverInk,
|
|
38
42
|
},
|
|
39
43
|
transition: "all 0.3s ease-in-out",
|
|
40
44
|
}),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = ToggleSwitch;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@chakra-ui/react");
|
|
6
|
+
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
7
|
+
const SIZES = {
|
|
8
|
+
sm: { w: "2rem", h: "1.125rem", knob: "0.875rem", travel: "0.75rem" },
|
|
9
|
+
md: { w: "2.375rem", h: "1.375rem", knob: "1.125rem", travel: "0.875rem" },
|
|
10
|
+
};
|
|
11
|
+
function ToggleSwitch({ isChecked, onChange, isDisabled = false, size = "md", id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }) {
|
|
12
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
13
|
+
const dims = SIZES[size];
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "button", type: "button", id: id, role: "switch", "aria-checked": isChecked, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, disabled: isDisabled, onClick: () => onChange(!isChecked), position: "relative", display: "inline-flex", alignItems: "center", flexShrink: 0, w: dims.w, h: dims.h, p: 0, borderRadius: "full", borderWidth: "1px", borderStyle: "solid", borderColor: isChecked ? colors.primary[500] : colors.boxborder[500], bg: isChecked ? colors.primary[500] : colors.background[600], opacity: isDisabled ? 0.5 : 1, cursor: isDisabled ? "not-allowed" : "pointer", transition: "background-color 0.2s ease, border-color 0.2s ease", _focusVisible: {
|
|
15
|
+
outline: "none",
|
|
16
|
+
boxShadow: `0 0 0 2px ${colors.primary[300]}`,
|
|
17
|
+
}, children: (0, jsx_runtime_1.jsx)(react_1.Box, { "aria-hidden": "true", position: "absolute", left: "0.125rem", w: dims.knob, h: dims.knob, borderRadius: "full", bg: colors.background[50], boxShadow: "sm", transition: "transform 0.2s ease", transform: isChecked ? `translateX(${dims.travel})` : "translateX(0)" }) }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ToggleSwitchSize = "sm" | "md";
|
|
2
|
+
export type ToggleSwitchProps = {
|
|
3
|
+
isChecked: boolean;
|
|
4
|
+
onChange: (checked: boolean) => void;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
size?: ToggleSwitchSize;
|
|
7
|
+
id?: string;
|
|
8
|
+
/** The control carries no visible text, so it has no other way to be named. */
|
|
9
|
+
"aria-label": string;
|
|
10
|
+
"aria-describedby"?: string;
|
|
11
|
+
};
|
|
@@ -7,18 +7,18 @@ const react_2 = require("@chakra-ui/react");
|
|
|
7
7
|
const useIsTruncated_1 = require("../../Hooks/useIsTruncated");
|
|
8
8
|
const mergeRefs_1 = require("../../Utils/mergeRefs");
|
|
9
9
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
10
|
-
|
|
10
|
+
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
11
|
+
function ToolTip({ placement = "top", label, children, hasArrow = true, fontSize = "14px", bg, color, isDisabled, overflowOnly = false, isOpen, defaultIsOpen, openDelay = 0, closeDelay = 0, arrowSize = 10, closeOnClick = false, size, width, height, arrowPadding, arrowShadowColor, direction, gutter = 8, onClose, modifiers, closeOnPointerDown, styles, }) {
|
|
11
12
|
// Measure the child for `overflowOnly`. The hook is always called (Rules of
|
|
12
13
|
// Hooks) but is fully inert unless `overflowOnly` is set — no layout reads,
|
|
13
14
|
// no ResizeObserver, no re-renders for ordinary tooltips. Measurement never
|
|
14
15
|
// runs on hover/scroll, so showing the tooltip stays as cheap as before.
|
|
15
16
|
const { ref, isTruncated } = (0, useIsTruncated_1.useIsTruncated)(label, overflowOnly && (0, react_1.isValidElement)(children));
|
|
16
|
-
//
|
|
17
|
-
// label. `sidebar.background` is the only ramp `buildDarkPalette` deliberately leaves
|
|
18
|
-
// un-inverted, so it stays near-black in dark mode and the white label stays legible —
|
|
19
|
-
// every other surface ramp flips light and would render the label invisible.
|
|
17
|
+
// `sidebar.background` stays near-black in both modes; ink is computed via `onFilled`.
|
|
20
18
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
21
19
|
const surface = theme.colors.sidebar.background[500];
|
|
20
|
+
const resolvedBg = bg !== null && bg !== void 0 ? bg : surface;
|
|
21
|
+
const resolvedColor = color !== null && color !== void 0 ? color : (0, accentText_1.onFilled)(resolvedBg, theme.colors.white, theme.colors.black);
|
|
22
22
|
let content = children;
|
|
23
23
|
let effectiveDisabled = isDisabled;
|
|
24
24
|
if (overflowOnly && (0, react_1.isValidElement)(children)) {
|
|
@@ -29,5 +29,5 @@ function ToolTip({ placement = "top", label, children, hasArrow = true, fontSize
|
|
|
29
29
|
});
|
|
30
30
|
effectiveDisabled = Boolean(isDisabled) || !isTruncated;
|
|
31
31
|
}
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg:
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: label, placement: placement, hasArrow: hasArrow, fontSize: fontSize, bg: resolvedBg, color: resolvedColor, isDisabled: effectiveDisabled, isOpen: isOpen, defaultIsOpen: defaultIsOpen, openDelay: openDelay, closeDelay: closeDelay, arrowSize: arrowSize, closeOnClick: closeOnClick, size: size, width: width, height: height, arrowPadding: arrowPadding, arrowShadowColor: arrowShadowColor, direction: direction, gutter: gutter, onClose: onClose, modifiers: modifiers, closeOnPointerDown: closeOnPointerDown, style: styles, px: 3, py: 2, borderRadius: "lg", fontWeight: "400", lineHeight: "1.5", maxW: "300px", children: content }));
|
|
33
33
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TooltipProps as ChakraTooltip } from "@chakra-ui/react";
|
|
2
|
-
export type ToolTipProps = Pick<ChakraTooltip, "placement" | "label" | "hasArrow" | "fontSize" | "
|
|
2
|
+
export type ToolTipProps = Pick<ChakraTooltip, "placement" | "label" | "hasArrow" | "fontSize" | "isDisabled" | "isOpen" | "defaultIsOpen" | "openDelay" | "closeDelay" | "arrowSize" | "closeOnClick" | "size" | "width" | "height" | "arrowPadding" | "arrowShadowColor" | "direction" | "gutter" | "onClose" | "modifiers" | "closeOnPointerDown"> & {
|
|
3
|
+
bg?: string;
|
|
4
|
+
color?: string;
|
|
3
5
|
children: React.ReactNode;
|
|
4
6
|
styles?: React.CSSProperties;
|
|
5
7
|
/**
|
|
@@ -5,7 +5,7 @@ const react_1 = require("@chakra-ui/react");
|
|
|
5
5
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
6
6
|
const TrailWorks = () => {
|
|
7
7
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
8
|
-
const cellBorder = colors.
|
|
8
|
+
const cellBorder = colors.boxborder[200];
|
|
9
9
|
const data = [
|
|
10
10
|
{
|
|
11
11
|
contact: "John Doe",
|
|
@@ -4,7 +4,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const lucide_react_1 = require("lucide-react");
|
|
6
6
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
7
|
-
const
|
|
7
|
+
const gradientInk_1 = require("../../Theme/tokens/builders/gradientInk");
|
|
8
8
|
const color_1 = require("../../Theme/tokens/builders/color");
|
|
9
9
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
10
10
|
/** The brand's gold sparkle accent, kept only where it clears 3:1 on the button's own fill. */
|
|
@@ -35,10 +35,10 @@ const UpgradeButton = ({ label, mobileLabel, subtitle, icon = lucide_react_1.Spa
|
|
|
35
35
|
danger: { from: c.semantic.error[400], to: c.semantic.error[600] },
|
|
36
36
|
info: { from: c.semantic.info[400], to: c.semantic.info[600] },
|
|
37
37
|
};
|
|
38
|
-
const resolved = gradient !== null && gradient !== void 0 ? gradient : variantGradient[variant];
|
|
39
38
|
// `iconColor`'s gold default fails AA as body text against this gradient (measured ~1.4-3.3
|
|
40
39
|
// across brands) — the label/subtitle share this computed ink instead.
|
|
41
|
-
const
|
|
40
|
+
const resolved = (0, gradientInk_1.resolveGradient)(gradient !== null && gradient !== void 0 ? gradient : variantGradient[variant], c.white, c.black);
|
|
41
|
+
const ink = resolved.ink;
|
|
42
42
|
// The gold only clears 1.4.11's 3:1 on a DARK gradient. zinc dark inverts `primary` to a
|
|
43
43
|
// near-white fill, where gold-on-near-white measures ~1.3:1 and the icon vanishes, so fall
|
|
44
44
|
// back to the label's ink whenever the gold misses either stop.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cssForScrollBar = exports.FlexCss = exports.HEADER_HEIGHT = void 0;
|
|
4
|
+
const scrollbar_1 = require("../Theme/tokens/builders/scrollbar");
|
|
4
5
|
exports.HEADER_HEIGHT = "4.3rem";
|
|
5
6
|
exports.FlexCss = {
|
|
6
7
|
"&::-webkit-scrollbar": {
|
|
7
|
-
width:
|
|
8
|
+
width: scrollbar_1.SCROLLBAR_WIDTH,
|
|
8
9
|
},
|
|
9
10
|
"&::-webkit-scrollbar-track": {
|
|
10
11
|
background: "transparent",
|
|
@@ -19,7 +20,7 @@ exports.FlexCss = {
|
|
|
19
20
|
};
|
|
20
21
|
const cssForScrollBar = (theme) => ({
|
|
21
22
|
"&::-webkit-scrollbar": {
|
|
22
|
-
width:
|
|
23
|
+
width: scrollbar_1.SCROLLBAR_WIDTH,
|
|
23
24
|
},
|
|
24
25
|
"&::-webkit-scrollbar-track": {
|
|
25
26
|
background: theme.colors.sidebar.background[500],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaletteProps } from "./tokens/types";
|
|
2
|
-
declare const REQUIRED_GROUPS: readonly ["gradient", "primary", "secondary", "tertiary", "transparent", "black", "white", "semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink", "backgroundColor", "background", "text", "header", "placeholder", "boxShadow", "sidebar", "boxborder", "border", "table", "disabled", "accentText", "textMuted", "semanticText", "onPrimary", "onSemantic"];
|
|
2
|
+
declare const REQUIRED_GROUPS: readonly ["gradient", "primary", "secondary", "tertiary", "transparent", "black", "white", "semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink", "backgroundColor", "background", "text", "header", "placeholder", "boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled", "accentText", "textMuted", "semanticText", "onPrimary", "onSemantic"];
|
|
3
3
|
type Unlisted = Exclude<keyof PaletteProps, (typeof REQUIRED_GROUPS)[number]>;
|
|
4
4
|
export type AllPaletteTokensListed = Unlisted extends never ? true : ["unlisted token", Unlisted];
|
|
5
5
|
export declare const allPaletteTokensListed: AllPaletteTokensListed;
|
|
@@ -5,8 +5,8 @@ const REQUIRED_GROUPS = [
|
|
|
5
5
|
"gradient", "primary", "secondary", "tertiary", "transparent", "black", "white",
|
|
6
6
|
"semantic", "gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan",
|
|
7
7
|
"purple", "pink", "backgroundColor", "background", "text", "header", "placeholder",
|
|
8
|
-
"boxShadow", "sidebar", "boxborder", "border", "table", "disabled",
|
|
9
|
-
"textMuted", "semanticText", "onPrimary", "onSemantic",
|
|
8
|
+
"boxShadow", "focusRing", "sidebar", "boxborder", "border", "table", "disabled",
|
|
9
|
+
"accentText", "textMuted", "semanticText", "onPrimary", "onSemantic",
|
|
10
10
|
];
|
|
11
11
|
exports.allPaletteTokensListed = true;
|
|
12
12
|
const NESTED = [
|
|
@@ -17,6 +17,7 @@ const NESTED = [
|
|
|
17
17
|
]],
|
|
18
18
|
["semanticText", ["success", "error", "warning", "info"]],
|
|
19
19
|
["onSemantic", ["success", "error", "warning", "info"]],
|
|
20
|
+
["focusRing", ["ring", "halo"]],
|
|
20
21
|
["backgroundColor", ["main", "base"]],
|
|
21
22
|
["boxShadow", ["primary", "default"]],
|
|
22
23
|
];
|
|
@@ -31,6 +31,11 @@ const baseStyle = definePartsStyle(({ theme }) => {
|
|
|
31
31
|
[$bg.variable]: colors.backgroundColor.light,
|
|
32
32
|
bg: $bg.reference,
|
|
33
33
|
color: colors.text[900],
|
|
34
|
+
// A rule at CHROME_RULE weight, not Chakra's gray.200: that default read as a hard edge,
|
|
35
|
+
// which is why this shipped borderless. At 1.31:1 the edge defines the surface instead.
|
|
36
|
+
borderWidth: "1px",
|
|
37
|
+
borderStyle: "solid",
|
|
38
|
+
borderColor: colors.boxborder[200],
|
|
34
39
|
},
|
|
35
40
|
// Own CSS var (`--menu-item-bg`), NOT the list's `--menu-bg` — Chakra's stock item
|
|
36
41
|
// baseStyle rewrites `--menu-bg` itself on hover/focus, so reusing that same var name
|
|
@@ -21,8 +21,12 @@ const baseStyle = definePartsStyle(({ theme }) => {
|
|
|
21
21
|
content: {
|
|
22
22
|
[$popperBg.variable]: colors.backgroundColor.light,
|
|
23
23
|
bg: $popperBg.reference,
|
|
24
|
-
[$arrowShadowColor.variable]: colors.
|
|
24
|
+
[$arrowShadowColor.variable]: colors.boxborder[200],
|
|
25
25
|
color: colors.text[900],
|
|
26
|
+
// Matches Menu: a CHROME_RULE-weight edge, not Chakra's gray.200 hard edge.
|
|
27
|
+
borderWidth: "1px",
|
|
28
|
+
borderStyle: "solid",
|
|
29
|
+
borderColor: colors.boxborder[200],
|
|
26
30
|
},
|
|
27
31
|
};
|
|
28
32
|
});
|
|
@@ -73,6 +73,9 @@ export declare const componentStyles: {
|
|
|
73
73
|
[x: string]: string;
|
|
74
74
|
bg: string;
|
|
75
75
|
color: string;
|
|
76
|
+
borderWidth: string;
|
|
77
|
+
borderStyle: string;
|
|
78
|
+
borderColor: string;
|
|
76
79
|
};
|
|
77
80
|
item: {
|
|
78
81
|
bg: string;
|
|
@@ -142,6 +145,9 @@ export declare const componentStyles: {
|
|
|
142
145
|
[x: string]: string;
|
|
143
146
|
bg: string;
|
|
144
147
|
color: string;
|
|
148
|
+
borderWidth: string;
|
|
149
|
+
borderStyle: string;
|
|
150
|
+
borderColor: string;
|
|
145
151
|
};
|
|
146
152
|
}) | undefined;
|
|
147
153
|
sizes?: {
|
|
@@ -9,6 +9,8 @@ const common_web_1 = __importDefault(require("./common.web"));
|
|
|
9
9
|
const fonts_web_1 = __importDefault(require("./fonts.web"));
|
|
10
10
|
const componentStyles_1 = require("./componentStyles");
|
|
11
11
|
const accentText_1 = require("../tokens/builders/accentText");
|
|
12
|
+
const scrollbar_1 = require("../tokens/builders/scrollbar");
|
|
13
|
+
const focusRing_styles_1 = require("./focusRing.styles");
|
|
12
14
|
/**
|
|
13
15
|
* Builds a Chakra theme from a pure brand palette.
|
|
14
16
|
*
|
|
@@ -26,6 +28,12 @@ const createBrandTheme = (palette, options = {}) => {
|
|
|
26
28
|
colors: palette,
|
|
27
29
|
...fonts_web_1.default,
|
|
28
30
|
...common_web_1.default,
|
|
31
|
+
// `shadows.outline` is what Chakra's stock `_focusVisible` reaches for on EVERY component it
|
|
32
|
+
// themes. The primitive ships one hardcoded blue (`rgba(66,153,225,.6)`), which measured
|
|
33
|
+
// 1.83:1 on the lavender canvas and 1.38:1 on a primary button — below 1.4.11's 3:1 on all
|
|
34
|
+
// nine brands, in both modes. A primitive cannot know the palette; this is the first place
|
|
35
|
+
// that does, so the palette-derived ring is bound here and every stock focus state inherits it.
|
|
36
|
+
shadows: { ...common_web_1.default.shadows, outline: (0, focusRing_styles_1.focusRingShadow)(palette) },
|
|
29
37
|
};
|
|
30
38
|
return (0, react_1.extendTheme)({
|
|
31
39
|
...brand,
|
|
@@ -89,22 +97,8 @@ const createBrandTheme = (palette, options = {}) => {
|
|
|
89
97
|
color: (0, accentText_1.onFilled)(palette.primary[500], palette.white, palette.black),
|
|
90
98
|
},
|
|
91
99
|
// `color-scheme: dark` gives WebKit/Blink a dark scrollbar by default, but it's the
|
|
92
|
-
// OS's generic dark gray, not brand-aware
|
|
93
|
-
|
|
94
|
-
"::-webkit-scrollbar": {
|
|
95
|
-
width: "10px",
|
|
96
|
-
height: "10px",
|
|
97
|
-
},
|
|
98
|
-
"::-webkit-scrollbar-track": {
|
|
99
|
-
background: palette.backgroundColor.main,
|
|
100
|
-
},
|
|
101
|
-
"::-webkit-scrollbar-thumb": {
|
|
102
|
-
background: palette.gray[600],
|
|
103
|
-
borderRadius: "6px",
|
|
104
|
-
},
|
|
105
|
-
"::-webkit-scrollbar-thumb:hover": {
|
|
106
|
-
background: palette.gray[500],
|
|
107
|
-
},
|
|
100
|
+
// OS's generic dark gray, not brand-aware.
|
|
101
|
+
...(0, scrollbar_1.globalScrollbarStyles)(palette),
|
|
108
102
|
// Chrome/Edge autofill paints its own opaque yellow/white fill behind the input
|
|
109
103
|
// text via `-webkit-box-shadow` (not `background`), so a plain `bg` override never
|
|
110
104
|
// reaches it — a bright light box survives on every dark autofilled field unless
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FocusRingTokens } from "../tokens/types";
|
|
2
|
+
/**
|
|
3
|
+
* WEB binding for the `focusRing` token pair. The colours are derived in
|
|
4
|
+
* `tokens/builders/focusRing.ts` (pure, shared with the mobile library); the CSS shape —
|
|
5
|
+
* box-shadow bands, the forced-colors outline — is web-only and lives here.
|
|
6
|
+
*/
|
|
7
|
+
/** Inner band, in the surface tone: separates the ring from the control's own fill. */
|
|
8
|
+
export declare const FOCUS_HALO_WIDTH = 2;
|
|
9
|
+
/** Outer edge of the brand band. The band itself is the 2px between halo and ring. */
|
|
10
|
+
export declare const FOCUS_RING_WIDTH = 4;
|
|
11
|
+
type WithFocusRing = {
|
|
12
|
+
focusRing: FocusRingTokens;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The two-tone ring as a single `box-shadow`. Drawn OUTSIDE the border box, so it costs no
|
|
16
|
+
* layout and never resizes the control — the reason this is a shadow and not an outline.
|
|
17
|
+
*/
|
|
18
|
+
export declare const focusRingShadow: (colors: WithFocusRing) => string;
|
|
19
|
+
/**
|
|
20
|
+
* `:hover`, `:active` and `:focus-visible` all score the same specificity, so which one paints
|
|
21
|
+
* comes down to source order — and in the merged style object Chakra's own Button baseStyle
|
|
22
|
+
* registers `_focusVisible` BEFORE `_hover`. A focused button that is also hovered would then
|
|
23
|
+
* drop the ring for `_hover`'s `boxShadow: "sm"`. Stacking the pseudo-classes raises the
|
|
24
|
+
* specificity above both, so the ring survives whatever else the state repaints.
|
|
25
|
+
*/
|
|
26
|
+
export declare const FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
27
|
+
/**
|
|
28
|
+
* `:focus-visible`, never `:focus` — a mouse click must not draw a ring.
|
|
29
|
+
*
|
|
30
|
+
* The transparent outline is not decoration: in Windows High Contrast / `forced-colors` mode
|
|
31
|
+
* box-shadows are dropped entirely, and a transparent outline is the one thing the OS repaints
|
|
32
|
+
* in its own focus colour. Without it, forced-colors users get no indicator at all.
|
|
33
|
+
*/
|
|
34
|
+
export declare const focusVisibleRing: (colors: WithFocusRing) => {
|
|
35
|
+
outline: string;
|
|
36
|
+
outlineOffset: string;
|
|
37
|
+
boxShadow: string;
|
|
38
|
+
};
|
|
39
|
+
/** Both selectors a control needs to keep the ring on top of its own hover/active styling. */
|
|
40
|
+
export declare const focusVisibleStyles: (colors: WithFocusRing) => {
|
|
41
|
+
_focusVisible: {
|
|
42
|
+
outline: string;
|
|
43
|
+
outlineOffset: string;
|
|
44
|
+
boxShadow: string;
|
|
45
|
+
};
|
|
46
|
+
"&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible": {
|
|
47
|
+
outline: string;
|
|
48
|
+
outlineOffset: string;
|
|
49
|
+
boxShadow: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.focusVisibleStyles = exports.focusVisibleRing = exports.FOCUS_VISIBLE_OVER_STATE = exports.focusRingShadow = exports.FOCUS_RING_WIDTH = exports.FOCUS_HALO_WIDTH = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* WEB binding for the `focusRing` token pair. The colours are derived in
|
|
6
|
+
* `tokens/builders/focusRing.ts` (pure, shared with the mobile library); the CSS shape —
|
|
7
|
+
* box-shadow bands, the forced-colors outline — is web-only and lives here.
|
|
8
|
+
*/
|
|
9
|
+
/** Inner band, in the surface tone: separates the ring from the control's own fill. */
|
|
10
|
+
exports.FOCUS_HALO_WIDTH = 2;
|
|
11
|
+
/** Outer edge of the brand band. The band itself is the 2px between halo and ring. */
|
|
12
|
+
exports.FOCUS_RING_WIDTH = 4;
|
|
13
|
+
/**
|
|
14
|
+
* The two-tone ring as a single `box-shadow`. Drawn OUTSIDE the border box, so it costs no
|
|
15
|
+
* layout and never resizes the control — the reason this is a shadow and not an outline.
|
|
16
|
+
*/
|
|
17
|
+
const focusRingShadow = (colors) => `0 0 0 ${exports.FOCUS_HALO_WIDTH}px ${colors.focusRing.halo}, ` +
|
|
18
|
+
`0 0 0 ${exports.FOCUS_RING_WIDTH}px ${colors.focusRing.ring}`;
|
|
19
|
+
exports.focusRingShadow = focusRingShadow;
|
|
20
|
+
/**
|
|
21
|
+
* `:hover`, `:active` and `:focus-visible` all score the same specificity, so which one paints
|
|
22
|
+
* comes down to source order — and in the merged style object Chakra's own Button baseStyle
|
|
23
|
+
* registers `_focusVisible` BEFORE `_hover`. A focused button that is also hovered would then
|
|
24
|
+
* drop the ring for `_hover`'s `boxShadow: "sm"`. Stacking the pseudo-classes raises the
|
|
25
|
+
* specificity above both, so the ring survives whatever else the state repaints.
|
|
26
|
+
*/
|
|
27
|
+
exports.FOCUS_VISIBLE_OVER_STATE = "&:hover:focus-visible, &:active:focus-visible, &[data-active]:focus-visible";
|
|
28
|
+
/**
|
|
29
|
+
* `:focus-visible`, never `:focus` — a mouse click must not draw a ring.
|
|
30
|
+
*
|
|
31
|
+
* The transparent outline is not decoration: in Windows High Contrast / `forced-colors` mode
|
|
32
|
+
* box-shadows are dropped entirely, and a transparent outline is the one thing the OS repaints
|
|
33
|
+
* in its own focus colour. Without it, forced-colors users get no indicator at all.
|
|
34
|
+
*/
|
|
35
|
+
const focusVisibleRing = (colors) => ({
|
|
36
|
+
outline: "2px solid transparent",
|
|
37
|
+
outlineOffset: "2px",
|
|
38
|
+
boxShadow: (0, exports.focusRingShadow)(colors),
|
|
39
|
+
});
|
|
40
|
+
exports.focusVisibleRing = focusVisibleRing;
|
|
41
|
+
/** Both selectors a control needs to keep the ring on top of its own hover/active styling. */
|
|
42
|
+
const focusVisibleStyles = (colors) => {
|
|
43
|
+
const ring = (0, exports.focusVisibleRing)(colors);
|
|
44
|
+
return { _focusVisible: ring, [exports.FOCUS_VISIBLE_OVER_STATE]: ring };
|
|
45
|
+
};
|
|
46
|
+
exports.focusVisibleStyles = focusVisibleStyles;
|
|
@@ -26,7 +26,10 @@ const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
|
|
|
26
26
|
* regardless of which brand/mode is currently active.
|
|
27
27
|
*/
|
|
28
28
|
const brandSwatchColor = (brand) => index_1.brandThemes[brand].light.colors.primary[500];
|
|
29
|
-
const BrandSwatch = ({ brand }) =>
|
|
29
|
+
const BrandSwatch = ({ brand }) => {
|
|
30
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: colors.boxborder[200], flexShrink: 0 }));
|
|
32
|
+
};
|
|
30
33
|
/**
|
|
31
34
|
* Palette values already differ per color mode (`brandThemes[brand].light|dark`), so tokens
|
|
32
35
|
* are read straight from the active theme — no `useColorModeValue` pairing needed here.
|
|
@@ -39,7 +42,7 @@ const useSwitcherColors = () => {
|
|
|
39
42
|
activeColor: colors.primary[500],
|
|
40
43
|
mutedColor: colors.text[600],
|
|
41
44
|
hoverBg: colors.gray[100],
|
|
42
|
-
borderColor: colors.
|
|
45
|
+
borderColor: colors.boxborder[200],
|
|
43
46
|
// NOTE: menuBg lives in Menu.styles.ts — re-pushing it via `sx` flickers on every render.
|
|
44
47
|
menuColor: colors.text[900],
|
|
45
48
|
};
|