pixelize-design-library 2.4.2-beta.2 → 2.4.2-beta.21
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 +2 -2
- package/dist/Components/Button/Button.d.ts +2 -2
- package/dist/Components/Button/Button.js +3 -3
- package/dist/Components/Button/Button.styles.js +4 -3
- 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/Checkbox/Checkbox.js +1 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +1 -1
- package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/Components/DatePicker/CalendarPanel.js +1 -1
- package/dist/Components/DatePicker/RangeDatePicker.js +2 -2
- package/dist/Components/DatePicker/SingleDatePicker.js +2 -2
- package/dist/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/Components/Dropdown/DropDown.js +3 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/Components/FilePreview/FilePreview.js +1 -1
- package/dist/Components/FileUpload/FileUpload.js +3 -2
- package/dist/Components/FileUpload/FileUploadProps.d.ts +2 -1
- package/dist/Components/FileUpload/constants.js +1 -0
- package/dist/Components/FilterSidebar/FilterSidebar.js +4 -4
- package/dist/Components/Form/FormWrapper.js +1 -1
- 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/MultiSelect/MultiSelect.js +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +3 -3
- package/dist/Components/NoteTextArea/NoteTextArea.js +5 -3
- package/dist/Components/NumberInput/NumberInput.styles.js +5 -4
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- 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/ProfileCard/ProfileCard.js +1 -1
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/Components/RadioButton/RadioButton.js +1 -1
- package/dist/Components/Reorder/Reorder.js +1 -1
- package/dist/Components/ScrollbarBox/ScrollbarBox.d.ts +13 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
- package/dist/Components/SearchSelect/SearchSelect.js +5 -4
- package/dist/Components/Select/Select.styles.js +3 -2
- package/dist/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/Components/SelectV2/SelectV2.js +5 -11
- package/dist/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/Components/StageProgress/StageProgress.js +2 -9
- 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/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 +3 -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/Timeline/Timeline.js +2 -2
- package/dist/Components/Toaster/Toaster.js +1 -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/chakra/Menu.styles.d.ts +9 -6
- package/dist/Theme/chakra/Menu.styles.js +11 -5
- package/dist/Theme/chakra/Popover.styles.d.ts +6 -3
- package/dist/Theme/chakra/Popover.styles.js +11 -6
- package/dist/Theme/chakra/Switch.styles.d.ts +1 -1
- package/dist/Theme/chakra/Switch.styles.js +7 -9
- package/dist/Theme/chakra/componentStyles.d.ts +15 -9
- package/dist/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/Theme/provider/ThemeSwitcher.js +13 -20
- package/dist/Theme/tokens/brands/lavender/palette.light.js +2 -6
- package/dist/Theme/tokens/brands/slate/palette.light.js +1 -5
- package/dist/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- 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 +3 -0
- package/dist/Theme/tokens/builders/index.js +3 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +32 -3
- package/dist/Theme/tokens/builders/outlineRung.js +74 -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/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/esm/Components/Accordion/Accordion.js +2 -2
- package/dist/esm/Components/Button/Button.js +4 -4
- package/dist/esm/Components/Button/Button.styles.js +5 -4
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +6 -6
- package/dist/esm/Components/Card/Card.js +2 -2
- package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +2 -0
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +1 -1
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +1 -1
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +2 -2
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +2 -2
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +1 -1
- package/dist/esm/Components/Dropdown/DropDown.js +3 -13
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +1 -1
- package/dist/esm/Components/FilePreview/FilePreview.js +1 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +4 -3
- package/dist/esm/Components/FileUpload/constants.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +4 -4
- package/dist/esm/Components/Form/FormWrapper.js +1 -1
- 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/MultiSelect/MultiSelect.js +1 -1
- package/dist/esm/Components/NavigationBar/NavigationBar.js +3 -3
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +5 -3
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +5 -4
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -2
- 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/ProfileCard/ProfileCard.js +1 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +1 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +1 -1
- package/dist/esm/Components/Reorder/Reorder.js +1 -1
- package/dist/esm/Components/ScrollbarBox/ScrollbarBox.js +9 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +5 -4
- package/dist/esm/Components/Select/Select.styles.js +3 -2
- package/dist/esm/Components/SelectSearch/SelectSearch.js +3 -3
- package/dist/esm/Components/SelectV2/SelectV2.js +5 -11
- package/dist/esm/Components/SideBar/SecondaryBar.js +1 -1
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -9
- package/dist/esm/Components/Table/Table.js +17 -24
- 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 +3 -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/Timeline/Timeline.js +2 -2
- package/dist/esm/Components/Toaster/Toaster.js +1 -1
- 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/chakra/Menu.styles.js +11 -5
- package/dist/esm/Theme/chakra/Popover.styles.js +11 -6
- package/dist/esm/Theme/chakra/Switch.styles.js +7 -9
- package/dist/esm/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +18 -20
- package/dist/esm/Theme/provider/ThemeSwitcher.js +13 -20
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +2 -6
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +1 -5
- package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +1 -1
- package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
- package/dist/esm/Theme/tokens/builders/index.js +3 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +70 -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/scrollbar.js +52 -0
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +20 -5
- package/dist/esm/index.js +6 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +21 -3
- package/package.json +4 -2
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AA_NON_TEXT = exports.MIN_PERCEPTIBLE_STEP = void 0;
|
|
3
|
+
exports.CHROME_RULE = exports.CHROME_BORDER = exports.AA_NON_TEXT = exports.MIN_PERCEPTIBLE_STEP = void 0;
|
|
4
|
+
exports.ruleInk = ruleInk;
|
|
4
5
|
exports.liftToContrast = liftToContrast;
|
|
6
|
+
exports.softenToContrast = softenToContrast;
|
|
5
7
|
exports.withOutlineRung = withOutlineRung;
|
|
6
8
|
exports.resolveHoverTint = resolveHoverTint;
|
|
9
|
+
exports.settleAcross = settleAcross;
|
|
7
10
|
const color_1 = require("./color");
|
|
8
11
|
/**
|
|
9
12
|
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
@@ -13,6 +16,29 @@ const color_1 = require("./color");
|
|
|
13
16
|
exports.MIN_PERCEPTIBLE_STEP = 1.15;
|
|
14
17
|
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
15
18
|
exports.AA_NON_TEXT = 3;
|
|
19
|
+
/**
|
|
20
|
+
* Resting chrome — card, popover and field outlines — settles here, not at `AA_NON_TEXT`.
|
|
21
|
+
* At 3:1 a container border is text-weight and the UI reads as a wireframe; every mainstream
|
|
22
|
+
* system draws this line far lighter (Tailwind gray-200 1.24, Chakra gray.200 1.30, Material
|
|
23
|
+
* outline-variant 1.61). 1.4.11 asks that a control be identifiable, not that its resting
|
|
24
|
+
* border carry the whole job: the fill, the label and the focus ring do that, and the focus
|
|
25
|
+
* ring is still held to `AA_NON_TEXT`.
|
|
26
|
+
*/
|
|
27
|
+
exports.CHROME_BORDER = 1.5;
|
|
28
|
+
// The resting rule between two surfaces — a card edge, a divider, a menu outline. Lighter than
|
|
29
|
+
// CHROME_BORDER, which outlines a control the user acts on.
|
|
30
|
+
exports.CHROME_RULE = 1.31;
|
|
31
|
+
/**
|
|
32
|
+
* A rule is decorative, so it has a ceiling and no floor: soften it until the surface it reads
|
|
33
|
+
* hardest against sits at `target`, and leave a already-fainter rung alone. Never `settleAcross`
|
|
34
|
+
* here — that clears a floor on EVERY surface, so one tinted surface drags the rule darker.
|
|
35
|
+
*/
|
|
36
|
+
function ruleInk(hex, surfaces, target) {
|
|
37
|
+
const loudest = surfaces.reduce((worst, s) => (0, color_1.contrastRatio)(hex, s) > (0, color_1.contrastRatio)(hex, worst) ? s : worst);
|
|
38
|
+
return (0, color_1.contrastRatio)(hex, loudest) > target
|
|
39
|
+
? softenToContrast(hex, loudest, target)
|
|
40
|
+
: hex;
|
|
41
|
+
}
|
|
16
42
|
/**
|
|
17
43
|
* Walks a hex toward `target` contrast against `backdrop`, keeping hue and saturation.
|
|
18
44
|
* Direction is DERIVED from the backdrop, never passed: a mode argument here was redundant
|
|
@@ -36,11 +62,30 @@ function liftToContrast(hex, backdrop, target = exports.AA_NON_TEXT) {
|
|
|
36
62
|
const ends = [(0, color_1.withLightness)(hex, 100, s), (0, color_1.withLightness)(hex, 0, s)];
|
|
37
63
|
return (0, color_1.contrastRatio)(ends[0], backdrop) >= (0, color_1.contrastRatio)(ends[1], backdrop) ? ends[0] : ends[1];
|
|
38
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Mirror of `liftToContrast`: walks ink TOWARD the backdrop, stopping at the last step that
|
|
67
|
+
* still clears `target`. For ink that must stay legible without reading as body copy.
|
|
68
|
+
*/
|
|
69
|
+
function softenToContrast(hex, backdrop, target) {
|
|
70
|
+
if ((0, color_1.contrastRatio)(hex, backdrop) <= target)
|
|
71
|
+
return hex;
|
|
72
|
+
const { s, l: start } = (0, color_1.hexToHsl)(hex);
|
|
73
|
+
const toward = (0, color_1.relativeLuminance)(backdrop) < 0.5 ? -1 : 1;
|
|
74
|
+
let softest = hex;
|
|
75
|
+
for (let l = start; l > 0 && l < 100; l += toward) {
|
|
76
|
+
const next = (0, color_1.withLightness)(hex, l, s);
|
|
77
|
+
if ((0, color_1.contrastRatio)(next, backdrop) < target)
|
|
78
|
+
break;
|
|
79
|
+
softest = next;
|
|
80
|
+
}
|
|
81
|
+
return softest;
|
|
82
|
+
}
|
|
39
83
|
/**
|
|
40
84
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
41
|
-
* pickers, the editor's inputs).
|
|
42
|
-
*
|
|
43
|
-
*
|
|
85
|
+
* pickers, the editor's inputs). Settled onto `CHROME_BORDER` — lifted when a brand authored it
|
|
86
|
+
* invisibly pale, softened when it overshoots. It was previously lifted to `AA_NON_TEXT`, which
|
|
87
|
+
* shipped 3.85-4.95:1 outlines: a text-weight box around every card and popover.
|
|
88
|
+
* Resolved here rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
44
89
|
*
|
|
45
90
|
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
46
91
|
* and outside 1.4.11.
|
|
@@ -53,7 +98,9 @@ function withOutlineRung(palette) {
|
|
|
53
98
|
(0, color_1.contrastRatio)(current, palette.background[50])
|
|
54
99
|
? palette.backgroundColor.main
|
|
55
100
|
: palette.background[50];
|
|
56
|
-
const resolved =
|
|
101
|
+
const resolved = (0, color_1.contrastRatio)(current, backdrop) > exports.CHROME_BORDER
|
|
102
|
+
? softenToContrast(current, backdrop, exports.CHROME_BORDER)
|
|
103
|
+
: liftToContrast(current, backdrop, exports.CHROME_BORDER);
|
|
57
104
|
if (resolved === current)
|
|
58
105
|
return palette;
|
|
59
106
|
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
@@ -69,3 +116,25 @@ function withOutlineRung(palette) {
|
|
|
69
116
|
function resolveHoverTint(seed, restSurface) {
|
|
70
117
|
return liftToContrast(seed, restSurface, exports.MIN_PERCEPTIBLE_STEP);
|
|
71
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Settles ink into `target` against EVERY surface at once. Softening one step can change which
|
|
121
|
+
* surface is hardest, so resolving against a single pre-computed "hardest" one lands under the
|
|
122
|
+
* floor on another — that is how radiant and rosewood ended up with an invisible outline on
|
|
123
|
+
* their muted surface.
|
|
124
|
+
*/
|
|
125
|
+
function settleAcross(hex, surfaces, target) {
|
|
126
|
+
const clearsAll = (c) => surfaces.every((s) => (0, color_1.contrastRatio)(c, s) >= target);
|
|
127
|
+
if (!clearsAll(hex)) {
|
|
128
|
+
return surfaces.reduce((ink, s) => liftToContrast(ink, s, target), hex);
|
|
129
|
+
}
|
|
130
|
+
const { s: sat, l: start } = (0, color_1.hexToHsl)(hex);
|
|
131
|
+
const toward = (0, color_1.relativeLuminance)(surfaces[0]) < 0.5 ? -1 : 1;
|
|
132
|
+
let settled = hex;
|
|
133
|
+
for (let l = start; l > 0 && l < 100; l += toward) {
|
|
134
|
+
const next = (0, color_1.withLightness)(hex, l, sat);
|
|
135
|
+
if (!clearsAll(next))
|
|
136
|
+
break;
|
|
137
|
+
settled = next;
|
|
138
|
+
}
|
|
139
|
+
return settled;
|
|
140
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
/** A field always renders on at least one surface — the first is the reference backdrop. */
|
|
3
|
+
export type FieldSurfaces = readonly [string, ...string[]];
|
|
4
|
+
/**
|
|
5
|
+
* The hint ink for a field: the brand's authored rung settled onto `PLACEHOLDER_TEXT` against the
|
|
6
|
+
* hardest surface a field can land on — lifted when it falls short, softened when it overshoots.
|
|
7
|
+
*
|
|
8
|
+
* Settled rather than floored because the authored rungs measured 3.96-7.73:1 across the brands,
|
|
9
|
+
* and anything much past the floor reads as a field already typed into. The floor is the look:
|
|
10
|
+
* one hint weight for every brand in both modes, instead of a per-brand accident.
|
|
11
|
+
*/
|
|
12
|
+
export declare const placeholderInkOn: (palette: PaletteProps, surfaces: FieldSurfaces) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Every surface an ENABLED field renders on. Disabled fields are deliberately absent — 1.4.3
|
|
15
|
+
* exempts them, and folding their dimmer fill in here would darken the hint on every other field.
|
|
16
|
+
*/
|
|
17
|
+
export declare const fieldSurfaces: (palette: PaletteProps) => FieldSurfaces;
|
|
18
|
+
/** The hint ink every field in this library reads. Takes no backdrop: see `fieldSurfaces`. */
|
|
19
|
+
export declare const placeholderInk: (palette: PaletteProps) => string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.placeholderInk = exports.fieldSurfaces = exports.placeholderInkOn = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
5
|
+
const outlineRung_1 = require("./outlineRung");
|
|
6
|
+
const surfaceRungs_1 = require("./surfaceRungs");
|
|
7
|
+
/**
|
|
8
|
+
* The hint ink for a field: the brand's authored rung settled onto `PLACEHOLDER_TEXT` against the
|
|
9
|
+
* hardest surface a field can land on — lifted when it falls short, softened when it overshoots.
|
|
10
|
+
*
|
|
11
|
+
* Settled rather than floored because the authored rungs measured 3.96-7.73:1 across the brands,
|
|
12
|
+
* and anything much past the floor reads as a field already typed into. The floor is the look:
|
|
13
|
+
* one hint weight for every brand in both modes, instead of a per-brand accident.
|
|
14
|
+
*/
|
|
15
|
+
const placeholderInkOn = (palette, surfaces) => {
|
|
16
|
+
const rung = palette.placeholder[500];
|
|
17
|
+
const hardest = surfaces.reduce((worst, s) => (0, color_1.contrastRatio)(rung, s) < (0, color_1.contrastRatio)(rung, worst) ? s : worst);
|
|
18
|
+
return (0, color_1.contrastRatio)(rung, hardest) > surfaceRungs_1.PLACEHOLDER_TEXT
|
|
19
|
+
? (0, outlineRung_1.softenToContrast)(rung, hardest, surfaceRungs_1.PLACEHOLDER_TEXT)
|
|
20
|
+
: (0, outlineRung_1.liftToContrast)(rung, hardest, surfaceRungs_1.PLACEHOLDER_TEXT);
|
|
21
|
+
};
|
|
22
|
+
exports.placeholderInkOn = placeholderInkOn;
|
|
23
|
+
/**
|
|
24
|
+
* Every surface an ENABLED field renders on. Disabled fields are deliberately absent — 1.4.3
|
|
25
|
+
* exempts them, and folding their dimmer fill in here would darken the hint on every other field.
|
|
26
|
+
*/
|
|
27
|
+
const fieldSurfaces = (palette) => [
|
|
28
|
+
palette.gray[50],
|
|
29
|
+
palette.background[50],
|
|
30
|
+
palette.backgroundColor.main,
|
|
31
|
+
];
|
|
32
|
+
exports.fieldSurfaces = fieldSurfaces;
|
|
33
|
+
/** The hint ink every field in this library reads. Takes no backdrop: see `fieldSurfaces`. */
|
|
34
|
+
const placeholderInk = (palette) => (0, exports.placeholderInkOn)(palette, (0, exports.fieldSurfaces)(palette));
|
|
35
|
+
exports.placeholderInk = placeholderInk;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AA_NON_TEXT } from "./outlineRung";
|
|
2
2
|
import type { PaletteProps } from "../types";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A hint is floored at 3:1, not 4.5:1. Held to body-text contrast it stopped reading as a hint —
|
|
5
|
+
* an empty field looked like one already typed into — and the published library ships this rung
|
|
6
|
+
* as the brand authored it. See CHROME-CONSISTENCY.md.
|
|
7
|
+
*/
|
|
4
8
|
export declare function withPlaceholderRung(palette: PaletteProps): PaletteProps;
|
|
5
9
|
/** The hover row is a SURFACE, so it steps away from the ink rather than the ink moving. */
|
|
6
10
|
export declare function withTableHoverRung(palette: PaletteProps): PaletteProps;
|
|
@@ -6,9 +6,14 @@ exports.withTableHoverRung = withTableHoverRung;
|
|
|
6
6
|
const outlineRung_1 = require("./outlineRung");
|
|
7
7
|
Object.defineProperty(exports, "AA_NON_TEXT", { enumerable: true, get: function () { return outlineRung_1.AA_NON_TEXT; } });
|
|
8
8
|
const accentText_1 = require("./accentText");
|
|
9
|
-
|
|
9
|
+
const surfaceRungs_1 = require("./surfaceRungs");
|
|
10
|
+
/**
|
|
11
|
+
* A hint is floored at 3:1, not 4.5:1. Held to body-text contrast it stopped reading as a hint —
|
|
12
|
+
* an empty field looked like one already typed into — and the published library ships this rung
|
|
13
|
+
* as the brand authored it. See CHROME-CONSISTENCY.md.
|
|
14
|
+
*/
|
|
10
15
|
function withPlaceholderRung(palette) {
|
|
11
|
-
const resolved = (0, outlineRung_1.liftToContrast)(palette.placeholder[500], palette.background[50],
|
|
16
|
+
const resolved = (0, outlineRung_1.liftToContrast)(palette.placeholder[500], palette.background[50], surfaceRungs_1.PLACEHOLDER_TEXT);
|
|
12
17
|
if (resolved === palette.placeholder[500])
|
|
13
18
|
return palette;
|
|
14
19
|
return { ...palette, placeholder: { ...palette.placeholder, 500: resolved } };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
export type ScrollbarStyle = Record<string, unknown>;
|
|
3
|
+
/** One width everywhere. The 3px, 4px, 5px and 10px bars in use were all accidents. */
|
|
4
|
+
export declare const SCROLLBAR_WIDTH = "6px";
|
|
5
|
+
export type ScrollbarVariant = "default" | "overlay" | "hover";
|
|
6
|
+
/**
|
|
7
|
+
* The single source of scrollbar chrome. `overlay` drops the track for bars that float over a
|
|
8
|
+
* card; `hover` keeps the thumb invisible until the region is hovered.
|
|
9
|
+
*/
|
|
10
|
+
export declare function scrollbarStyles(palette: PaletteProps, variant?: ScrollbarVariant): ScrollbarStyle;
|
|
11
|
+
/** The same chrome for the document itself, where `&` selectors do not apply. */
|
|
12
|
+
export declare function globalScrollbarStyles(palette: PaletteProps): ScrollbarStyle;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SCROLLBAR_WIDTH = void 0;
|
|
4
|
+
exports.scrollbarStyles = scrollbarStyles;
|
|
5
|
+
exports.globalScrollbarStyles = globalScrollbarStyles;
|
|
6
|
+
/** One width everywhere. The 3px, 4px, 5px and 10px bars in use were all accidents. */
|
|
7
|
+
exports.SCROLLBAR_WIDTH = "6px";
|
|
8
|
+
const RADIUS = "6px";
|
|
9
|
+
/**
|
|
10
|
+
* The single source of scrollbar chrome. `overlay` drops the track for bars that float over a
|
|
11
|
+
* card; `hover` keeps the thumb invisible until the region is hovered.
|
|
12
|
+
*/
|
|
13
|
+
function scrollbarStyles(palette, variant = "default") {
|
|
14
|
+
const { gray } = palette;
|
|
15
|
+
const track = variant === "default" ? gray[100] : "transparent";
|
|
16
|
+
const thumb = variant === "hover" ? "transparent" : gray[400];
|
|
17
|
+
return {
|
|
18
|
+
scrollbarWidth: "thin",
|
|
19
|
+
scrollbarColor: `${thumb} ${track}`,
|
|
20
|
+
"&::-webkit-scrollbar": {
|
|
21
|
+
width: exports.SCROLLBAR_WIDTH,
|
|
22
|
+
height: exports.SCROLLBAR_WIDTH,
|
|
23
|
+
},
|
|
24
|
+
"&::-webkit-scrollbar-track": {
|
|
25
|
+
background: track,
|
|
26
|
+
borderRadius: RADIUS,
|
|
27
|
+
},
|
|
28
|
+
"&::-webkit-scrollbar-thumb": {
|
|
29
|
+
background: thumb,
|
|
30
|
+
borderRadius: RADIUS,
|
|
31
|
+
transition: "background 0.2s ease",
|
|
32
|
+
},
|
|
33
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
34
|
+
background: gray[500],
|
|
35
|
+
},
|
|
36
|
+
"&::-webkit-scrollbar-corner": {
|
|
37
|
+
background: track,
|
|
38
|
+
},
|
|
39
|
+
...(variant === "hover"
|
|
40
|
+
? {
|
|
41
|
+
"&:hover": { scrollbarColor: `${gray[400]} ${track}` },
|
|
42
|
+
"&:hover::-webkit-scrollbar-thumb": { background: gray[400] },
|
|
43
|
+
}
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The same chrome for the document itself, where `&` selectors do not apply. */
|
|
48
|
+
function globalScrollbarStyles(palette) {
|
|
49
|
+
const { gray } = palette;
|
|
50
|
+
return {
|
|
51
|
+
"::-webkit-scrollbar": { width: exports.SCROLLBAR_WIDTH, height: exports.SCROLLBAR_WIDTH },
|
|
52
|
+
"::-webkit-scrollbar-track": { background: gray[100] },
|
|
53
|
+
"::-webkit-scrollbar-thumb": { background: gray[400], borderRadius: RADIUS },
|
|
54
|
+
"::-webkit-scrollbar-thumb:hover": { background: gray[500] },
|
|
55
|
+
"::-webkit-scrollbar-corner": { background: gray[100] },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { PaletteProps } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* A hint is held to the non-text floor, not the body-text one. Deliberate: at 4.5 an empty field
|
|
4
|
+
* reads as one already typed into. See CHROME-CONSISTENCY.md.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PLACEHOLDER_TEXT = 3;
|
|
2
7
|
export declare const namedSurfaces: (palette: PaletteProps) => string[];
|
|
3
8
|
/** The surface an ink is closest to — clearing it clears every other one. */
|
|
4
9
|
export declare const hardestSurface: (ink: string, surfaces: string[]) => string;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hardestSurface = exports.namedSurfaces = void 0;
|
|
3
|
+
exports.hardestSurface = exports.namedSurfaces = exports.PLACEHOLDER_TEXT = void 0;
|
|
4
4
|
exports.withSurfaceRungs = withSurfaceRungs;
|
|
5
5
|
const color_1 = require("./color");
|
|
6
6
|
const outlineRung_1 = require("./outlineRung");
|
|
7
7
|
const accentText_1 = require("./accentText");
|
|
8
8
|
const semanticText_1 = require("./semanticText");
|
|
9
|
+
/**
|
|
10
|
+
* A hint is held to the non-text floor, not the body-text one. Deliberate: at 4.5 an empty field
|
|
11
|
+
* reads as one already typed into. See CHROME-CONSISTENCY.md.
|
|
12
|
+
*/
|
|
13
|
+
exports.PLACEHOLDER_TEXT = outlineRung_1.AA_NON_TEXT;
|
|
9
14
|
const namedSurfaces = (palette) => [
|
|
10
15
|
...Object.values(palette.backgroundColor),
|
|
11
16
|
palette.background[50],
|
|
@@ -19,6 +24,8 @@ exports.hardestSurface = hardestSurface;
|
|
|
19
24
|
function withSurfaceRungs(palette) {
|
|
20
25
|
const surfaces = (0, exports.namedSurfaces)(palette);
|
|
21
26
|
const lift = (ink, target) => (0, outlineRung_1.liftToContrast)(ink, (0, exports.hardestSurface)(ink, surfaces), target);
|
|
27
|
+
const settle = (ink, target) => (0, outlineRung_1.settleAcross)(ink, surfaces, target);
|
|
28
|
+
const rule = (ink) => (0, outlineRung_1.ruleInk)(ink, [palette.backgroundColor.main, palette.background[50]], outlineRung_1.CHROME_RULE);
|
|
22
29
|
const semanticText = semanticText_1.SEMANTIC_TONES.reduce((acc, tone) => {
|
|
23
30
|
acc[tone] = lift(palette.semanticText[tone], accentText_1.AA_NORMAL_TEXT);
|
|
24
31
|
return acc;
|
|
@@ -30,10 +37,18 @@ function withSurfaceRungs(palette) {
|
|
|
30
37
|
semanticText,
|
|
31
38
|
text: { ...palette.text, 500: lift(palette.text[500], accentText_1.AA_NORMAL_TEXT) },
|
|
32
39
|
header: { ...palette.header, 500: lift(palette.header[500], accentText_1.AA_NORMAL_TEXT) },
|
|
33
|
-
placeholder:
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
// `placeholder` is deliberately absent: the brand authors that rung and the published
|
|
41
|
+
// library ships it untouched. Its floor is enforced in `placeholderInk`, against the
|
|
42
|
+
// surfaces a FIELD renders on — not `table.hover`, which no field sits on.
|
|
43
|
+
// Settled, not lifted: this rung already passed through `withOutlineRung`, and lifting it
|
|
44
|
+
// again here to AA_NON_TEXT is what shipped 3.85-4.95:1 outlines. See CHROME_BORDER.
|
|
45
|
+
boxborder: {
|
|
46
|
+
...palette.boxborder,
|
|
47
|
+
200: rule(palette.boxborder[200]),
|
|
48
|
+
500: settle(palette.boxborder[500], outlineRung_1.CHROME_BORDER),
|
|
36
49
|
},
|
|
37
|
-
|
|
50
|
+
// The 200 rung of both ramps is the same job under two names; settle them together or an
|
|
51
|
+
// app picking `border` gets a heavier rule than one picking `boxborder`.
|
|
52
|
+
border: { ...palette.border, 200: rule(palette.border[200]) },
|
|
38
53
|
};
|
|
39
54
|
}
|
|
@@ -8,13 +8,13 @@ import { getAccordionHoverColors } from "./accordionColors.js";
|
|
|
8
8
|
const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion, items, ...rest }) => {
|
|
9
9
|
const { colors } = useCustomTheme();
|
|
10
10
|
const isDark = isDarkCanvas(colors.backgroundColor.main);
|
|
11
|
-
const border = colors.boxborder[
|
|
11
|
+
const border = colors.boxborder[200];
|
|
12
12
|
const headingColor = colors.text[800];
|
|
13
13
|
const bodyColor = colors.text[600];
|
|
14
14
|
const { expandedBg, softHover } = useMemo(() => getAccordionHoverColors(colors, isDark), [colors, isDark]);
|
|
15
15
|
return (_jsx(ChakraAccordian, { allowMultiple: allowMultiple, allowToggle: allowToggle, index: index, onChange: onChange, reduceMotion: reduceMotion, ...rest, children: items.map((item, idx) => {
|
|
16
16
|
var _a;
|
|
17
|
-
return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[
|
|
17
|
+
return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[200] }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
|
|
18
18
|
var _a, _b, _c;
|
|
19
19
|
return (_jsxs(_Fragment, { children: [_jsx("h2", { children: _jsxs(AccordionButton, { px: 4, py: 3, gap: 3, fontSize: "0.875rem", fontWeight: 600, color: headingColor, bg: isExpanded ? expandedBg : "transparent", transition: "background 0.15s ease", _hover: { bg: isExpanded ? expandedBg : softHover }, _focusVisible: {
|
|
20
20
|
boxShadow: "none",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from "react";
|
|
2
|
+
import { forwardRef, memo } from "react";
|
|
3
3
|
import { Button as ChakraButton } from "@chakra-ui/react";
|
|
4
|
-
function Button({ label, children, onClick, opacity, variant = "solid", leftIcon, rightIcon, size, isDisabled = false, isLoading = false, loadingText = "Loading", type, width, sx, colorScheme,
|
|
5
|
-
return (_jsx(ChakraButton, { ...aria, type: type, onClick: onClick, width: width || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children !== null && children !== void 0 ? children : label }));
|
|
6
|
-
}
|
|
4
|
+
const Button = 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) {
|
|
5
|
+
return (_jsx(ChakraButton, { ...aria, type: type, onClick: onClick, width: width || w || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: children !== null && children !== void 0 ? children : label }));
|
|
6
|
+
});
|
|
7
7
|
export default memo(Button);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { accentTextOnCanvas, isDarkCanvas, onFilled
|
|
1
|
+
import { accentTextOnCanvas, isDarkCanvas, onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
2
|
+
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
2
3
|
/**
|
|
3
4
|
* Outline/ghost/link text sits ON the canvas, so it needs a rung that stays readable there —
|
|
4
5
|
* `[500]` is pinned dark enough to carry a white label on the solid variant and measures only
|
|
@@ -138,11 +139,11 @@ export const Button = {
|
|
|
138
139
|
// Theme-based two-tone gradient: each theme defines its own `gradient` {from,to} pair.
|
|
139
140
|
// Ignores colorScheme; hover/active shift brightness so it works for any pair.
|
|
140
141
|
gradient: ({ theme }) => {
|
|
141
|
-
const g = theme.colors.gradient;
|
|
142
|
-
const bg =
|
|
142
|
+
const g = resolveGradient(theme.colors.gradient, theme.colors.white, theme.colors.black);
|
|
143
|
+
const bg = gradientCss(g);
|
|
143
144
|
return {
|
|
144
145
|
bgImage: bg,
|
|
145
|
-
color:
|
|
146
|
+
color: g.ink,
|
|
146
147
|
border: "none",
|
|
147
148
|
_hover: {
|
|
148
149
|
bgImage: bg,
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
3
|
import { Box, Button, ButtonGroup, IconButton, Menu, MenuButton, MenuItem, MenuList, Tooltip, } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
-
import {
|
|
5
|
+
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
6
6
|
import { hexToRgb } from "../../Theme/tokens/builders/color.js";
|
|
7
7
|
import { rafThrottle } from "../../Utils/rafThrottle.js";
|
|
8
8
|
export default function ButtonGroupIcon({ leftIcon, rightIcon, onLeftIconClick, onRightIconClick, buttonText, onButtonClick, onButtongroupClick, size, variant, color, buttonGroupStyle, buttonGroupLeftIconStyle, buttonGroupRightIconStyle, buttonStyle, onBlurLeftIcon, onBlurRightIcon, dropdownOptions, // New prop for dropdown options
|
|
@@ -46,9 +46,9 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
46
46
|
// keep the segments transparent (so it doesn't restart per button/icon), with a
|
|
47
47
|
// translucent-white hover overlay for per-segment feedback.
|
|
48
48
|
const isGradient = variant === "gradient";
|
|
49
|
-
const gradientStops = theme.colors.gradient;
|
|
50
|
-
const gradientBg =
|
|
51
|
-
const gradientInk =
|
|
49
|
+
const gradientStops = resolveGradient(theme.colors.gradient, theme.colors.white, theme.colors.black);
|
|
50
|
+
const gradientBg = gradientCss(gradientStops);
|
|
51
|
+
const gradientInk = gradientStops.ink;
|
|
52
52
|
const whiteRgb = hexToRgb(theme.colors.white);
|
|
53
53
|
const whiteOverlay = (alpha) => `rgba(${whiteRgb.r}, ${whiteRgb.g}, ${whiteRgb.b}, ${alpha})`;
|
|
54
54
|
const gradientItemSx = isGradient
|
|
@@ -69,7 +69,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
69
69
|
// this theme-swap app never triggers) — our `bg` prop above only recolors the list
|
|
70
70
|
// itself, not the inherited var, so items fell back to white until hover/focus (which
|
|
71
71
|
// our own sx already overrides). Setting the var here fixes the rest state too.
|
|
72
|
-
sx: { "--menu-bg": theme.colors.backgroundColor.light },
|
|
72
|
+
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) => (_jsxs(MenuItem, { onClick: (event) => handleMenuClick(event, option), style: menuItemStyle, sx: {
|
|
73
73
|
display: "flex",
|
|
74
74
|
alignItems: "center",
|
|
75
75
|
gap: "0.5rem",
|
|
@@ -87,7 +87,7 @@ rightIconDropdown, menulistStyle, menuItemStyle, isLoading, divider = true, left
|
|
|
87
87
|
mx: 0,
|
|
88
88
|
borderRadius: "none",
|
|
89
89
|
borderBottom: "1px solid",
|
|
90
|
-
borderColor: theme.colors.boxborder[
|
|
90
|
+
borderColor: theme.colors.boxborder[200],
|
|
91
91
|
}
|
|
92
92
|
: {}),
|
|
93
93
|
_hover: { bg: theme.colors.primary[50], color: theme.colors.primary[700] },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Card as ChakraCard } from "@chakra-ui/react";
|
|
3
|
-
export default function Card({
|
|
4
|
-
return (_jsx(ChakraCard, { maxW: maxW, align: align, variant: variant, direction: direction, justify: justify, size: size, overflow: overflow, colorScheme: color, p: 4, sx: sx, children: children }
|
|
3
|
+
export default function Card({ maxW, align, variant, direction, justify, children, size, color, overflow, sx, }) {
|
|
4
|
+
return (_jsx(ChakraCard, { maxW: maxW, align: align, variant: variant, direction: direction, justify: justify, size: size, overflow: overflow, colorScheme: color, p: 4, sx: sx, children: children }));
|
|
5
5
|
}
|
|
@@ -21,7 +21,7 @@ export default function CheckBox({ label, labelFontSize, showLabelTooltip, label
|
|
|
21
21
|
...labelSx,
|
|
22
22
|
}
|
|
23
23
|
: { ...labelSx };
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsx(ChakraCheckbox, { ...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.
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(ChakraCheckbox, { ...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: {
|
|
25
25
|
...sx,
|
|
26
26
|
".chakra-checkbox__control": { w: controlSize, h: controlSize },
|
|
27
27
|
}, children: label && (showLabelTooltip ? (_jsx(ToolTip, { label: labelTooltip !== null && labelTooltip !== void 0 ? labelTooltip : label, hasArrow: true, placement: "top", fontSize: "0.75rem", children: _jsx(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 }) })) : (_jsx(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 && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
@@ -15,6 +15,8 @@ export const Checkbox = {
|
|
|
15
15
|
height: "1.25rem",
|
|
16
16
|
borderWidth: "1.6px",
|
|
17
17
|
borderRadius: "base",
|
|
18
|
+
// Without a resting colour Chakra falls back to its own gray.500.
|
|
19
|
+
borderColor: theme.colors.boxborder[500],
|
|
18
20
|
transition: "background 0.15s, border-color 0.15s, box-shadow 0.15s",
|
|
19
21
|
_disabled: {
|
|
20
22
|
bg: theme.colors.background[50],
|
|
@@ -11,7 +11,7 @@ export const FIELD_TRANSITION = "border-color 0.2s, box-shadow 0.2s";
|
|
|
11
11
|
export const getFieldStateStyles = (theme, { error = false, focused = false } = {}) => {
|
|
12
12
|
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
|
|
13
13
|
// up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
14
|
-
const idleBorder = theme.colors.boxborder[
|
|
14
|
+
const idleBorder = theme.colors.boxborder[500];
|
|
15
15
|
const primary = theme.colors.primary[500];
|
|
16
16
|
const errorColor = theme.colors.semanticText.error;
|
|
17
17
|
const ringPrimary = theme.colors.boxShadow.primary;
|
|
@@ -34,7 +34,7 @@ const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Co
|
|
|
34
34
|
if (variant === "button") {
|
|
35
35
|
return (_jsxs(Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
|
|
36
36
|
// [800], not [500]: a real control boundary needs >=3:1 on every surface up to `muted`.
|
|
37
|
-
borderColor: copied ? success : theme.colors.boxborder[
|
|
37
|
+
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 ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }), _jsx(Text, { children: copied ? copiedLabel : label })] }));
|
|
38
38
|
}
|
|
39
39
|
return (_jsx(ToolTip, { label: copied ? copiedLabel : tooltip, placement: "top", children: _jsx(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 ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }) }) }));
|
|
40
40
|
};
|
|
@@ -14,6 +14,6 @@ const EditModuleModal = ({ isOpen, onClose, initialName, isLoading, onSubmit, la
|
|
|
14
14
|
// [200] is the decorative divider rung (~1.2:1, correct for the ModalHeader border
|
|
15
15
|
// above) — a real control's resting outline needs 1.4.11's 3:1, which is what every
|
|
16
16
|
// other input in this library (TextInput, NumberInput, DatePicker) reads from [800].
|
|
17
|
-
borderColor: colors.boxborder[
|
|
17
|
+
borderColor: colors.boxborder[500], mb: 5 }), _jsxs(HStack, { justifyContent: "flex-end", spacing: 3, children: [_jsx(Button, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "gray", size: "sm" }), _jsx(Button, { label: labels.update, onClick: () => onSubmit(name.trim()), colorScheme: "primary", size: "sm", isLoading: isLoading, isDisabled: !name.trim() })] })] })] })] }));
|
|
18
18
|
};
|
|
19
19
|
export default EditModuleModal;
|
|
@@ -20,7 +20,7 @@ export const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, t
|
|
|
20
20
|
const hasRange = !!(rangeStart && rangeEnd && !isSameDay(rangeStart, rangeEnd));
|
|
21
21
|
const selectStyles = {
|
|
22
22
|
border: "1px solid",
|
|
23
|
-
// boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[
|
|
23
|
+
// boxborder[500] is the control-outline rung the sibling pickers already use; boxborder[200]
|
|
24
24
|
// is decorative and measured 1.85:1 on the dark canvas — the select read as borderless.
|
|
25
25
|
borderColor: theme.colors.boxborder[500],
|
|
26
26
|
borderRadius: "md",
|
|
@@ -172,7 +172,7 @@ export const RangeDatePicker = (props) => {
|
|
|
172
172
|
: `0 0 0 1px ${theme.colors.primary[500]}`,
|
|
173
173
|
}, _hover: {
|
|
174
174
|
borderColor: error ? theme.colors.semanticText.error : undefined,
|
|
175
|
-
}, cursor: "pointer" }), _jsx(InputRightElement, { height: "100%", display: "flex", alignItems: "center", pointerEvents: "auto", style: { cursor: "pointer" }, onClick: () => (isOpen ? onClose() : handleOpen()), children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { w: "18rem", maxW: "18rem", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl",
|
|
175
|
+
}, cursor: "pointer" }), _jsx(InputRightElement, { height: "100%", display: "flex", alignItems: "center", pointerEvents: "auto", style: { cursor: "pointer" }, onClick: () => (isOpen ? onClose() : handleOpen()), children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { w: "18rem", maxW: "18rem", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { p: 0, children: [_jsx(Box, { display: "flex", flexWrap: "wrap", gap: 2, mb: 3, children: presets.map((p) => (_jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", sx: { flex: "1 1 auto" }, onClick: () => {
|
|
176
176
|
const [from, to] = p.getRange();
|
|
177
177
|
applyPreset(from, to);
|
|
178
178
|
}, children: p.label }, p.label))) }), _jsx(CalendarPanel, { currentMonth: currentMonth, setCurrentMonth: (updater) => setCurrentMonthState((prev) => updater(prev)), today: today, isRange: true, tempDate: null, tempRangeStart: tempRangeStart, tempRangeEnd: tempRangeEnd, hoveredDate: hoveredDate, onDayHover: setHoveredDate, isSameDay: isSameDay, isBefore: isBefore, isAfter: isAfter, minDate: minDate, maxDate: maxDate, disablePastDates: disablePastDates, disableFutureDates: disableFutureDates, disableToday: disableToday, onDaySelect: handleDaySelect }), formatHasTime && (_jsxs(Box, { mt: 3, display: "grid", gridTemplateColumns: "1fr", gap: 2, children: [_jsxs(Box, { children: [_jsx(Box, { fontSize: "xs", color: theme.colors.textMuted, mb: 1, children: "Start time" }), shouldUseSelectTimePicker ? (_jsx(TimePicker, { date: startTimeBaseDate, onChange: (updated) => {
|
|
@@ -201,6 +201,6 @@ export const RangeDatePicker = (props) => {
|
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
setTempRangeEnd(setTimeFrom(endTimeBaseDate, t));
|
|
204
|
-
}, dateFormat: timePickerFormat, disabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[
|
|
204
|
+
}, dateFormat: timePickerFormat, disabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleClear, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: requestClose, children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
205
205
|
};
|
|
206
206
|
export default RangeDatePicker;
|
|
@@ -956,7 +956,7 @@ export const SingleDatePicker = (props) => {
|
|
|
956
956
|
else {
|
|
957
957
|
onClose();
|
|
958
958
|
}
|
|
959
|
-
}, style: { cursor: "pointer" }, children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { width: "auto", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl",
|
|
959
|
+
}, style: { cursor: "pointer" }, children: _jsx(Box, { as: "span", sx: calendarIconWrapperSx, children: _jsx(CalendarIcon, { size: calendarIconPx, color: theme.colors.textMuted }) }) })] }) }) }), _jsx(PopoverContent, { width: "auto", p: 3, ref: popoverRef, boxShadow: "lg", borderRadius: "xl", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { p: 0, children: [showDate && (_jsx(CalendarPanel, { currentMonth: currentMonth, setCurrentMonth: (updater) => setCurrentMonth((prev) => updater(prev)), today: today, isRange: false, tempDate: tempDate, tempRangeStart: null, tempRangeEnd: null, isSameDay: isSameDay, isBefore: isBefore, isAfter: isAfter, minDate: minDate, maxDate: maxDate, disablePastDates: disablePastDates, disableFutureDates: disableFutureDates, disableToday: disableToday, onDaySelect: handleDaySelect })), showTime && (_jsx(Box, { mt: showDate ? 3 : 0, children: resolvedPickerType === "time" ? (_jsx(TimePickerInput, { value: tempDate, onChange: (updatedDate) => {
|
|
960
960
|
setTempDate(updatedDate);
|
|
961
961
|
setInputValue(updatedDate ? format(updatedDate, resolvedDateFormat) : "");
|
|
962
962
|
setIsTyping(false);
|
|
@@ -964,7 +964,7 @@ export const SingleDatePicker = (props) => {
|
|
|
964
964
|
setTempDate(updatedDate);
|
|
965
965
|
setInputValue(format(updatedDate, resolvedDateFormat));
|
|
966
966
|
setIsTyping(false);
|
|
967
|
-
}, disabled: disabled })) })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[
|
|
967
|
+
}, disabled: disabled })) })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: () => {
|
|
968
968
|
setTempDate(null);
|
|
969
969
|
requestClose(null);
|
|
970
970
|
}, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: () => requestClose(), children: "Apply" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
@@ -73,6 +73,6 @@ export const TimeOnlyPicker = (props) => {
|
|
|
73
73
|
onOpen();
|
|
74
74
|
}, error: error, size: sizeKey }) }) }) }), _jsx(PopoverContent, { width: "auto", p: 4, ref: popoverRef, boxShadow: "lg", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { children: [_jsx(TimePicker, { date: resolvedTempDate, dateFormat: dateFormat, onChange: (updatedDate) => {
|
|
75
75
|
handleTimePickerChange(updatedDate);
|
|
76
|
-
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[
|
|
76
|
+
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(ChakraButton, { size: "sm", variant: "ghost", onClick: handleClear, children: "Clear" }), _jsx(ChakraButton, { size: "sm", colorScheme: "primary", onClick: handleOk, children: "OK" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
77
77
|
};
|
|
78
78
|
export default TimeOnlyPicker;
|
|
@@ -3,6 +3,7 @@ import { forwardRef, useCallback, useEffect, useId, useRef, useState } from "rea
|
|
|
3
3
|
import { Box, Flex, Button, useDisclosure, List, ListItem, Portal, } from "@chakra-ui/react";
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import { scrollbarStyles } from "../../Theme/tokens/builders/scrollbar.js";
|
|
6
7
|
import { ChevronDown } from "lucide-react";
|
|
7
8
|
import { rafThrottle } from "../../Utils/rafThrottle.js";
|
|
8
9
|
const MotionBox = motion(forwardRef((props, ref) => (_jsx(Box, { ref: ref, ...props }))));
|
|
@@ -211,18 +212,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
211
212
|
};
|
|
212
213
|
const DropdownContentRender = () => {
|
|
213
214
|
var _a;
|
|
214
|
-
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: {
|
|
215
|
-
scrollbarWidth: "thin",
|
|
216
|
-
scrollbarColor: `${theme.colors.gray[300]} transparent`,
|
|
217
|
-
"&::-webkit-scrollbar": { width: "6px" },
|
|
218
|
-
"&::-webkit-scrollbar-thumb": {
|
|
219
|
-
background: theme.colors.gray[300],
|
|
220
|
-
borderRadius: "base",
|
|
221
|
-
},
|
|
222
|
-
"&::-webkit-scrollbar-thumb:hover": {
|
|
223
|
-
background: theme.colors.gray[400],
|
|
224
|
-
},
|
|
225
|
-
}, style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
|
|
215
|
+
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: scrollbarStyles(theme.colors, "overlay"), style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
|
|
226
216
|
itemRefs.current[index] = node;
|
|
227
217
|
}, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
|
|
228
218
|
handleListItemClick(option.id, option.label);
|
|
@@ -234,7 +224,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
234
224
|
bg: theme.colors.primary.opacity[8],
|
|
235
225
|
color: theme.colors.accentText,
|
|
236
226
|
}, borderBottom: divider
|
|
237
|
-
? `0.063rem solid ${theme.colors.boxborder[
|
|
227
|
+
? `0.063rem solid ${theme.colors.boxborder[200]}`
|
|
238
228
|
: undefined, sx: { "&:last-child": { borderBottom: "none" } }, style: ItemStyle, fontWeight: 500, children: [(option === null || option === void 0 ? void 0 : option.image) && (_jsx(Box, { as: option.image, boxSize: s.img, flexShrink: 0, color: theme.colors.textMuted, style: ImageStyle })), _jsx(Box, { as: "span", fontSize: s.fontSize, isTruncated: true,
|
|
239
229
|
// fontWeight={400}
|
|
240
230
|
style: LabelStyle, children: option.label })] }, option.id))) }));
|