@eifi1/ui-kit 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -38
- package/dist/billing/billing-banner.d.ts +5 -2
- package/dist/billing/billing-banner.js.map +1 -1
- package/dist/billing/plan-limit-notice.d.ts +5 -2
- package/dist/billing/plan-limit-notice.js.map +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/components/amount-input.d.ts +0 -3
- package/dist/components/amount-input.js +2 -2
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/calculator.d.ts +1 -4
- package/dist/components/calculator.js +1 -3
- package/dist/components/calculator.js.map +1 -1
- package/dist/components/chart-zoom.d.ts +0 -37
- package/dist/components/chart-zoom.js +1 -28
- package/dist/components/chart-zoom.js.map +1 -1
- package/dist/components/chip-input.d.ts +0 -4
- package/dist/components/chip-input.js +1 -5
- package/dist/components/chip-input.js.map +1 -1
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/copy-button.d.ts +5 -1
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/currency-option-list.d.ts +3 -8
- package/dist/components/currency-option-list.js +1 -29
- package/dist/components/currency-option-list.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +3 -3
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filter-popover.js +1 -1
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-labels.d.ts +1 -42
- package/dist/components/data-table-labels.js +2 -31
- package/dist/components/data-table-labels.js.map +1 -1
- package/dist/components/data-table-shared.d.ts +17 -1
- package/dist/components/data-table-shared.js +22 -0
- package/dist/components/data-table-shared.js.map +1 -1
- package/dist/components/data-table.d.ts +12 -2
- package/dist/components/data-table.js +18 -14
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +3 -1
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/dropdown.d.ts +18 -15
- package/dist/components/dropdown.js +11 -3
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/entity-combobox.d.ts +1 -1
- package/dist/components/entity-combobox.js.map +1 -1
- package/dist/components/field-base.d.ts +0 -5
- package/dist/components/field-base.js +0 -5
- package/dist/components/field-base.js.map +1 -1
- package/dist/components/field-parts.d.ts +3 -11
- package/dist/components/field-parts.js +1 -9
- package/dist/components/field-parts.js.map +1 -1
- package/dist/components/field-strip.d.ts +8 -23
- package/dist/components/field-strip.js +24 -22
- package/dist/components/field-strip.js.map +1 -1
- package/dist/components/field-sync.d.ts +0 -4
- package/dist/components/field-sync.js +0 -4
- package/dist/components/field-sync.js.map +1 -1
- package/dist/components/field.d.ts +4 -4
- package/dist/components/field.js.map +1 -1
- package/dist/components/full-bleed-dialog.js +2 -2
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/hover-menu.d.ts +6 -13
- package/dist/components/hover-menu.js +3 -3
- package/dist/components/hover-menu.js.map +1 -1
- package/dist/components/inline-entity-combobox.d.ts +1 -1
- package/dist/components/inline-entity-combobox.js.map +1 -1
- package/dist/components/modal.d.ts +9 -1
- package/dist/components/modal.js +7 -4
- package/dist/components/modal.js.map +1 -1
- package/dist/components/multi-select.d.ts +5 -16
- package/dist/components/multi-select.js +5 -10
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/number-input.d.ts +0 -3
- package/dist/components/number-input.js +2 -4
- package/dist/components/number-input.js.map +1 -1
- package/dist/components/popover.js +2 -2
- package/dist/components/popover.js.map +1 -1
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/server-wake.d.ts +0 -6
- package/dist/components/server-wake.js.map +1 -1
- package/dist/components/settings-fields.d.ts +4 -2
- package/dist/components/settings-fields.js.map +1 -1
- package/dist/components/stat-tile.d.ts +8 -2
- package/dist/components/stat-tile.js.map +1 -1
- package/dist/components/swipeable-row.d.ts +2 -17
- package/dist/components/swipeable-row.js +11 -16
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/tooltip.d.ts +9 -1
- package/dist/components/tooltip.js +20 -5
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/translation-review.d.ts +10 -2
- package/dist/components/translation-review.js +11 -3
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/use-table-state.d.ts +31 -3
- package/dist/components/use-table-state.js +53 -8
- package/dist/components/use-table-state.js.map +1 -1
- package/dist/components/user-avatar.d.ts +2 -2
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/components/wizard-stepper.d.ts +1 -4
- package/dist/components/wizard-stepper.js +2 -3
- package/dist/components/wizard-stepper.js.map +1 -1
- package/dist/currencies.d.ts +23 -0
- package/dist/currencies.js +38 -0
- package/dist/currencies.js.map +1 -0
- package/dist/demo/demo-banner.d.ts +7 -2
- package/dist/demo/demo-banner.js.map +1 -1
- package/dist/eslint/index.d.ts +83 -0
- package/dist/eslint/index.js +69 -0
- package/dist/eslint/index.js.map +1 -0
- package/dist/eslint/role-utilities.d.ts +48 -0
- package/dist/eslint/role-utilities.generated.d.ts +2 -0
- package/dist/eslint/role-utilities.generated.js +143 -0
- package/dist/eslint/role-utilities.generated.js.map +1 -0
- package/dist/eslint/role-utilities.js +43 -0
- package/dist/eslint/role-utilities.js.map +1 -0
- package/dist/feedback/feedback-menu.d.ts +2 -2
- package/dist/feedback/feedback-menu.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +3 -8
- package/dist/feedback/feedback-thread.js +0 -2
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/hooks/use-dismiss.d.ts +16 -3
- package/dist/hooks/use-dismiss.js +14 -2
- package/dist/hooks/use-dismiss.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +14 -4
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/fr.js +3 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/it.js +3 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/refs.d.ts +13 -0
- package/dist/lib/refs.js +15 -0
- package/dist/lib/refs.js.map +1 -0
- package/dist/rhf/fields.d.ts +10 -10
- package/dist/rhf/fields.js.map +1 -1
- package/dist/rhf/form-core.d.ts +5 -4
- package/dist/rhf/form-core.js.map +1 -1
- package/dist/rhf/form.d.ts +7 -36
- package/dist/rhf/form.js +1 -16
- package/dist/rhf/form.js.map +1 -1
- package/dist/rhf/line-items.d.ts +1 -1
- package/dist/rhf/line-items.js.map +1 -1
- package/dist/rhf/use-rhf-wizard-step.js.map +1 -1
- package/dist/rhf.js.map +1 -1
- package/dist/shell/option-switcher-menu.d.ts +5 -17
- package/dist/shell/option-switcher-menu.js +1 -3
- package/dist/shell/option-switcher-menu.js.map +1 -1
- package/dist/shell/role-switcher.d.ts +1 -4
- package/dist/shell/role-switcher.js +2 -3
- package/dist/shell/role-switcher.js.map +1 -1
- package/dist/shell/topbar-action-menu.d.ts +7 -19
- package/dist/shell/topbar-action-menu.js +1 -3
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell/topbar-controls.d.ts +3 -12
- package/dist/shell/topbar-controls.js +6 -9
- package/dist/shell/topbar-controls.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/viewport.d.ts +25 -2
- package/dist/testing/viewport.js +61 -10
- package/dist/testing/viewport.js.map +1 -1
- package/dist/theme/palette-presets.d.ts +0 -7
- package/dist/theme/palette-presets.js +0 -279
- package/dist/theme/palette-presets.js.map +1 -1
- package/dist/wizard/types.d.ts +0 -5
- package/dist/wizard/types.js +1 -5
- package/dist/wizard/types.js.map +1 -1
- package/package.json +9 -1
- package/src/billing/billing-banner.tsx +5 -2
- package/src/billing/plan-limit-notice.tsx +5 -2
- package/src/chart.ts +5 -3
- package/src/components/amount-input.tsx +2 -6
- package/src/components/calculator.tsx +2 -7
- package/src/components/chart-zoom.tsx +4 -47
- package/src/components/chip-input.tsx +0 -7
- package/src/components/combobox.tsx +1 -1
- package/src/components/copy-button.tsx +5 -1
- package/src/components/currency-option-list.tsx +8 -42
- package/src/components/danger-confirm.tsx +3 -3
- package/src/components/data-table-filter-popover.tsx +2 -1
- package/src/components/data-table-labels.ts +2 -84
- package/src/components/data-table-shared.tsx +55 -2
- package/src/components/data-table.tsx +29 -17
- package/src/components/dialog-frame.tsx +3 -1
- package/src/components/dropdown.tsx +42 -18
- package/src/components/entity-combobox.tsx +1 -1
- package/src/components/field-base.tsx +0 -11
- package/src/components/field-parts.tsx +5 -19
- package/src/components/field-strip.tsx +9 -25
- package/src/components/field-sync.tsx +0 -7
- package/src/components/field.tsx +4 -4
- package/src/components/full-bleed-dialog.tsx +4 -3
- package/src/components/hover-menu.tsx +12 -16
- package/src/components/inline-entity-combobox.tsx +1 -1
- package/src/components/modal.tsx +20 -4
- package/src/components/multi-select.tsx +13 -30
- package/src/components/number-input.tsx +3 -8
- package/src/components/popover.tsx +5 -3
- package/src/components/series-chart.tsx +1 -1
- package/src/components/server-wake.tsx +0 -6
- package/src/components/settings-fields.tsx +4 -2
- package/src/components/stat-tile.tsx +8 -2
- package/src/components/swipeable-row.tsx +15 -37
- package/src/components/tooltip.tsx +37 -6
- package/src/components/translation-review.tsx +25 -7
- package/src/components/use-table-state.ts +91 -10
- package/src/components/user-avatar.tsx +2 -2
- package/src/components/wizard-stepper.tsx +2 -6
- package/src/currencies.ts +70 -0
- package/src/demo/demo-banner.tsx +7 -2
- package/src/eslint/index.ts +161 -0
- package/src/eslint/role-utilities.generated.ts +146 -0
- package/src/eslint/role-utilities.ts +99 -0
- package/src/feedback/feedback-menu.tsx +2 -2
- package/src/feedback/feedback-thread.tsx +3 -8
- package/src/hooks/use-dismiss.ts +39 -4
- package/src/i18n/kit-labels.tsx +15 -5
- package/src/i18n/locales/fr.ts +3 -2
- package/src/i18n/locales/it.ts +3 -2
- package/src/index.ts +3 -1
- package/src/lib/refs.ts +22 -0
- package/src/rhf/fields.tsx +10 -10
- package/src/rhf/form-core.tsx +5 -4
- package/src/rhf/form.tsx +7 -43
- package/src/rhf/line-items.tsx +1 -1
- package/src/rhf/use-rhf-wizard-step.ts +4 -4
- package/src/rhf.ts +3 -2
- package/src/shell/option-switcher-menu.tsx +5 -22
- package/src/shell/role-switcher.tsx +2 -6
- package/src/shell/topbar-action-menu.tsx +7 -24
- package/src/shell/topbar-controls.tsx +6 -18
- package/src/testing/index.ts +3 -1
- package/src/testing/viewport.ts +125 -19
- package/src/theme/palette-presets.ts +7 -293
- package/src/wizard/types.ts +0 -8
|
@@ -64,284 +64,6 @@ const DEFAULT_PRESET = {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
const ALTERNATIVE_PRESETS = [
|
|
68
|
-
{
|
|
69
|
-
id: "warm-paper",
|
|
70
|
-
name: "Warm Paper",
|
|
71
|
-
blurb: "Cream paper \xB7 warm charcoal",
|
|
72
|
-
light: {
|
|
73
|
-
bgPage: "#ece5d6",
|
|
74
|
-
bgSurface: "#f5efe3",
|
|
75
|
-
bgSurface2: "#ece5d6",
|
|
76
|
-
border: "#e2dcce",
|
|
77
|
-
textPrimary: "#2b2622",
|
|
78
|
-
textSecondary: "#4f4a44",
|
|
79
|
-
textMuted: "#68625b",
|
|
80
|
-
brand: "#9a5b34",
|
|
81
|
-
brandHover: "#824827",
|
|
82
|
-
brandContrast: "#fdf8f2",
|
|
83
|
-
moneyIncome: "#0e7490",
|
|
84
|
-
moneyExpense: "#8f3f0a",
|
|
85
|
-
moneyNet: "#7c4dab",
|
|
86
|
-
moneyNeutral: "#6b6258",
|
|
87
|
-
chart: ["#332288", "#88ccee", "#44aa99", "#117733", "#999933", "#ddcc77", "#cc6677", "#882255", "#aa4499"],
|
|
88
|
-
heat: {
|
|
89
|
-
neutral: "#efe9dc",
|
|
90
|
-
under: "#0e7490",
|
|
91
|
-
over: "#b45309",
|
|
92
|
-
seqLow: "#fbeed2",
|
|
93
|
-
seqHigh: "#b45309",
|
|
94
|
-
empty: "rgba(148,163,184,0.14)"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
dark: {
|
|
98
|
-
bgPage: "#211e1a",
|
|
99
|
-
bgSurface: "#2a2622",
|
|
100
|
-
bgSurface2: "#322d27",
|
|
101
|
-
border: "#3d372f",
|
|
102
|
-
textPrimary: "#e8e2d6",
|
|
103
|
-
textSecondary: "#bfb9af",
|
|
104
|
-
textMuted: "#9e998f",
|
|
105
|
-
brand: "#e0986a",
|
|
106
|
-
brandHover: "#ecae85",
|
|
107
|
-
brandContrast: "#2a1c10",
|
|
108
|
-
moneyIncome: "#4dd4c4",
|
|
109
|
-
moneyExpense: "#fbbf3a",
|
|
110
|
-
moneyNet: "#bfa0e0",
|
|
111
|
-
moneyNeutral: "#a39a8c",
|
|
112
|
-
chart: ["#7e72d6", "#9fd8f2", "#5fc4b0", "#3fa45f", "#bfbf5e", "#e8dda0", "#e08c9a", "#cf6488", "#cc78be"],
|
|
113
|
-
heat: {
|
|
114
|
-
neutral: "#3a352e",
|
|
115
|
-
under: "#4dd4c4",
|
|
116
|
-
over: "#fbbf3a",
|
|
117
|
-
seqLow: "#2c2014",
|
|
118
|
-
seqHigh: "#fbbf3a",
|
|
119
|
-
empty: "rgba(148,163,184,0.10)"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: "nord-frost",
|
|
125
|
-
name: "Nord Frost",
|
|
126
|
-
blurb: "Cool snow \xB7 polar night",
|
|
127
|
-
light: {
|
|
128
|
-
bgPage: "#e2e7ef",
|
|
129
|
-
bgSurface: "#f0f3f8",
|
|
130
|
-
bgSurface2: "#e2e7ef",
|
|
131
|
-
border: "#d3dae6",
|
|
132
|
-
textPrimary: "#2e3440",
|
|
133
|
-
textSecondary: "#454b56",
|
|
134
|
-
textMuted: "#5e636e",
|
|
135
|
-
brand: "#3b6ea5",
|
|
136
|
-
brandHover: "#305a86",
|
|
137
|
-
brandContrast: "#ffffff",
|
|
138
|
-
moneyIncome: "#0f8060",
|
|
139
|
-
moneyExpense: "#b8431a",
|
|
140
|
-
moneyNet: "#6b4fa0",
|
|
141
|
-
moneyNeutral: "#5b6577",
|
|
142
|
-
chart: ["#3a6ea5", "#56b6c2", "#2f7d4f", "#cdb52f", "#d05f7a", "#9a3f93", "#4d4bbf", "#dd6a2c", "#7a8aa8"],
|
|
143
|
-
heat: {
|
|
144
|
-
neutral: "#e1e6ee",
|
|
145
|
-
under: "#0f8060",
|
|
146
|
-
over: "#b8431a",
|
|
147
|
-
seqLow: "#f0f3f7",
|
|
148
|
-
seqHigh: "#a14708",
|
|
149
|
-
empty: "rgba(148,163,184,0.14)"
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
dark: {
|
|
153
|
-
bgPage: "#242933",
|
|
154
|
-
bgSurface: "#2e3440",
|
|
155
|
-
bgSurface2: "#3b4252",
|
|
156
|
-
border: "#434c5e",
|
|
157
|
-
textPrimary: "#eceff4",
|
|
158
|
-
textSecondary: "#d4d7de",
|
|
159
|
-
textMuted: "#afb3bc",
|
|
160
|
-
brand: "#88c0d0",
|
|
161
|
-
brandHover: "#a3d4e0",
|
|
162
|
-
brandContrast: "#1c2027",
|
|
163
|
-
moneyIncome: "#4ecf9c",
|
|
164
|
-
moneyExpense: "#e8a24f",
|
|
165
|
-
moneyNet: "#caa0e0",
|
|
166
|
-
moneyNeutral: "#9aa5b8",
|
|
167
|
-
chart: ["#7fb4e6", "#5ec9d6", "#5cc483", "#dccb6b", "#e87e96", "#bd6fce", "#9389f2", "#ef8f4a", "#8693ad"],
|
|
168
|
-
heat: {
|
|
169
|
-
neutral: "#3b4252",
|
|
170
|
-
under: "#4ecf9c",
|
|
171
|
-
over: "#e8a24f",
|
|
172
|
-
seqLow: "#33373f",
|
|
173
|
-
seqHigh: "#e8a24f",
|
|
174
|
-
empty: "rgba(148,163,184,0.10)"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
id: "indigo-noir",
|
|
180
|
-
name: "Indigo Noir",
|
|
181
|
-
blurb: "Crisp light \xB7 deep indigo",
|
|
182
|
-
light: {
|
|
183
|
-
bgPage: "#e8eaf2",
|
|
184
|
-
bgSurface: "#f6f7fb",
|
|
185
|
-
bgSurface2: "#e8eaf2",
|
|
186
|
-
border: "#dadfeb",
|
|
187
|
-
textPrimary: "#1b1f2e",
|
|
188
|
-
textSecondary: "#494d5a",
|
|
189
|
-
textMuted: "#626572",
|
|
190
|
-
brand: "#4338ca",
|
|
191
|
-
brandHover: "#3730a3",
|
|
192
|
-
brandContrast: "#ffffff",
|
|
193
|
-
moneyIncome: "#0c6478",
|
|
194
|
-
moneyExpense: "#b45309",
|
|
195
|
-
moneyNet: "#7c3aed",
|
|
196
|
-
moneyNeutral: "#5b6478",
|
|
197
|
-
chart: ["#332288", "#88ccee", "#44aa99", "#117733", "#999933", "#ddcc77", "#cc6677", "#882255", "#aa4499"],
|
|
198
|
-
heat: {
|
|
199
|
-
neutral: "#eef1f7",
|
|
200
|
-
under: "#0c6478",
|
|
201
|
-
over: "#b45309",
|
|
202
|
-
seqLow: "#fdeed4",
|
|
203
|
-
seqHigh: "#b45309",
|
|
204
|
-
empty: "rgba(148,163,184,0.14)"
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
dark: {
|
|
208
|
-
bgPage: "#0e0f1c",
|
|
209
|
-
bgSurface: "#181a2c",
|
|
210
|
-
bgSurface2: "#21243a",
|
|
211
|
-
border: "#2e3252",
|
|
212
|
-
textPrimary: "#e6e8f4",
|
|
213
|
-
textSecondary: "#adafbe",
|
|
214
|
-
textMuted: "#8d90a0",
|
|
215
|
-
brand: "#8b93f8",
|
|
216
|
-
brandHover: "#aab1fb",
|
|
217
|
-
brandContrast: "#16182b",
|
|
218
|
-
moneyIncome: "#22c3b6",
|
|
219
|
-
// Kept byte-identical to DEFAULT_PRESET.dark, which IS this preset (dev#434).
|
|
220
|
-
moneyExpense: "#e4b035",
|
|
221
|
-
moneyNet: "#b39aef",
|
|
222
|
-
moneyNeutral: "#9aa1bd",
|
|
223
|
-
chart: ["#7e72d6", "#9fd8f2", "#5fc4b0", "#3fa45f", "#bfbf5e", "#e8dda0", "#e08c9a", "#c25a78", "#cc78be"],
|
|
224
|
-
heat: {
|
|
225
|
-
neutral: "#363a5a",
|
|
226
|
-
under: "#22c3b6",
|
|
227
|
-
over: "#fbbf24",
|
|
228
|
-
seqLow: "#3a2c14",
|
|
229
|
-
seqHigh: "#fbbf24",
|
|
230
|
-
empty: "rgba(148,163,184,0.10)"
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
id: "solar-dusk",
|
|
236
|
-
name: "Solar Dusk",
|
|
237
|
-
blurb: "Solarized warmth, easy on the eyes",
|
|
238
|
-
light: {
|
|
239
|
-
bgPage: "#ede3cf",
|
|
240
|
-
bgSurface: "#f6ecd9",
|
|
241
|
-
bgSurface2: "#ede3cf",
|
|
242
|
-
border: "#e2d6bd",
|
|
243
|
-
textPrimary: "#463f33",
|
|
244
|
-
textSecondary: "#50493c",
|
|
245
|
-
textMuted: "#696153",
|
|
246
|
-
brand: "#2c6979",
|
|
247
|
-
brandHover: "#1f515f",
|
|
248
|
-
brandContrast: "#ffffff",
|
|
249
|
-
moneyIncome: "#0b6650",
|
|
250
|
-
moneyExpense: "#905902",
|
|
251
|
-
moneyNet: "#7a4fa3",
|
|
252
|
-
moneyNeutral: "#6b6453",
|
|
253
|
-
chart: ["#332288", "#88ccee", "#44aa99", "#117733", "#999933", "#ddcc77", "#cc6677", "#882255", "#aa4499"],
|
|
254
|
-
heat: {
|
|
255
|
-
neutral: "#f1e7d2",
|
|
256
|
-
under: "#0b6650",
|
|
257
|
-
over: "#9c6418",
|
|
258
|
-
seqLow: "#f6ecd0",
|
|
259
|
-
seqHigh: "#9c6418",
|
|
260
|
-
empty: "rgba(148,163,184,0.14)"
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
dark: {
|
|
264
|
-
bgPage: "#0e1a1f",
|
|
265
|
-
bgSurface: "#15272e",
|
|
266
|
-
bgSurface2: "#1d333c",
|
|
267
|
-
border: "#2a4750",
|
|
268
|
-
textPrimary: "#d6cdb8",
|
|
269
|
-
textSecondary: "#c2bdab",
|
|
270
|
-
textMuted: "#9c9d91",
|
|
271
|
-
brand: "#5fb8cc",
|
|
272
|
-
brandHover: "#82cfe0",
|
|
273
|
-
brandContrast: "#0a161a",
|
|
274
|
-
moneyIncome: "#22b884",
|
|
275
|
-
moneyExpense: "#f0b94e",
|
|
276
|
-
moneyNet: "#bfa0e0",
|
|
277
|
-
moneyNeutral: "#9aa3a0",
|
|
278
|
-
chart: ["#7e72d6", "#9fd8f2", "#5fc4b0", "#3fa45f", "#bfbf5e", "#e8dda0", "#e08c9a", "#c25a78", "#c873c0"],
|
|
279
|
-
heat: {
|
|
280
|
-
neutral: "#26424b",
|
|
281
|
-
under: "#22b884",
|
|
282
|
-
over: "#f0b94e",
|
|
283
|
-
seqLow: "#1f3138",
|
|
284
|
-
seqHigh: "#f0b94e",
|
|
285
|
-
empty: "rgba(148,163,184,0.10)"
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
id: "zinc-mono",
|
|
291
|
-
name: "Zinc Mono",
|
|
292
|
-
blurb: "True-neutral chrome \xB7 data pops",
|
|
293
|
-
light: {
|
|
294
|
-
bgPage: "#ececec",
|
|
295
|
-
bgSurface: "#f7f7f7",
|
|
296
|
-
bgSurface2: "#ececec",
|
|
297
|
-
border: "#e4e4e7",
|
|
298
|
-
textPrimary: "#18181b",
|
|
299
|
-
textSecondary: "#4e4e50",
|
|
300
|
-
textMuted: "#676769",
|
|
301
|
-
brand: "#1d4ed8",
|
|
302
|
-
brandHover: "#1e40af",
|
|
303
|
-
brandContrast: "#ffffff",
|
|
304
|
-
moneyIncome: "#0e7490",
|
|
305
|
-
moneyExpense: "#cf4310",
|
|
306
|
-
moneyNet: "#7c3aed",
|
|
307
|
-
moneyNeutral: "#52525b",
|
|
308
|
-
chart: ["#332288", "#88ccee", "#44aa99", "#117733", "#999933", "#ddcc77", "#cc6677", "#882255", "#aa4499"],
|
|
309
|
-
heat: {
|
|
310
|
-
neutral: "#f4f4f5",
|
|
311
|
-
under: "#0e7490",
|
|
312
|
-
over: "#cf4310",
|
|
313
|
-
seqLow: "#fdeede",
|
|
314
|
-
seqHigh: "#cf4310",
|
|
315
|
-
empty: "rgba(148,163,184,0.14)"
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
dark: {
|
|
319
|
-
bgPage: "#09090b",
|
|
320
|
-
bgSurface: "#18181b",
|
|
321
|
-
bgSurface2: "#27272a",
|
|
322
|
-
border: "#3f3f46",
|
|
323
|
-
textPrimary: "#f4f4f5",
|
|
324
|
-
textSecondary: "#b2b2b3",
|
|
325
|
-
textMuted: "#929294",
|
|
326
|
-
brand: "#60a5fa",
|
|
327
|
-
brandHover: "#93c5fd",
|
|
328
|
-
brandContrast: "#0b1220",
|
|
329
|
-
moneyIncome: "#22d3ee",
|
|
330
|
-
moneyExpense: "#f97316",
|
|
331
|
-
moneyNet: "#c4b5fd",
|
|
332
|
-
moneyNeutral: "#a1a1aa",
|
|
333
|
-
chart: ["#7e72d6", "#9fd8f2", "#5fc4b0", "#3fa45f", "#bfbf5e", "#e8dda0", "#e08c9a", "#c25a78", "#cc78be"],
|
|
334
|
-
heat: {
|
|
335
|
-
neutral: "#3f3f46",
|
|
336
|
-
under: "#22d3ee",
|
|
337
|
-
over: "#f97316",
|
|
338
|
-
seqLow: "#3a2410",
|
|
339
|
-
seqHigh: "#f97316",
|
|
340
|
-
empty: "rgba(148,163,184,0.10)"
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
];
|
|
345
67
|
const IMPRINT_HUES_LIGHT = [
|
|
346
68
|
"#009E73",
|
|
347
69
|
// brand green — first series
|
|
@@ -634,7 +356,6 @@ function applyTokenSet(el, t, contrast = el.getAttribute("data-contrast") === "m
|
|
|
634
356
|
t.chart.forEach((c, i) => el.style.setProperty(`--chart-${i + 1}`, c));
|
|
635
357
|
}
|
|
636
358
|
export {
|
|
637
|
-
ALTERNATIVE_PRESETS,
|
|
638
359
|
DEFAULT_PRESET,
|
|
639
360
|
DERIVED_PRESETS,
|
|
640
361
|
IMPRINT_PRESET,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/theme/palette-presets.ts"],"sourcesContent":["// Appearance presets — the single source of truth for the \"palette switcher\"\n// (feedback #307). Each preset is a full set of design-token values for BOTH\n// light and dark, covering the page/surface backgrounds, the brand accent, the\n// semantic money trio and the 9-colour categorical chart palette, plus the\n// heatmap stops. A preset is applied at runtime by writing these as CSS custom\n// properties onto <html> (see palette-store.ts), which instantly re-skins every\n// token-driven surface and chart. The two heatmaps and the treemap interpolate\n// concrete hex in JS, so they read the same values from here via the hooks in\n// palette-store.\n//\n// The alternative presets below were designed + accessibility-vetted as a set\n// (each is CVD-safe across protan/deutan/tritan, money is never red/green, and\n// text/background contrast clears WCAG AA on both themes). To promote one to the\n// app-wide default, copy its values into the :root/.dark blocks in tokens.css\n// (the default preset here mirrors those exactly).\n\nimport type { HeatStops } from \"./chart-palette\";\nimport { contrastStep, rememberTokenSet } from \"./contrast-tokens\";\n\nexport interface TokenSet {\n // Backgrounds & chrome\n bgPage: string;\n bgSurface: string;\n bgSurface2: string;\n border: string;\n textPrimary: string;\n // The two quieter text roles. Derived per preset by blending `textPrimary` toward\n // that preset's own surfaces until the contrast against the WORST of bgPage /\n // bgSurface / bgSurface2 hits 7:1 and 4.8:1 — so both clear WCAG AA for normal text\n // (4.5:1) on every surface they can land on, and both inherit the preset's warmth\n // instead of importing a cool grey from Tailwind's palette.\n textSecondary: string;\n textMuted: string;\n // Interactive brand accent\n brand: string;\n brandHover: string;\n brandContrast: string;\n // Semantic money (never red/green — CVD-safe, paired with +/- cues elsewhere)\n moneyIncome: string;\n moneyExpense: string;\n moneyNet: string;\n moneyNeutral: string;\n // Categorical chart series (Paul Tol \"Muted\" by default — CVD-safe), exactly 9\n chart: string[];\n // Heatmap interpolation stops (variance diverging + spending sequential)\n heat: HeatStops;\n}\n\nexport interface PalettePreset {\n id: string;\n name: string;\n blurb: string;\n light: TokenSet;\n dark: TokenSet;\n}\n\n// The shipped default (feedback #328): SOLAR-DUSK warm light + INDIGO-NOIR deep\n// dark surfaces — the two curated presets the user picked per mode — but with a\n// SINGLE unified brand accent (indigo) across both modes rather than each\n// preset's own accent (the user asked for the brand accent to stay the same).\n// So the light block is Solar Dusk with its teal brand overridden to indigo, and\n// the dark block is Indigo Noir (already indigo). The money trio\n// (income/expense/net) drives the chart bars and stays palette-driven so those\n// semantic colours adapt to each mode's contrast (best practice — feedback #328).\nexport const DEFAULT_PRESET: PalettePreset = {\n id: \"default\",\n name: \"Default\",\n blurb: \"Solar-dusk light · indigo-noir dark\",\n light: {\n // Solar Dusk (light) surfaces, with the brand unified to indigo (see above).\n bgPage: \"#ede3cf\",\n bgSurface: \"#f6ecd9\",\n // The well is the page in light (0.33, k26): #f3ead6 stood 1.02:1 from the card it\n // is inset in. Every light preset does the same; see SURFACE_L in palette-derive.ts.\n bgSurface2: \"#ede3cf\",\n border: \"#e2d6bd\",\n textPrimary: \"#463f33\",\n textSecondary: \"#50493c\",\n textMuted: \"#696153\",\n brand: \"#4f46e5\",\n brandHover: \"#4338ca\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#0b6650\",\n moneyExpense: \"#905902\",\n moneyNet: \"#7a4fa3\",\n moneyNeutral: \"#6b6453\",\n chart: [\"#332288\", \"#88ccee\", \"#44aa99\", \"#117733\", \"#999933\", \"#ddcc77\", \"#cc6677\", \"#882255\", \"#aa4499\"],\n heat: {\n neutral: \"#f1e7d2\",\n under: \"#0b6650\",\n over: \"#9c6418\",\n seqLow: \"#f6ecd0\",\n seqHigh: \"#9c6418\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n // Indigo Noir (dark)\n bgPage: \"#0e0f1c\",\n bgSurface: \"#181a2c\",\n bgSurface2: \"#21243a\",\n border: \"#2e3252\",\n textPrimary: \"#e6e8f4\",\n textSecondary: \"#adafbe\",\n textMuted: \"#8d90a0\",\n brand: \"#8b93f8\",\n brandHover: \"#aab1fb\",\n brandContrast: \"#16182b\",\n moneyIncome: \"#22c3b6\",\n // Amber-400 (#fbbf24) sat at OKLab L 0.84 while every other dark token lives\n // at 0.68–0.74, so outflows outshouted the inflows they are paired with. Same\n // hue and chroma, pulled to L 0.785 (dev#434). The heat stops below keep the\n // brighter amber on purpose: a gradient endpoint is meant to be the loudest\n // thing in its scale, and it is a fill, not a figure.\n moneyExpense: \"#e4b035\",\n moneyNet: \"#b39aef\",\n moneyNeutral: \"#9aa1bd\",\n chart: [\"#7e72d6\", \"#9fd8f2\", \"#5fc4b0\", \"#3fa45f\", \"#bfbf5e\", \"#e8dda0\", \"#e08c9a\", \"#c25a78\", \"#cc78be\"],\n heat: {\n neutral: \"#363a5a\",\n under: \"#22c3b6\",\n over: \"#fbbf24\",\n seqLow: \"#3a2c14\",\n seqHigh: \"#fbbf24\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n};\n\n// Vetted alternatives to preview (CVD-safe, WCAG-AA on both themes).\n/**\n * @deprecated 0.34 — `PALETTES`, the presets `presetById` and the palette store know, or\n * `derivePalette` for a palette of the app's own; removed in 0.35 (refactor audit 2026-10,\n * API-6c). A reference bank only: `presetById` resolves none of these ids, and no app\n * imports it (deferred since the 2026-09-22 audit).\n */\nexport const ALTERNATIVE_PRESETS: PalettePreset[] = [\n {\n id: \"warm-paper\",\n name: \"Warm Paper\",\n blurb: \"Cream paper · warm charcoal\",\n light: {\n bgPage: \"#ece5d6\",\n bgSurface: \"#f5efe3\",\n bgSurface2: \"#ece5d6\",\n border: \"#e2dcce\",\n textPrimary: \"#2b2622\",\n textSecondary: \"#4f4a44\",\n textMuted: \"#68625b\",\n brand: \"#9a5b34\",\n brandHover: \"#824827\",\n brandContrast: \"#fdf8f2\",\n moneyIncome: \"#0e7490\",\n moneyExpense: \"#8f3f0a\",\n moneyNet: \"#7c4dab\",\n moneyNeutral: \"#6b6258\",\n chart: [\"#332288\", \"#88ccee\", \"#44aa99\", \"#117733\", \"#999933\", \"#ddcc77\", \"#cc6677\", \"#882255\", \"#aa4499\"],\n heat: {\n neutral: \"#efe9dc\",\n under: \"#0e7490\",\n over: \"#b45309\",\n seqLow: \"#fbeed2\",\n seqHigh: \"#b45309\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n bgPage: \"#211e1a\",\n bgSurface: \"#2a2622\",\n bgSurface2: \"#322d27\",\n border: \"#3d372f\",\n textPrimary: \"#e8e2d6\",\n textSecondary: \"#bfb9af\",\n textMuted: \"#9e998f\",\n brand: \"#e0986a\",\n brandHover: \"#ecae85\",\n brandContrast: \"#2a1c10\",\n moneyIncome: \"#4dd4c4\",\n moneyExpense: \"#fbbf3a\",\n moneyNet: \"#bfa0e0\",\n moneyNeutral: \"#a39a8c\",\n chart: [\"#7e72d6\", \"#9fd8f2\", \"#5fc4b0\", \"#3fa45f\", \"#bfbf5e\", \"#e8dda0\", \"#e08c9a\", \"#cf6488\", \"#cc78be\"],\n heat: {\n neutral: \"#3a352e\",\n under: \"#4dd4c4\",\n over: \"#fbbf3a\",\n seqLow: \"#2c2014\",\n seqHigh: \"#fbbf3a\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n },\n {\n id: \"nord-frost\",\n name: \"Nord Frost\",\n blurb: \"Cool snow · polar night\",\n light: {\n bgPage: \"#e2e7ef\",\n bgSurface: \"#f0f3f8\",\n bgSurface2: \"#e2e7ef\",\n border: \"#d3dae6\",\n textPrimary: \"#2e3440\",\n textSecondary: \"#454b56\",\n textMuted: \"#5e636e\",\n brand: \"#3b6ea5\",\n brandHover: \"#305a86\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#0f8060\",\n moneyExpense: \"#b8431a\",\n moneyNet: \"#6b4fa0\",\n moneyNeutral: \"#5b6577\",\n chart: [\"#3a6ea5\", \"#56b6c2\", \"#2f7d4f\", \"#cdb52f\", \"#d05f7a\", \"#9a3f93\", \"#4d4bbf\", \"#dd6a2c\", \"#7a8aa8\"],\n heat: {\n neutral: \"#e1e6ee\",\n under: \"#0f8060\",\n over: \"#b8431a\",\n seqLow: \"#f0f3f7\",\n seqHigh: \"#a14708\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n bgPage: \"#242933\",\n bgSurface: \"#2e3440\",\n bgSurface2: \"#3b4252\",\n border: \"#434c5e\",\n textPrimary: \"#eceff4\",\n textSecondary: \"#d4d7de\",\n textMuted: \"#afb3bc\",\n brand: \"#88c0d0\",\n brandHover: \"#a3d4e0\",\n brandContrast: \"#1c2027\",\n moneyIncome: \"#4ecf9c\",\n moneyExpense: \"#e8a24f\",\n moneyNet: \"#caa0e0\",\n moneyNeutral: \"#9aa5b8\",\n chart: [\"#7fb4e6\", \"#5ec9d6\", \"#5cc483\", \"#dccb6b\", \"#e87e96\", \"#bd6fce\", \"#9389f2\", \"#ef8f4a\", \"#8693ad\"],\n heat: {\n neutral: \"#3b4252\",\n under: \"#4ecf9c\",\n over: \"#e8a24f\",\n seqLow: \"#33373f\",\n seqHigh: \"#e8a24f\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n },\n {\n id: \"indigo-noir\",\n name: \"Indigo Noir\",\n blurb: \"Crisp light · deep indigo\",\n light: {\n bgPage: \"#e8eaf2\",\n bgSurface: \"#f6f7fb\",\n bgSurface2: \"#e8eaf2\",\n border: \"#dadfeb\",\n textPrimary: \"#1b1f2e\",\n textSecondary: \"#494d5a\",\n textMuted: \"#626572\",\n brand: \"#4338ca\",\n brandHover: \"#3730a3\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#0c6478\",\n moneyExpense: \"#b45309\",\n moneyNet: \"#7c3aed\",\n moneyNeutral: \"#5b6478\",\n chart: [\"#332288\", \"#88ccee\", \"#44aa99\", \"#117733\", \"#999933\", \"#ddcc77\", \"#cc6677\", \"#882255\", \"#aa4499\"],\n heat: {\n neutral: \"#eef1f7\",\n under: \"#0c6478\",\n over: \"#b45309\",\n seqLow: \"#fdeed4\",\n seqHigh: \"#b45309\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n bgPage: \"#0e0f1c\",\n bgSurface: \"#181a2c\",\n bgSurface2: \"#21243a\",\n border: \"#2e3252\",\n textPrimary: \"#e6e8f4\",\n textSecondary: \"#adafbe\",\n textMuted: \"#8d90a0\",\n brand: \"#8b93f8\",\n brandHover: \"#aab1fb\",\n brandContrast: \"#16182b\",\n moneyIncome: \"#22c3b6\",\n // Kept byte-identical to DEFAULT_PRESET.dark, which IS this preset (dev#434).\n moneyExpense: \"#e4b035\",\n moneyNet: \"#b39aef\",\n moneyNeutral: \"#9aa1bd\",\n chart: [\"#7e72d6\", \"#9fd8f2\", \"#5fc4b0\", \"#3fa45f\", \"#bfbf5e\", \"#e8dda0\", \"#e08c9a\", \"#c25a78\", \"#cc78be\"],\n heat: {\n neutral: \"#363a5a\",\n under: \"#22c3b6\",\n over: \"#fbbf24\",\n seqLow: \"#3a2c14\",\n seqHigh: \"#fbbf24\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n },\n {\n id: \"solar-dusk\",\n name: \"Solar Dusk\",\n blurb: \"Solarized warmth, easy on the eyes\",\n light: {\n bgPage: \"#ede3cf\",\n bgSurface: \"#f6ecd9\",\n bgSurface2: \"#ede3cf\",\n border: \"#e2d6bd\",\n textPrimary: \"#463f33\",\n textSecondary: \"#50493c\",\n textMuted: \"#696153\",\n brand: \"#2c6979\",\n brandHover: \"#1f515f\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#0b6650\",\n moneyExpense: \"#905902\",\n moneyNet: \"#7a4fa3\",\n moneyNeutral: \"#6b6453\",\n chart: [\"#332288\", \"#88ccee\", \"#44aa99\", \"#117733\", \"#999933\", \"#ddcc77\", \"#cc6677\", \"#882255\", \"#aa4499\"],\n heat: {\n neutral: \"#f1e7d2\",\n under: \"#0b6650\",\n over: \"#9c6418\",\n seqLow: \"#f6ecd0\",\n seqHigh: \"#9c6418\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n bgPage: \"#0e1a1f\",\n bgSurface: \"#15272e\",\n bgSurface2: \"#1d333c\",\n border: \"#2a4750\",\n textPrimary: \"#d6cdb8\",\n textSecondary: \"#c2bdab\",\n textMuted: \"#9c9d91\",\n brand: \"#5fb8cc\",\n brandHover: \"#82cfe0\",\n brandContrast: \"#0a161a\",\n moneyIncome: \"#22b884\",\n moneyExpense: \"#f0b94e\",\n moneyNet: \"#bfa0e0\",\n moneyNeutral: \"#9aa3a0\",\n chart: [\"#7e72d6\", \"#9fd8f2\", \"#5fc4b0\", \"#3fa45f\", \"#bfbf5e\", \"#e8dda0\", \"#e08c9a\", \"#c25a78\", \"#c873c0\"],\n heat: {\n neutral: \"#26424b\",\n under: \"#22b884\",\n over: \"#f0b94e\",\n seqLow: \"#1f3138\",\n seqHigh: \"#f0b94e\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n },\n {\n id: \"zinc-mono\",\n name: \"Zinc Mono\",\n blurb: \"True-neutral chrome · data pops\",\n light: {\n bgPage: \"#ececec\",\n bgSurface: \"#f7f7f7\",\n bgSurface2: \"#ececec\",\n border: \"#e4e4e7\",\n textPrimary: \"#18181b\",\n textSecondary: \"#4e4e50\",\n textMuted: \"#676769\",\n brand: \"#1d4ed8\",\n brandHover: \"#1e40af\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#0e7490\",\n moneyExpense: \"#cf4310\",\n moneyNet: \"#7c3aed\",\n moneyNeutral: \"#52525b\",\n chart: [\"#332288\", \"#88ccee\", \"#44aa99\", \"#117733\", \"#999933\", \"#ddcc77\", \"#cc6677\", \"#882255\", \"#aa4499\"],\n heat: {\n neutral: \"#f4f4f5\",\n under: \"#0e7490\",\n over: \"#cf4310\",\n seqLow: \"#fdeede\",\n seqHigh: \"#cf4310\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n bgPage: \"#09090b\",\n bgSurface: \"#18181b\",\n bgSurface2: \"#27272a\",\n border: \"#3f3f46\",\n textPrimary: \"#f4f4f5\",\n textSecondary: \"#b2b2b3\",\n textMuted: \"#929294\",\n brand: \"#60a5fa\",\n brandHover: \"#93c5fd\",\n brandContrast: \"#0b1220\",\n moneyIncome: \"#22d3ee\",\n moneyExpense: \"#f97316\",\n moneyNet: \"#c4b5fd\",\n moneyNeutral: \"#a1a1aa\",\n chart: [\"#7e72d6\", \"#9fd8f2\", \"#5fc4b0\", \"#3fa45f\", \"#bfbf5e\", \"#e8dda0\", \"#e08c9a\", \"#c25a78\", \"#cc78be\"],\n heat: {\n neutral: \"#3f3f46\",\n under: \"#22d3ee\",\n over: \"#f97316\",\n seqLow: \"#3a2410\",\n seqHigh: \"#f97316\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n },\n];\n\n// ── \"Imprint\" chart hues (feedback #119) ──────────────────────────────────────\n// anyplot's categorical palette (https://anyplot.ai/palette), by a colleague of\n// Marcel's. 8 hues + an amber semantic anchor, derived from Wong 2011 by a\n// Petroff-style max-min ΔE search in CAM02-UCS with Machado 2009 CVD simulation —\n// the same lineage as our default Paul Tol \"Muted\", one generation on, and tuned\n// for exactly the warm cream paper our light theme uses.\n//\n// This preset is DEFAULT_PRESET with ONLY the 9 categorical chart hues swapped;\n// surfaces, brand and the semantic money trio stay put, because those were their\n// own deliberate decisions (#307/#328) and are not what the palette is for. The\n// heatmap stops likewise stay teal/amber: they encode under/over, and imprint's\n// own diverging ramp is red↔blue, which would fight the money semantics.\n//\n// Measured on our surfaces (CIEDE2000, Machado severity-100, 8 like-for-like\n// slots on the cream light surface #f6ecd9) — neither palette dominates:\n// Paul Tol Muted min-contrast 1.38 · worst-CVD ΔE00 11.8 · normal ΔE00 16.1\n// imprint min-contrast 1.95 · worst-CVD ΔE00 7.2 · normal ΔE00 22.2\n// i.e. imprint is punchier and has no near-invisible pale slot (Tol's #88ccee\n// sits at 1.5:1 on cream), while Tol separates better under colour-vision\n// deficiency. So this ships as a CHOICE, not as a new default.\n//\n// The dark set keeps imprint's hues verbatim except matte-red and rose, whose\n// lightness is lifted (oklch L 0.50→0.55) because verbatim they land at 2.67:1\n// and 2.76:1 on our deep-indigo dark surface — under WCAG 2.1 SC 1.4.11's 3:1\n// non-text minimum. Lifted they clear it at 3.30:1 / 3.28:1. anyplot documents\n// the same shortfall on their own dark ground and answers it with a stroke halo;\n// lifting keeps the fix in the token layer instead of every chart component.\nconst IMPRINT_HUES_LIGHT = [\n \"#009E73\", // brand green — first series\n \"#C475FD\", // lavender — creative\n \"#4467A3\", // blue — cool / info\n \"#BD8233\", // ochre — earth / commodity\n \"#AE3030\", // matte red — bad / loss / error\n \"#2ABCCD\", // cyan — sky / tech-cool\n \"#954477\", // rose — wellness / health\n \"#99B314\", // lime — growth / nature\n \"#DDCC77\", // amber — anyplot's semantic anchor, used here as slot 9\n];\nconst IMPRINT_HUES_DARK = [\n \"#009E73\",\n \"#C475FD\",\n \"#4467A3\",\n \"#BD8233\",\n \"#BF413E\", // matte red, L-lifted for our dark surface\n \"#2ABCCD\",\n \"#A25083\", // rose, L-lifted for our dark surface\n \"#99B314\",\n \"#DDCC77\",\n];\n\nexport const IMPRINT_PRESET: PalettePreset = {\n id: \"imprint\",\n name: \"Imprint\",\n blurb: \"Colourblind-safe chart hues by anyplot.ai\",\n light: { ...DEFAULT_PRESET.light, chart: IMPRINT_HUES_LIGHT },\n dark: { ...DEFAULT_PRESET.dark, chart: IMPRINT_HUES_DARK },\n};\n\n// The full-theme switcher from #307 stayed retired (feedback #328) — the default\n// is still the single source of truth for surfaces, brand and money, and\n// ALTERNATIVE_PRESETS above remains a reference bank only. What IS selectable is\n// the categorical chart ramp (feedback #119), so these two presets are the live\n// set; presetById falls back to the default for any stale persisted id.\n/**\n * The categorical chart ramp, shared by every derived preset below.\n *\n * Paul Tol's \"Muted\" set, unchanged, and deliberately NOT re-derived per preset. A\n * categorical ramp solves a different problem from a UI palette — separability among\n * nine unknown siblings, rather than contrast against one known surface — and a set\n * optimised against real dichromat confusion lines beats one spaced evenly by formula.\n * `auditChartRamp` in palette-derive.ts measures it: 0.059 minimum separation in the\n * light variant, which is the number MIN_SEPARATION was calibrated under.\n *\n * It pays for that in contrast: four of the nine light hues sit below the 3:1 WCAG\n * 1.4.11 asks of a filled shape. That is not fixable by darkening them — see\n * SINGLE_LIGHTNESS_MAX_SERIES — so a chart with more than four series must carry a\n * second channel (a direct label, a pattern, a legend adjacent to the mark).\n */\nconst PAUL_TOL = {\n light: DEFAULT_PRESET.light.chart,\n dark: DEFAULT_PRESET.dark.chart,\n} as const;\n\n/**\n * Presets DERIVED rather than picked, by `derivePalette` from one brand colour each.\n *\n * Every text role here was solved to a contrast target against the worst of the three\n * surfaces it can land on, every semantic colour against both the page and its own badge\n * tint, and the whole set is re-checked by `__tests__/palette-audit.test.ts` (\"derived\n * presets\") — which re-runs the deriver and fails if these committed values drift from\n * what it now produces.\n *\n * They are committed rather than derived at import because deriving eight token sets\n * costs ~34ms, and charging every consumer that at startup for palettes most of them\n * will never select is the wrong trade. The test is what keeps the two in agreement.\n *\n * Regenerated in 0.34 (round 0.34 BUG-8): the solve now measures the hex it ships rather\n * than the float before rounding, and the audit no longer lets a hex pair pass 0.05 under\n * its threshold. 52 values moved one step (66 counting the heat stops that repeat them);\n * Contrast's neutrals lost half their slate tint, its brand having half the chroma at\n * which the neutrals carry a hue in full.\n */\nexport const DERIVED_PRESETS: PalettePreset[] = [\n {\n id: \"ink\",\n name: \"Ink\",\n blurb: \"Cool blue-grey ground · solved for AAA body text\",\n light: {\n bgPage: \"#dce2ef\",\n bgSurface: \"#e6edfa\",\n bgSurface2: \"#dce2ef\",\n border: \"#b0bace\",\n textPrimary: \"#2e3139\",\n textSecondary: \"#454850\",\n textMuted: \"#5f636c\",\n brand: \"#2f5fd0\",\n brandHover: \"#1f4cbc\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00725f\",\n moneyExpense: \"#8e5900\",\n moneyNet: \"#7356a2\",\n moneyNeutral: \"#61646c\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#dce2ef\",\n under: \"#00725f\",\n over: \"#8e5900\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8e5900\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#090d15\",\n bgSurface: \"#131720\",\n bgSurface2: \"#1d212b\",\n border: \"#363e4f\",\n textPrimary: \"#c8ccd6\",\n textSecondary: \"#a7abb5\",\n textMuted: \"#858a92\",\n brand: \"#3466d7\",\n brandHover: \"#2353c3\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009a80\",\n moneyExpense: \"#b77b29\",\n moneyNet: \"#9679c9\",\n moneyNeutral: \"#a1a5ac\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#1d212b\",\n under: \"#009a80\",\n over: \"#b77b29\",\n seqLow: \"#331f05\",\n seqHigh: \"#b77b29\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n {\n id: \"moss\",\n name: \"Moss\",\n blurb: \"Green ground · solved for AAA body text\",\n light: {\n bgPage: \"#d8e6dd\",\n bgSurface: \"#e3f1e8\",\n bgSurface2: \"#d8e6dd\",\n border: \"#abbfb2\",\n textPrimary: \"#2c332e\",\n textSecondary: \"#424b45\",\n textMuted: \"#5d6660\",\n brand: \"#2f7a52\",\n brandHover: \"#196842\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00725f\",\n moneyExpense: \"#8e5900\",\n moneyNet: \"#7356a2\",\n moneyNeutral: \"#5f6662\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#d8e6dd\",\n under: \"#00725f\",\n over: \"#8e5900\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8e5900\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#060f0a\",\n bgSurface: \"#101a14\",\n bgSurface2: \"#1a241e\",\n border: \"#314337\",\n textPrimary: \"#c6cfc9\",\n textSecondary: \"#a5aea8\",\n textMuted: \"#838c86\",\n brand: \"#317b53\",\n brandHover: \"#1c6943\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009a80\",\n moneyExpense: \"#b87c2a\",\n moneyNet: \"#977ac9\",\n moneyNeutral: \"#9fa7a2\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#1a241e\",\n under: \"#009a80\",\n over: \"#b87c2a\",\n seqLow: \"#331f05\",\n seqHigh: \"#b87c2a\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n {\n id: \"plum\",\n name: \"Plum\",\n blurb: \"Violet ground · solved for AAA body text\",\n light: {\n bgPage: \"#e7dfea\",\n bgSurface: \"#f2e9f5\",\n bgSurface2: \"#e7dfea\",\n border: \"#c2b5c6\",\n textPrimary: \"#352f36\",\n textSecondary: \"#4c464e\",\n textMuted: \"#676169\",\n brand: \"#7b3f8f\",\n brandHover: \"#692d7d\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00715e\",\n moneyExpense: \"#8d5800\",\n moneyNet: \"#7355a2\",\n moneyNeutral: \"#676269\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#e7dfea\",\n under: \"#00715e\",\n over: \"#8d5800\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8d5800\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#100b12\",\n bgSurface: \"#1b151d\",\n bgSurface2: \"#251f27\",\n border: \"#453b48\",\n textPrimary: \"#d0cad2\",\n textSecondary: \"#afa9b1\",\n textMuted: \"#8d8790\",\n brand: \"#9154a6\",\n brandHover: \"#7f4293\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009980\",\n moneyExpense: \"#b77b29\",\n moneyNet: \"#9679c9\",\n moneyNeutral: \"#a8a2aa\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#251f27\",\n under: \"#009980\",\n over: \"#b77b29\",\n seqLow: \"#331f05\",\n seqHigh: \"#b77b29\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n {\n id: \"contrast\",\n name: \"High contrast\",\n blurb: \"Near-neutral ground · text solved to 13:1 / 8.5:1 / 5.5:1\",\n light: {\n bgPage: \"#e1e2e3\",\n bgSurface: \"#ecedee\",\n bgSurface2: \"#e1e2e3\",\n border: \"#b8babc\",\n textPrimary: \"#1b1d21\",\n textSecondary: \"#3a3c40\",\n textMuted: \"#55585c\",\n brand: \"#1f2937\",\n brandHover: \"#111b28\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00715e\",\n moneyExpense: \"#8d5800\",\n moneyNet: \"#7255a1\",\n moneyNeutral: \"#616467\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#e1e2e3\",\n under: \"#00715e\",\n over: \"#8d5800\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8d5800\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#0c0d0e\",\n bgSurface: \"#171718\",\n bgSurface2: \"#212122\",\n border: \"#3d3e3f\",\n textPrimary: \"#e4e8ec\",\n textSecondary: \"#b9bdc1\",\n textMuted: \"#95979c\",\n brand: \"#556c8e\",\n brandHover: \"#455b7c\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009a80\",\n moneyExpense: \"#b77b29\",\n moneyNet: \"#9679c9\",\n moneyNeutral: \"#a2a5a8\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#212122\",\n under: \"#009a80\",\n over: \"#b77b29\",\n seqLow: \"#331f05\",\n seqHigh: \"#b77b29\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n];\n\nexport const PALETTES: PalettePreset[] = [DEFAULT_PRESET, IMPRINT_PRESET, ...DERIVED_PRESETS];\n\nexport function presetById(id: string): PalettePreset {\n return PALETTES.find((p) => p.id === id) ?? DEFAULT_PRESET;\n}\n\n/**\n * Write a token set onto an element's inline style as CSS custom properties.\n *\n * This is the only writer, and there is no un-writer: `presetById` falls back to\n * `DEFAULT_PRESET` and this then writes the full set, so returning to the default\n * APPLIES it rather than clearing anything. A `clearTokenSet` and the hand-kept\n * 24-name `TOKEN_VARS` list it looped over used to live here, both exported, both\n * called by nobody in either consumer — a second copy of these property names with\n * nothing comparing the two, so adding a token here and forgetting it there would\n * have been silent and only a dead function would have noticed. The list is gone;\n * the test beside this asserts instead that every field of a `TokenSet` reaches the\n * element, which is what that list was standing in for.\n *\n * **More contrast (0.32, docs/text-size-harmonization.md §5, §10.5).** With `contrast`\n * the text and border tokens are written one step stronger, and `--text-placeholder` —\n * otherwise derived in tokens.css — is written inline too; without it that inline\n * placeholder is removed again, so the stylesheet's formula applies. The step is made\n * HERE because these tokens are inline: no `[data-contrast=more]` rule could beat them.\n *\n * `contrast` defaults to the element's own `data-contrast=\"more\"`, which the contrast\n * layer (`applyContrast`, `useApplyContrast`) sets first. That is how the palette and the\n * contrast cooperate without knowing each other: a palette change re-applies through\n * here and keeps the contrast, and a contrast change re-applies the set remembered here.\n */\nexport function applyTokenSet(\n el: HTMLElement,\n t: TokenSet,\n contrast: boolean = el.getAttribute(\"data-contrast\") === \"more\",\n): void {\n rememberTokenSet(el, t);\n const step = contrast ? contrastStep(t) : null;\n el.style.setProperty(\"--bg-page\", t.bgPage);\n el.style.setProperty(\"--bg-surface\", t.bgSurface);\n el.style.setProperty(\"--bg-surface-2\", t.bgSurface2);\n el.style.setProperty(\"--border\", step?.border ?? t.border);\n el.style.setProperty(\"--text-primary\", t.textPrimary);\n el.style.setProperty(\"--text-secondary\", step?.textSecondary ?? t.textSecondary);\n el.style.setProperty(\"--text-muted\", step?.textMuted ?? t.textMuted);\n if (step) el.style.setProperty(\"--text-placeholder\", step.textPlaceholder);\n else el.style.removeProperty(\"--text-placeholder\");\n el.style.setProperty(\"--brand\", t.brand);\n el.style.setProperty(\"--brand-hover\", t.brandHover);\n el.style.setProperty(\"--brand-contrast\", t.brandContrast);\n el.style.setProperty(\"--money-income\", t.moneyIncome);\n el.style.setProperty(\"--money-expense\", t.moneyExpense);\n el.style.setProperty(\"--money-net\", t.moneyNet);\n el.style.setProperty(\"--money-neutral\", t.moneyNeutral);\n t.chart.forEach((c, i) => el.style.setProperty(`--chart-${i + 1}`, c));\n}\n"],"mappings":";AAiBA,SAAS,cAAc,wBAAwB;AA+CxC,MAAM,iBAAgC;AAAA,EAC3C,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA;AAAA,IAEL,QAAQ;AAAA,IACR,WAAW;AAAA;AAAA;AAAA,IAGX,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,eAAe;AAAA,IACf,WAAW;AAAA,IACX,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,UAAU;AAAA,IACV,cAAc;AAAA,IACd,OAAO,CAAC,WAAW,WAAW,WAAW,WAAW,WAAW,WAAW,WAAW,WAAW,SAAS;AAAA,IACzG,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,OAAO;AAAA,MACP,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,MAAM;AAAA;AAAA,IAEJ,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,eAAe;AAAA,IACf,WAAW;AAAA,IACX,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,aAAa;AAAA;AA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,WAAW,IAA2B;AACpD,SAAO,SAAS,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK;AAC9C;AA0BO,SAAS,cACd,IACA,GACA,WAAoB,GAAG,aAAa,eAAe,MAAM,QACnD;AACN,mBAAiB,IAAI,CAAC;AACtB,QAAM,OAAO,WAAW,aAAa,CAAC,IAAI;AAC1C,KAAG,MAAM,YAAY,aAAa,EAAE,MAAM;AAC1C,KAAG,MAAM,YAAY,gBAAgB,EAAE,SAAS;AAChD,KAAG,MAAM,YAAY,kBAAkB,EAAE,UAAU;AACnD,KAAG,MAAM,YAAY,YAAY,MAAM,UAAU,EAAE,MAAM;AACzD,KAAG,MAAM,YAAY,kBAAkB,EAAE,WAAW;AACpD,KAAG,MAAM,YAAY,oBAAoB,MAAM,iBAAiB,EAAE,aAAa;AAC/E,KAAG,MAAM,YAAY,gBAAgB,MAAM,aAAa,EAAE,SAAS;AACnE,MAAI,KAAM,IAAG,MAAM,YAAY,sBAAsB,KAAK,eAAe;AAAA,MACpE,IAAG,MAAM,eAAe,oBAAoB;AACjD,KAAG,MAAM,YAAY,WAAW,EAAE,KAAK;AACvC,KAAG,MAAM,YAAY,iBAAiB,EAAE,UAAU;AAClD,KAAG,MAAM,YAAY,oBAAoB,EAAE,aAAa;AACxD,KAAG,MAAM,YAAY,kBAAkB,EAAE,WAAW;AACpD,KAAG,MAAM,YAAY,mBAAmB,EAAE,YAAY;AACtD,KAAG,MAAM,YAAY,eAAe,EAAE,QAAQ;AAC9C,KAAG,MAAM,YAAY,mBAAmB,EAAE,YAAY;AACtD,IAAE,MAAM,QAAQ,CAAC,GAAG,MAAM,GAAG,MAAM,YAAY,WAAW,IAAI,CAAC,IAAI,CAAC,CAAC;AACvE;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/theme/palette-presets.ts"],"sourcesContent":["// Appearance presets — the single source of truth for the \"palette switcher\"\n// (feedback #307). Each preset is a full set of design-token values for BOTH\n// light and dark, covering the page/surface backgrounds, the brand accent, the\n// semantic money trio and the 9-colour categorical chart palette, plus the\n// heatmap stops. A preset is applied at runtime by writing these as CSS custom\n// properties onto <html> (see palette-store.ts), which instantly re-skins every\n// token-driven surface and chart. The two heatmaps and the treemap interpolate\n// concrete hex in JS, so they read the same values from here via the hooks in\n// palette-store.\n//\n// The default preset here mirrors the :root/.dark blocks in tokens.css exactly. The\n// five hand-picked alternatives of #307 (`ALTERNATIVE_PRESETS`, a reference bank that\n// `presetById` never resolved) were removed in 0.35 (refactor audit 2026-10, API-6c;\n// deprecated in 0.34): `PALETTES` is what an app offers, and `derivePalette` makes a\n// palette of its own.\n\nimport type { HeatStops } from \"./chart-palette\";\nimport { contrastStep, rememberTokenSet } from \"./contrast-tokens\";\n\nexport interface TokenSet {\n // Backgrounds & chrome\n bgPage: string;\n bgSurface: string;\n bgSurface2: string;\n border: string;\n textPrimary: string;\n // The two quieter text roles. Derived per preset by blending `textPrimary` toward\n // that preset's own surfaces until the contrast against the WORST of bgPage /\n // bgSurface / bgSurface2 hits 7:1 and 4.8:1 — so both clear WCAG AA for normal text\n // (4.5:1) on every surface they can land on, and both inherit the preset's warmth\n // instead of importing a cool grey from Tailwind's palette.\n textSecondary: string;\n textMuted: string;\n // Interactive brand accent\n brand: string;\n brandHover: string;\n brandContrast: string;\n // Semantic money (never red/green — CVD-safe, paired with +/- cues elsewhere)\n moneyIncome: string;\n moneyExpense: string;\n moneyNet: string;\n moneyNeutral: string;\n // Categorical chart series (Paul Tol \"Muted\" by default — CVD-safe), exactly 9\n chart: string[];\n // Heatmap interpolation stops (variance diverging + spending sequential)\n heat: HeatStops;\n}\n\nexport interface PalettePreset {\n id: string;\n name: string;\n blurb: string;\n light: TokenSet;\n dark: TokenSet;\n}\n\n// The shipped default (feedback #328): SOLAR-DUSK warm light + INDIGO-NOIR deep\n// dark surfaces — the two curated presets the user picked per mode — but with a\n// SINGLE unified brand accent (indigo) across both modes rather than each\n// preset's own accent (the user asked for the brand accent to stay the same).\n// So the light block is Solar Dusk with its teal brand overridden to indigo, and\n// the dark block is Indigo Noir (already indigo). The money trio\n// (income/expense/net) drives the chart bars and stays palette-driven so those\n// semantic colours adapt to each mode's contrast (best practice — feedback #328).\nexport const DEFAULT_PRESET: PalettePreset = {\n id: \"default\",\n name: \"Default\",\n blurb: \"Solar-dusk light · indigo-noir dark\",\n light: {\n // Solar Dusk (light) surfaces, with the brand unified to indigo (see above).\n bgPage: \"#ede3cf\",\n bgSurface: \"#f6ecd9\",\n // The well is the page in light (0.33, k26): #f3ead6 stood 1.02:1 from the card it\n // is inset in. Every light preset does the same; see SURFACE_L in palette-derive.ts.\n bgSurface2: \"#ede3cf\",\n border: \"#e2d6bd\",\n textPrimary: \"#463f33\",\n textSecondary: \"#50493c\",\n textMuted: \"#696153\",\n brand: \"#4f46e5\",\n brandHover: \"#4338ca\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#0b6650\",\n moneyExpense: \"#905902\",\n moneyNet: \"#7a4fa3\",\n moneyNeutral: \"#6b6453\",\n chart: [\"#332288\", \"#88ccee\", \"#44aa99\", \"#117733\", \"#999933\", \"#ddcc77\", \"#cc6677\", \"#882255\", \"#aa4499\"],\n heat: {\n neutral: \"#f1e7d2\",\n under: \"#0b6650\",\n over: \"#9c6418\",\n seqLow: \"#f6ecd0\",\n seqHigh: \"#9c6418\",\n empty: \"rgba(148,163,184,0.14)\",\n },\n },\n dark: {\n // Indigo Noir (dark)\n bgPage: \"#0e0f1c\",\n bgSurface: \"#181a2c\",\n bgSurface2: \"#21243a\",\n border: \"#2e3252\",\n textPrimary: \"#e6e8f4\",\n textSecondary: \"#adafbe\",\n textMuted: \"#8d90a0\",\n brand: \"#8b93f8\",\n brandHover: \"#aab1fb\",\n brandContrast: \"#16182b\",\n moneyIncome: \"#22c3b6\",\n // Amber-400 (#fbbf24) sat at OKLab L 0.84 while every other dark token lives\n // at 0.68–0.74, so outflows outshouted the inflows they are paired with. Same\n // hue and chroma, pulled to L 0.785 (dev#434). The heat stops below keep the\n // brighter amber on purpose: a gradient endpoint is meant to be the loudest\n // thing in its scale, and it is a fill, not a figure.\n moneyExpense: \"#e4b035\",\n moneyNet: \"#b39aef\",\n moneyNeutral: \"#9aa1bd\",\n chart: [\"#7e72d6\", \"#9fd8f2\", \"#5fc4b0\", \"#3fa45f\", \"#bfbf5e\", \"#e8dda0\", \"#e08c9a\", \"#c25a78\", \"#cc78be\"],\n heat: {\n neutral: \"#363a5a\",\n under: \"#22c3b6\",\n over: \"#fbbf24\",\n seqLow: \"#3a2c14\",\n seqHigh: \"#fbbf24\",\n empty: \"rgba(148,163,184,0.10)\",\n },\n },\n};\n\n// ── \"Imprint\" chart hues (feedback #119) ──────────────────────────────────────\n// anyplot's categorical palette (https://anyplot.ai/palette), by a colleague of\n// Marcel's. 8 hues + an amber semantic anchor, derived from Wong 2011 by a\n// Petroff-style max-min ΔE search in CAM02-UCS with Machado 2009 CVD simulation —\n// the same lineage as our default Paul Tol \"Muted\", one generation on, and tuned\n// for exactly the warm cream paper our light theme uses.\n//\n// This preset is DEFAULT_PRESET with ONLY the 9 categorical chart hues swapped;\n// surfaces, brand and the semantic money trio stay put, because those were their\n// own deliberate decisions (#307/#328) and are not what the palette is for. The\n// heatmap stops likewise stay teal/amber: they encode under/over, and imprint's\n// own diverging ramp is red↔blue, which would fight the money semantics.\n//\n// Measured on our surfaces (CIEDE2000, Machado severity-100, 8 like-for-like\n// slots on the cream light surface #f6ecd9) — neither palette dominates:\n// Paul Tol Muted min-contrast 1.38 · worst-CVD ΔE00 11.8 · normal ΔE00 16.1\n// imprint min-contrast 1.95 · worst-CVD ΔE00 7.2 · normal ΔE00 22.2\n// i.e. imprint is punchier and has no near-invisible pale slot (Tol's #88ccee\n// sits at 1.5:1 on cream), while Tol separates better under colour-vision\n// deficiency. So this ships as a CHOICE, not as a new default.\n//\n// The dark set keeps imprint's hues verbatim except matte-red and rose, whose\n// lightness is lifted (oklch L 0.50→0.55) because verbatim they land at 2.67:1\n// and 2.76:1 on our deep-indigo dark surface — under WCAG 2.1 SC 1.4.11's 3:1\n// non-text minimum. Lifted they clear it at 3.30:1 / 3.28:1. anyplot documents\n// the same shortfall on their own dark ground and answers it with a stroke halo;\n// lifting keeps the fix in the token layer instead of every chart component.\nconst IMPRINT_HUES_LIGHT = [\n \"#009E73\", // brand green — first series\n \"#C475FD\", // lavender — creative\n \"#4467A3\", // blue — cool / info\n \"#BD8233\", // ochre — earth / commodity\n \"#AE3030\", // matte red — bad / loss / error\n \"#2ABCCD\", // cyan — sky / tech-cool\n \"#954477\", // rose — wellness / health\n \"#99B314\", // lime — growth / nature\n \"#DDCC77\", // amber — anyplot's semantic anchor, used here as slot 9\n];\nconst IMPRINT_HUES_DARK = [\n \"#009E73\",\n \"#C475FD\",\n \"#4467A3\",\n \"#BD8233\",\n \"#BF413E\", // matte red, L-lifted for our dark surface\n \"#2ABCCD\",\n \"#A25083\", // rose, L-lifted for our dark surface\n \"#99B314\",\n \"#DDCC77\",\n];\n\nexport const IMPRINT_PRESET: PalettePreset = {\n id: \"imprint\",\n name: \"Imprint\",\n blurb: \"Colourblind-safe chart hues by anyplot.ai\",\n light: { ...DEFAULT_PRESET.light, chart: IMPRINT_HUES_LIGHT },\n dark: { ...DEFAULT_PRESET.dark, chart: IMPRINT_HUES_DARK },\n};\n\n// The full-theme switcher from #307 stayed retired (feedback #328) — the default\n// is still the single source of truth for surfaces, brand and money (its five\n// alternatives are gone, see the header). What IS selectable is\n// the categorical chart ramp (feedback #119), so these two presets are the live\n// set; presetById falls back to the default for any stale persisted id.\n/**\n * The categorical chart ramp, shared by every derived preset below.\n *\n * Paul Tol's \"Muted\" set, unchanged, and deliberately NOT re-derived per preset. A\n * categorical ramp solves a different problem from a UI palette — separability among\n * nine unknown siblings, rather than contrast against one known surface — and a set\n * optimised against real dichromat confusion lines beats one spaced evenly by formula.\n * `auditChartRamp` in palette-derive.ts measures it: 0.059 minimum separation in the\n * light variant, which is the number MIN_SEPARATION was calibrated under.\n *\n * It pays for that in contrast: four of the nine light hues sit below the 3:1 WCAG\n * 1.4.11 asks of a filled shape. That is not fixable by darkening them — see\n * SINGLE_LIGHTNESS_MAX_SERIES — so a chart with more than four series must carry a\n * second channel (a direct label, a pattern, a legend adjacent to the mark).\n */\nconst PAUL_TOL = {\n light: DEFAULT_PRESET.light.chart,\n dark: DEFAULT_PRESET.dark.chart,\n} as const;\n\n/**\n * Presets DERIVED rather than picked, by `derivePalette` from one brand colour each.\n *\n * Every text role here was solved to a contrast target against the worst of the three\n * surfaces it can land on, every semantic colour against both the page and its own badge\n * tint, and the whole set is re-checked by `__tests__/palette-audit.test.ts` (\"derived\n * presets\") — which re-runs the deriver and fails if these committed values drift from\n * what it now produces.\n *\n * They are committed rather than derived at import because deriving eight token sets\n * costs ~34ms, and charging every consumer that at startup for palettes most of them\n * will never select is the wrong trade. The test is what keeps the two in agreement.\n *\n * Regenerated in 0.34 (round 0.34 BUG-8): the solve now measures the hex it ships rather\n * than the float before rounding, and the audit no longer lets a hex pair pass 0.05 under\n * its threshold. 52 values moved one step (66 counting the heat stops that repeat them);\n * Contrast's neutrals lost half their slate tint, its brand having half the chroma at\n * which the neutrals carry a hue in full.\n */\nexport const DERIVED_PRESETS: PalettePreset[] = [\n {\n id: \"ink\",\n name: \"Ink\",\n blurb: \"Cool blue-grey ground · solved for AAA body text\",\n light: {\n bgPage: \"#dce2ef\",\n bgSurface: \"#e6edfa\",\n bgSurface2: \"#dce2ef\",\n border: \"#b0bace\",\n textPrimary: \"#2e3139\",\n textSecondary: \"#454850\",\n textMuted: \"#5f636c\",\n brand: \"#2f5fd0\",\n brandHover: \"#1f4cbc\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00725f\",\n moneyExpense: \"#8e5900\",\n moneyNet: \"#7356a2\",\n moneyNeutral: \"#61646c\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#dce2ef\",\n under: \"#00725f\",\n over: \"#8e5900\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8e5900\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#090d15\",\n bgSurface: \"#131720\",\n bgSurface2: \"#1d212b\",\n border: \"#363e4f\",\n textPrimary: \"#c8ccd6\",\n textSecondary: \"#a7abb5\",\n textMuted: \"#858a92\",\n brand: \"#3466d7\",\n brandHover: \"#2353c3\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009a80\",\n moneyExpense: \"#b77b29\",\n moneyNet: \"#9679c9\",\n moneyNeutral: \"#a1a5ac\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#1d212b\",\n under: \"#009a80\",\n over: \"#b77b29\",\n seqLow: \"#331f05\",\n seqHigh: \"#b77b29\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n {\n id: \"moss\",\n name: \"Moss\",\n blurb: \"Green ground · solved for AAA body text\",\n light: {\n bgPage: \"#d8e6dd\",\n bgSurface: \"#e3f1e8\",\n bgSurface2: \"#d8e6dd\",\n border: \"#abbfb2\",\n textPrimary: \"#2c332e\",\n textSecondary: \"#424b45\",\n textMuted: \"#5d6660\",\n brand: \"#2f7a52\",\n brandHover: \"#196842\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00725f\",\n moneyExpense: \"#8e5900\",\n moneyNet: \"#7356a2\",\n moneyNeutral: \"#5f6662\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#d8e6dd\",\n under: \"#00725f\",\n over: \"#8e5900\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8e5900\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#060f0a\",\n bgSurface: \"#101a14\",\n bgSurface2: \"#1a241e\",\n border: \"#314337\",\n textPrimary: \"#c6cfc9\",\n textSecondary: \"#a5aea8\",\n textMuted: \"#838c86\",\n brand: \"#317b53\",\n brandHover: \"#1c6943\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009a80\",\n moneyExpense: \"#b87c2a\",\n moneyNet: \"#977ac9\",\n moneyNeutral: \"#9fa7a2\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#1a241e\",\n under: \"#009a80\",\n over: \"#b87c2a\",\n seqLow: \"#331f05\",\n seqHigh: \"#b87c2a\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n {\n id: \"plum\",\n name: \"Plum\",\n blurb: \"Violet ground · solved for AAA body text\",\n light: {\n bgPage: \"#e7dfea\",\n bgSurface: \"#f2e9f5\",\n bgSurface2: \"#e7dfea\",\n border: \"#c2b5c6\",\n textPrimary: \"#352f36\",\n textSecondary: \"#4c464e\",\n textMuted: \"#676169\",\n brand: \"#7b3f8f\",\n brandHover: \"#692d7d\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00715e\",\n moneyExpense: \"#8d5800\",\n moneyNet: \"#7355a2\",\n moneyNeutral: \"#676269\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#e7dfea\",\n under: \"#00715e\",\n over: \"#8d5800\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8d5800\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#100b12\",\n bgSurface: \"#1b151d\",\n bgSurface2: \"#251f27\",\n border: \"#453b48\",\n textPrimary: \"#d0cad2\",\n textSecondary: \"#afa9b1\",\n textMuted: \"#8d8790\",\n brand: \"#9154a6\",\n brandHover: \"#7f4293\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009980\",\n moneyExpense: \"#b77b29\",\n moneyNet: \"#9679c9\",\n moneyNeutral: \"#a8a2aa\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#251f27\",\n under: \"#009980\",\n over: \"#b77b29\",\n seqLow: \"#331f05\",\n seqHigh: \"#b77b29\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n {\n id: \"contrast\",\n name: \"High contrast\",\n blurb: \"Near-neutral ground · text solved to 13:1 / 8.5:1 / 5.5:1\",\n light: {\n bgPage: \"#e1e2e3\",\n bgSurface: \"#ecedee\",\n bgSurface2: \"#e1e2e3\",\n border: \"#b8babc\",\n textPrimary: \"#1b1d21\",\n textSecondary: \"#3a3c40\",\n textMuted: \"#55585c\",\n brand: \"#1f2937\",\n brandHover: \"#111b28\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#00715e\",\n moneyExpense: \"#8d5800\",\n moneyNet: \"#7255a1\",\n moneyNeutral: \"#616467\",\n chart: PAUL_TOL.light,\n heat: {\n neutral: \"#e1e2e3\",\n under: \"#00715e\",\n over: \"#8d5800\",\n seqLow: \"#fee3c5\",\n seqHigh: \"#8d5800\",\n empty: \"rgba(120,110,95,0.14)\",\n },\n },\n dark: {\n bgPage: \"#0c0d0e\",\n bgSurface: \"#171718\",\n bgSurface2: \"#212122\",\n border: \"#3d3e3f\",\n textPrimary: \"#e4e8ec\",\n textSecondary: \"#b9bdc1\",\n textMuted: \"#95979c\",\n brand: \"#556c8e\",\n brandHover: \"#455b7c\",\n brandContrast: \"#ffffff\",\n moneyIncome: \"#009a80\",\n moneyExpense: \"#b77b29\",\n moneyNet: \"#9679c9\",\n moneyNeutral: \"#a2a5a8\",\n chart: PAUL_TOL.dark,\n heat: {\n neutral: \"#212122\",\n under: \"#009a80\",\n over: \"#b77b29\",\n seqLow: \"#331f05\",\n seqHigh: \"#b77b29\",\n empty: \"rgba(160,170,190,0.10)\",\n },\n },\n },\n];\n\nexport const PALETTES: PalettePreset[] = [DEFAULT_PRESET, IMPRINT_PRESET, ...DERIVED_PRESETS];\n\nexport function presetById(id: string): PalettePreset {\n return PALETTES.find((p) => p.id === id) ?? DEFAULT_PRESET;\n}\n\n/**\n * Write a token set onto an element's inline style as CSS custom properties.\n *\n * This is the only writer, and there is no un-writer: `presetById` falls back to\n * `DEFAULT_PRESET` and this then writes the full set, so returning to the default\n * APPLIES it rather than clearing anything. A `clearTokenSet` and the hand-kept\n * 24-name `TOKEN_VARS` list it looped over used to live here, both exported, both\n * called by nobody in either consumer — a second copy of these property names with\n * nothing comparing the two, so adding a token here and forgetting it there would\n * have been silent and only a dead function would have noticed. The list is gone;\n * the test beside this asserts instead that every field of a `TokenSet` reaches the\n * element, which is what that list was standing in for.\n *\n * **More contrast (0.32, docs/text-size-harmonization.md §5, §10.5).** With `contrast`\n * the text and border tokens are written one step stronger, and `--text-placeholder` —\n * otherwise derived in tokens.css — is written inline too; without it that inline\n * placeholder is removed again, so the stylesheet's formula applies. The step is made\n * HERE because these tokens are inline: no `[data-contrast=more]` rule could beat them.\n *\n * `contrast` defaults to the element's own `data-contrast=\"more\"`, which the contrast\n * layer (`applyContrast`, `useApplyContrast`) sets first. That is how the palette and the\n * contrast cooperate without knowing each other: a palette change re-applies through\n * here and keeps the contrast, and a contrast change re-applies the set remembered here.\n */\nexport function applyTokenSet(\n el: HTMLElement,\n t: TokenSet,\n contrast: boolean = el.getAttribute(\"data-contrast\") === \"more\",\n): void {\n rememberTokenSet(el, t);\n const step = contrast ? contrastStep(t) : null;\n el.style.setProperty(\"--bg-page\", t.bgPage);\n el.style.setProperty(\"--bg-surface\", t.bgSurface);\n el.style.setProperty(\"--bg-surface-2\", t.bgSurface2);\n el.style.setProperty(\"--border\", step?.border ?? t.border);\n el.style.setProperty(\"--text-primary\", t.textPrimary);\n el.style.setProperty(\"--text-secondary\", step?.textSecondary ?? t.textSecondary);\n el.style.setProperty(\"--text-muted\", step?.textMuted ?? t.textMuted);\n if (step) el.style.setProperty(\"--text-placeholder\", step.textPlaceholder);\n else el.style.removeProperty(\"--text-placeholder\");\n el.style.setProperty(\"--brand\", t.brand);\n el.style.setProperty(\"--brand-hover\", t.brandHover);\n el.style.setProperty(\"--brand-contrast\", t.brandContrast);\n el.style.setProperty(\"--money-income\", t.moneyIncome);\n el.style.setProperty(\"--money-expense\", t.moneyExpense);\n el.style.setProperty(\"--money-net\", t.moneyNet);\n el.style.setProperty(\"--money-neutral\", t.moneyNeutral);\n t.chart.forEach((c, i) => el.style.setProperty(`--chart-${i + 1}`, c));\n}\n"],"mappings":";AAiBA,S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G,MAAM,YAAY,WAAW,EAAE,KAAK;AACvC,KAAG,MAAM,YAAY,iBAAiB,EAAE,UAAU;AAClD,KAAG,MAAM,YAAY,oBAAoB,EAAE,aAAa;AACxD,KAAG,MAAM,YAAY,kBAAkB,EAAE,WAAW;AACpD,KAAG,MAAM,YAAY,mBAAmB,EAAE,YAAY;AACtD,KAAG,MAAM,YAAY,eAAe,EAAE,QAAQ;AAC9C,KAAG,MAAM,YAAY,mBAAmB,EAAE,YAAY;AACtD,IAAE,MAAM,QAAQ,CAAC,GAAG,MAAM,GAAG,MAAM,YAAY,WAAW,IAAI,CAAC,IAAI,CAAC,CAAC;AACvE;","names":[]}
|
package/dist/wizard/types.d.ts
CHANGED
|
@@ -235,8 +235,3 @@ export interface WizardLabels {
|
|
|
235
235
|
done?: string;
|
|
236
236
|
}
|
|
237
237
|
export { DEFAULT_WIZARD_LABELS };
|
|
238
|
-
/** @deprecated 0.34 — `useKitLabels("wizard", DEFAULT_WIZARD_LABELS, labels)`, which the
|
|
239
|
-
* provider reaches too, or StepperNav's and WizardSummary's own `labels`; removed in 0.35
|
|
240
|
-
* (refactor audit 2026-10, API-6a). A merge from before the provider, which no kit
|
|
241
|
-
* component calls. */
|
|
242
|
-
export declare function resolveWizardLabels(labels?: Partial<WizardLabels>): WizardLabels;
|
package/dist/wizard/types.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { DEFAULT_WIZARD_LABELS } from "./wizard-labels.js";
|
|
3
|
-
function resolveWizardLabels(labels) {
|
|
4
|
-
return labels ? { ...DEFAULT_WIZARD_LABELS, ...labels } : DEFAULT_WIZARD_LABELS;
|
|
5
|
-
}
|
|
6
3
|
export {
|
|
7
|
-
DEFAULT_WIZARD_LABELS
|
|
8
|
-
resolveWizardLabels
|
|
4
|
+
DEFAULT_WIZARD_LABELS
|
|
9
5
|
};
|
|
10
6
|
//# sourceMappingURL=types.js.map
|
package/dist/wizard/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/wizard/types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { DEFAULT_WIZARD_LABELS } from \"./wizard-labels\";\n\nexport type FieldErrors = Record<string, string>;\n\nexport type ValidateResult = boolean | { ok: boolean; errors?: FieldErrors };\n\nexport interface WizardStepConfig {\n /** Unique step identifier. */\n id: string;\n /**\n * What the step is called in the indicator.\n *\n * A `ReactNode`, not a translation key: the engine never resolves strings.\n * An app with i18n maps its own keys at the `useWizard` call — the same split\n * `TourStep` and `DataTableLabels` already use.\n */\n label: ReactNode;\n /** Whether the step can be skipped. */\n optional?: boolean;\n /**\n * Validation gate before advancing.\n * - Return `true` / `false` to just block.\n * - Return `{ ok: false, errors: { fieldName: \"message\" } }` to also surface\n * per-field error messages via `wizard.fieldErrors`.\n */\n validate?: () => ValidateResult | Promise<ValidateResult>;\n /**\n * The forward button's label on THIS step, in place of `labels.next` — \"Analyse\",\n * \"Import\", \"Send code\". On the committing step (see {@link commits}) it labels\n * Finish instead of `labels.finish`; `labels.submitting` still replaces it while\n * the commit runs. Like `label`, a node the app has already translated.\n */\n nextLabel?: ReactNode;\n /**\n * This step's forward button COMMITS: it runs `onComplete` (via `finish`) instead\n * of just advancing. Without the flag the last step commits, as it always has.\n *\n * Flag a step before the last and every step after it becomes a post-commit step —\n * an import's \"here is what happened, set up recurring rules?\" page:\n * - a successful `onComplete` advances onto the next step (a failed one stays, with\n * `wizard.error`, exactly like a last-step Finish);\n * - from there Back, the indicator and `goBack`/`goToStep` cannot cross back over\n * the commit, and Cancel is hidden — there is nothing left to discard;\n * - the last post-commit step's button is Done, which calls `onDone` (and is not\n * shown when there is no `onDone`: the step then carries its own way out).\n *\n * Only the FIRST flagged step counts. Steps after it may still validate, skip and\n * use `nextLabel` like any other.\n */\n commits?: boolean;\n}\n\n/**\n * Where the active step lives. `true` (the default) mirrors it to `?step=N` through\n * react-router, as every wizard before 0.8 did; `{ param }` renames that param (two\n * wizards on one page, or a page that already uses `step`); `false` keeps it in\n * memory only and needs no router at all.\n *\n * Read once, at mount: switching it on a mounted wizard has no effect.\n */\nexport type WizardUrlSync = boolean | { param?: string };\n\nexport interface UseWizardOptions<TData extends Record<string, unknown>> {\n steps: WizardStepConfig[];\n initialData?: Partial<TData>;\n onComplete?: (data: TData) => void | Promise<void>;\n onCancel?: () => void;\n /**\n * Leave the wizard BACKWARDS: when given, Back is shown on the first step too and\n * calls this — keksdose's import panel, whose first step's Back returns to the\n * dropzone the file came from. No confirm dialog: going back is not discarding.\n */\n onExit?: () => void;\n /**\n * The Done button on the last step after a committing step (see\n * {@link WizardStepConfig.commits}). Without it no Done button is rendered, and the\n * post-commit step is expected to carry its own way out.\n */\n onDone?: () => void;\n /**\n * Whether the chrome offers Cancel at all. Default `true`. `false` hides the button\n * (`wizard.canCancel` is false); `wizard.cancel()` still works if the app calls it.\n */\n cancellable?: boolean;\n /**\n * Whether Cancel asks first (\"Discard this form?\"). Default `true`. `false` makes\n * `cancel()` call `onCancel` straight away — for a wizard that has nothing to lose\n * yet, or one whose data is kept elsewhere.\n */\n confirmCancel?: boolean;\n /**\n * Mirror the active step to the URL. Default `true` (`?step=N`, needs a router).\n * See {@link WizardUrlSync}.\n *\n * The param is WRITTEN only, never read back (see the note in `use-wizard.ts`). It\n * is removed again when the wizard is left through the kit: a confirmed Cancel,\n * `onExit` from the first step's Back, and Done — each before the app's callback\n * runs, so an app that navigates away navigates from a clean URL. It is NOT removed\n * after `onComplete` on a last step: an app navigating away there would otherwise\n * be pulled back by the kit's own URL write. An app that stays on the page after a\n * final Finish drops the param itself, or uses `urlSync: false`.\n */\n urlSync?: WizardUrlSync;\n /**\n * Shown when a step blocks with no per-field detail — an RHF step surfacing\n * its own inline messages, say — so the user learns why the wizard did not\n * advance. Falls back to `wizard.missingRequired` from the {@link UiKitProvider},\n * then to English.\n */\n missingRequiredMessage?: string;\n /**\n * How to surface {@link missingRequiredMessage}. Defaults to the kit's `toast.error`\n * (sonner, an optional peer, is loaded only when a toast is shown). Pass your own to\n * route it somewhere else, or to a no-op to silence it.\n */\n onValidationFailed?: (message: string) => void;\n}\n\nexport type StepStatus = \"upcoming\" | \"active\" | \"completed\" | \"skipped\";\n\nexport interface UseWizardReturn<TData extends Record<string, unknown>> {\n // Navigation\n currentStepIndex: number;\n currentStep: WizardStepConfig;\n steps: WizardStepConfig[];\n isFirstStep: boolean;\n isLastStep: boolean;\n /** True once every step before the committing one (the last, unless a step is\n * flagged `commits`) has been completed or skipped. */\n canFinish: boolean;\n /** The step whose forward button commits: the first `commits` step, else the last. */\n commitStepIndex: number;\n /** The active step is {@link commitStepIndex}: the chrome shows Finish, not Next. */\n isCommitStep: boolean;\n /** `onComplete` has resolved. Once the active step is past the committing one, Back\n * cannot cross it and Cancel is hidden. */\n committed: boolean;\n /** Whether Back is offered here: not on the first step unless `onExit` was given,\n * and never back across a commit. (Disabled, not hidden, while `isSubmitting`.) */\n canGoBack: boolean;\n /** Whether Cancel is offered: `cancellable`, and not after a commit. */\n canCancel: boolean;\n /** Whether Done is offered: the last step, past a commit, with an `onDone`. */\n canDone: boolean;\n /** Whether the indicator may jump to `index` — a completed/skipped/active step on\n * the right side of any commit. `goToStep` refuses anything this rejects. */\n canGoToStep: (index: number) => boolean;\n goNext: () => Promise<void>;\n /** One step back — or, on the first step, `onExit`. Refused while submitting. */\n goBack: () => void;\n goToStep: (index: number) => void;\n skip: () => void;\n cancel: () => void;\n finish: () => Promise<void>;\n /** Leave after the post-commit steps: drops the URL param, then calls `onDone`. */\n done: () => void;\n /** Register a validator for the mounted step (used by useRhfWizardStep). */\n registerStepValidate: (\n fn: () => ValidateResult | Promise<ValidateResult>,\n ) => () => void;\n /** True when the mounted step has blocked forward navigation (Next/Skip disabled). */\n nextBlocked: boolean;\n /** Set by the active step (via useWizardNextGate) to disable/enable Next+Skip. */\n setNextBlocked: (blocked: boolean) => void;\n\n // Step state\n stepStatus: (index: number) => StepStatus;\n completedSteps: Set<number>;\n\n // Data\n data: TData;\n updateData: (partial: Partial<TData>) => void;\n\n // Loading / error\n isSubmitting: boolean;\n /** A `goNext`/`finish` is running the step's validators (an async server check,\n * say). The chrome shows Next pending — spinner, `aria-busy`, disabled. */\n isValidating: boolean;\n error: string | null;\n clearError: () => void;\n\n // Per-field validation errors (populated by the last failed goNext)\n fieldErrors: FieldErrors;\n clearFieldErrors: () => void;\n\n // Cancel dialog\n showCancelDialog: boolean;\n confirmCancel: () => void;\n dismissCancel: () => void;\n}\n\nexport interface SummaryItem {\n label: ReactNode;\n value: ReactNode;\n}\n\nexport interface SummarySection {\n label: ReactNode;\n /**\n * Which step the section's edit button jumps back to. Leave it out for a section\n * that belongs to no step — file-level counts, a total — and the card has no edit\n * button, instead of borrowing one from whichever step it was parked under.\n */\n stepIndex?: number;\n items: SummaryItem[];\n}\n\n/**\n * Every string the wizard chrome shows. All optional with English defaults, so a\n * monolingual app can mount `StepperNav` bare; a translated app passes the whole\n * object once (typically from a thin app-side wrapper).\n */\nexport interface WizardLabels {\n cancel: string;\n back: string;\n next: string;\n skip: string;\n finish: string;\n /** Shown on Finish while `isSubmitting`. */\n submitting: string;\n /** `aria-label` for the step indicator's `<nav>`. */\n steps: string;\n /** The mobile \"Step 2 of 5\" line. */\n step: (current: number, total: number) => string;\n /** Heading of the cancel-confirmation dialog. */\n cancelTitle: string;\n /** Body of the cancel-confirmation dialog. */\n confirmCancel: string;\n /** Confirm button in the cancel dialog. */\n cancelConfirmLabel: string;\n /** Dismiss button in the cancel dialog (\"keep editing\"). */\n cancelDismissLabel: string;\n /** Heading above a {@link WizardSummary}. */\n reviewTitle: string;\n /** `aria-label` on a summary section's edit button. */\n edit: string;\n /**\n * Toasted (or handed to `onValidationFailed`) when a step blocks Next without\n * saying which field is at fault. `useWizard`'s `missingRequiredMessage` wins.\n *\n * This and `genericError` are OPTIONAL, unlike every key above, for the reason\n * `TwoFactorSettingLabels.qrAlt` is: apps annotate a full translation as\n * `const DE: WizardLabels = {…}`, and a new required key would be a compile error\n * in each of them on the next update. The defaults below always carry both.\n */\n missingRequired?: string;\n /** `wizard.error` when `onComplete` rejects with nothing readable — a thrown\n * non-Error, or an Error whose message is empty. Optional: see above. */\n genericError?: string;\n /** The button on the last step after a committing step (`onDone`). Optional: see\n * `missingRequired`. */\n done?: string;\n}\n\n// The English words live in ./wizard-labels, a module of words (round 0.34).\nexport { DEFAULT_WIZARD_LABELS };\n\n/** @deprecated 0.34 — `useKitLabels(\"wizard\", DEFAULT_WIZARD_LABELS, labels)`, which the\n * provider reaches too, or StepperNav's and WizardSummary's own `labels`; removed in 0.35\n * (refactor audit 2026-10, API-6a). A merge from before the provider, which no kit\n * component calls. */\nexport function resolveWizardLabels(labels?: Partial<WizardLabels>): WizardLabels {\n return labels ? { ...DEFAULT_WIZARD_LABELS, ...labels } : DEFAULT_WIZARD_LABELS;\n}\n"],"mappings":";AACA,SAAS,6BAA6B;AAqQ/B,SAAS,oBAAoB,QAA8C;AAChF,SAAO,SAAS,EAAE,GAAG,uBAAuB,GAAG,OAAO,IAAI;AAC5D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/wizard/types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { DEFAULT_WIZARD_LABELS } from \"./wizard-labels\";\n\nexport type FieldErrors = Record<string, string>;\n\nexport type ValidateResult = boolean | { ok: boolean; errors?: FieldErrors };\n\nexport interface WizardStepConfig {\n /** Unique step identifier. */\n id: string;\n /**\n * What the step is called in the indicator.\n *\n * A `ReactNode`, not a translation key: the engine never resolves strings.\n * An app with i18n maps its own keys at the `useWizard` call — the same split\n * `TourStep` and `DataTableLabels` already use.\n */\n label: ReactNode;\n /** Whether the step can be skipped. */\n optional?: boolean;\n /**\n * Validation gate before advancing.\n * - Return `true` / `false` to just block.\n * - Return `{ ok: false, errors: { fieldName: \"message\" } }` to also surface\n * per-field error messages via `wizard.fieldErrors`.\n */\n validate?: () => ValidateResult | Promise<ValidateResult>;\n /**\n * The forward button's label on THIS step, in place of `labels.next` — \"Analyse\",\n * \"Import\", \"Send code\". On the committing step (see {@link commits}) it labels\n * Finish instead of `labels.finish`; `labels.submitting` still replaces it while\n * the commit runs. Like `label`, a node the app has already translated.\n */\n nextLabel?: ReactNode;\n /**\n * This step's forward button COMMITS: it runs `onComplete` (via `finish`) instead\n * of just advancing. Without the flag the last step commits, as it always has.\n *\n * Flag a step before the last and every step after it becomes a post-commit step —\n * an import's \"here is what happened, set up recurring rules?\" page:\n * - a successful `onComplete` advances onto the next step (a failed one stays, with\n * `wizard.error`, exactly like a last-step Finish);\n * - from there Back, the indicator and `goBack`/`goToStep` cannot cross back over\n * the commit, and Cancel is hidden — there is nothing left to discard;\n * - the last post-commit step's button is Done, which calls `onDone` (and is not\n * shown when there is no `onDone`: the step then carries its own way out).\n *\n * Only the FIRST flagged step counts. Steps after it may still validate, skip and\n * use `nextLabel` like any other.\n */\n commits?: boolean;\n}\n\n/**\n * Where the active step lives. `true` (the default) mirrors it to `?step=N` through\n * react-router, as every wizard before 0.8 did; `{ param }` renames that param (two\n * wizards on one page, or a page that already uses `step`); `false` keeps it in\n * memory only and needs no router at all.\n *\n * Read once, at mount: switching it on a mounted wizard has no effect.\n */\nexport type WizardUrlSync = boolean | { param?: string };\n\nexport interface UseWizardOptions<TData extends Record<string, unknown>> {\n steps: WizardStepConfig[];\n initialData?: Partial<TData>;\n onComplete?: (data: TData) => void | Promise<void>;\n onCancel?: () => void;\n /**\n * Leave the wizard BACKWARDS: when given, Back is shown on the first step too and\n * calls this — keksdose's import panel, whose first step's Back returns to the\n * dropzone the file came from. No confirm dialog: going back is not discarding.\n */\n onExit?: () => void;\n /**\n * The Done button on the last step after a committing step (see\n * {@link WizardStepConfig.commits}). Without it no Done button is rendered, and the\n * post-commit step is expected to carry its own way out.\n */\n onDone?: () => void;\n /**\n * Whether the chrome offers Cancel at all. Default `true`. `false` hides the button\n * (`wizard.canCancel` is false); `wizard.cancel()` still works if the app calls it.\n */\n cancellable?: boolean;\n /**\n * Whether Cancel asks first (\"Discard this form?\"). Default `true`. `false` makes\n * `cancel()` call `onCancel` straight away — for a wizard that has nothing to lose\n * yet, or one whose data is kept elsewhere.\n */\n confirmCancel?: boolean;\n /**\n * Mirror the active step to the URL. Default `true` (`?step=N`, needs a router).\n * See {@link WizardUrlSync}.\n *\n * The param is WRITTEN only, never read back (see the note in `use-wizard.ts`). It\n * is removed again when the wizard is left through the kit: a confirmed Cancel,\n * `onExit` from the first step's Back, and Done — each before the app's callback\n * runs, so an app that navigates away navigates from a clean URL. It is NOT removed\n * after `onComplete` on a last step: an app navigating away there would otherwise\n * be pulled back by the kit's own URL write. An app that stays on the page after a\n * final Finish drops the param itself, or uses `urlSync: false`.\n */\n urlSync?: WizardUrlSync;\n /**\n * Shown when a step blocks with no per-field detail — an RHF step surfacing\n * its own inline messages, say — so the user learns why the wizard did not\n * advance. Falls back to `wizard.missingRequired` from the {@link UiKitProvider},\n * then to English.\n */\n missingRequiredMessage?: string;\n /**\n * How to surface {@link missingRequiredMessage}. Defaults to the kit's `toast.error`\n * (sonner, an optional peer, is loaded only when a toast is shown). Pass your own to\n * route it somewhere else, or to a no-op to silence it.\n */\n onValidationFailed?: (message: string) => void;\n}\n\nexport type StepStatus = \"upcoming\" | \"active\" | \"completed\" | \"skipped\";\n\nexport interface UseWizardReturn<TData extends Record<string, unknown>> {\n // Navigation\n currentStepIndex: number;\n currentStep: WizardStepConfig;\n steps: WizardStepConfig[];\n isFirstStep: boolean;\n isLastStep: boolean;\n /** True once every step before the committing one (the last, unless a step is\n * flagged `commits`) has been completed or skipped. */\n canFinish: boolean;\n /** The step whose forward button commits: the first `commits` step, else the last. */\n commitStepIndex: number;\n /** The active step is {@link commitStepIndex}: the chrome shows Finish, not Next. */\n isCommitStep: boolean;\n /** `onComplete` has resolved. Once the active step is past the committing one, Back\n * cannot cross it and Cancel is hidden. */\n committed: boolean;\n /** Whether Back is offered here: not on the first step unless `onExit` was given,\n * and never back across a commit. (Disabled, not hidden, while `isSubmitting`.) */\n canGoBack: boolean;\n /** Whether Cancel is offered: `cancellable`, and not after a commit. */\n canCancel: boolean;\n /** Whether Done is offered: the last step, past a commit, with an `onDone`. */\n canDone: boolean;\n /** Whether the indicator may jump to `index` — a completed/skipped/active step on\n * the right side of any commit. `goToStep` refuses anything this rejects. */\n canGoToStep: (index: number) => boolean;\n goNext: () => Promise<void>;\n /** One step back — or, on the first step, `onExit`. Refused while submitting. */\n goBack: () => void;\n goToStep: (index: number) => void;\n skip: () => void;\n cancel: () => void;\n finish: () => Promise<void>;\n /** Leave after the post-commit steps: drops the URL param, then calls `onDone`. */\n done: () => void;\n /** Register a validator for the mounted step (used by useRhfWizardStep). */\n registerStepValidate: (\n fn: () => ValidateResult | Promise<ValidateResult>,\n ) => () => void;\n /** True when the mounted step has blocked forward navigation (Next/Skip disabled). */\n nextBlocked: boolean;\n /** Set by the active step (via useWizardNextGate) to disable/enable Next+Skip. */\n setNextBlocked: (blocked: boolean) => void;\n\n // Step state\n stepStatus: (index: number) => StepStatus;\n completedSteps: Set<number>;\n\n // Data\n data: TData;\n updateData: (partial: Partial<TData>) => void;\n\n // Loading / error\n isSubmitting: boolean;\n /** A `goNext`/`finish` is running the step's validators (an async server check,\n * say). The chrome shows Next pending — spinner, `aria-busy`, disabled. */\n isValidating: boolean;\n error: string | null;\n clearError: () => void;\n\n // Per-field validation errors (populated by the last failed goNext)\n fieldErrors: FieldErrors;\n clearFieldErrors: () => void;\n\n // Cancel dialog\n showCancelDialog: boolean;\n confirmCancel: () => void;\n dismissCancel: () => void;\n}\n\nexport interface SummaryItem {\n label: ReactNode;\n value: ReactNode;\n}\n\nexport interface SummarySection {\n label: ReactNode;\n /**\n * Which step the section's edit button jumps back to. Leave it out for a section\n * that belongs to no step — file-level counts, a total — and the card has no edit\n * button, instead of borrowing one from whichever step it was parked under.\n */\n stepIndex?: number;\n items: SummaryItem[];\n}\n\n/**\n * Every string the wizard chrome shows. All optional with English defaults, so a\n * monolingual app can mount `StepperNav` bare; a translated app passes the whole\n * object once (typically from a thin app-side wrapper).\n */\nexport interface WizardLabels {\n cancel: string;\n back: string;\n next: string;\n skip: string;\n finish: string;\n /** Shown on Finish while `isSubmitting`. */\n submitting: string;\n /** `aria-label` for the step indicator's `<nav>`. */\n steps: string;\n /** The mobile \"Step 2 of 5\" line. */\n step: (current: number, total: number) => string;\n /** Heading of the cancel-confirmation dialog. */\n cancelTitle: string;\n /** Body of the cancel-confirmation dialog. */\n confirmCancel: string;\n /** Confirm button in the cancel dialog. */\n cancelConfirmLabel: string;\n /** Dismiss button in the cancel dialog (\"keep editing\"). */\n cancelDismissLabel: string;\n /** Heading above a {@link WizardSummary}. */\n reviewTitle: string;\n /** `aria-label` on a summary section's edit button. */\n edit: string;\n /**\n * Toasted (or handed to `onValidationFailed`) when a step blocks Next without\n * saying which field is at fault. `useWizard`'s `missingRequiredMessage` wins.\n *\n * This and `genericError` are OPTIONAL, unlike every key above, for the reason\n * `TwoFactorSettingLabels.qrAlt` is: apps annotate a full translation as\n * `const DE: WizardLabels = {…}`, and a new required key would be a compile error\n * in each of them on the next update. The defaults below always carry both.\n */\n missingRequired?: string;\n /** `wizard.error` when `onComplete` rejects with nothing readable — a thrown\n * non-Error, or an Error whose message is empty. Optional: see above. */\n genericError?: string;\n /** The button on the last step after a committing step (`onDone`). Optional: see\n * `missingRequired`. */\n done?: string;\n}\n\n// The English words live in ./wizard-labels, a module of words (round 0.34).\nexport { DEFAULT_WIZARD_LABELS };\n"],"mappings":";AACA,SAAS,6BAA6B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eifi1/ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "App-agnostic shared design system: domain-free React components, theme and tokens.",
|
|
6
6
|
"_sideEffects": "The barrel (src/index.ts) re-exports EVERY component, including components/chart, which statically imports recharts. Without this field a bundler must assume each of those modules has side effects, so it cannot drop the unused ones: importing a Button from '@eifi1/ui-kit' dragged all 433KB of recharts into the consumer's ENTRY chunk, and Keksdose was preloading it on every page load, login included. Nothing in src/ imports for side effects (no bare imports, no CSS imports from JS, no module-level global writes) — the token stylesheet is its own './tokens.css' export — so this is safe. CSS is still listed so any future stylesheet survives. Re-checked when `flag-icons` left `dependencies` and tsup started emitting a `\"use client\"` banner: neither touches this. The flag stylesheet was never imported from JS in the first place (that was the finding), and a directive prologue is a string literal every bundler lifts out before it decides whether a module is inert.",
|
|
@@ -48,6 +48,14 @@
|
|
|
48
48
|
"types": "./dist/table-text.d.ts",
|
|
49
49
|
"import": "./dist/table-text.js"
|
|
50
50
|
},
|
|
51
|
+
"./currencies": {
|
|
52
|
+
"types": "./dist/currencies.d.ts",
|
|
53
|
+
"import": "./dist/currencies.js"
|
|
54
|
+
},
|
|
55
|
+
"./eslint": {
|
|
56
|
+
"types": "./dist/eslint/index.d.ts",
|
|
57
|
+
"import": "./dist/eslint/index.js"
|
|
58
|
+
},
|
|
51
59
|
"./testing": {
|
|
52
60
|
"types": "./dist/testing/index.d.ts",
|
|
53
61
|
"import": "./dist/testing/index.js"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
import { CreditCard, Hourglass, PencilOff } from "lucide-react";
|
|
3
3
|
|
|
4
4
|
import type { LabelOverride } from "../i18n/kit-labels";
|
|
@@ -29,7 +29,10 @@ export type BillingBannerKind =
|
|
|
29
29
|
| "guest"
|
|
30
30
|
| "processing";
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
/** A `div`'s props, `ref` included since 0.35 (round 0.35 R4, the follow-up to API-2): they
|
|
33
|
+
* go on to the {@link AlertBanner}, so the ref is the banner's `<div>` — with an × too,
|
|
34
|
+
* since the banner has no `href` or `onClick` that would make its row a link or a button. */
|
|
35
|
+
interface BillingBannerBaseProps extends Omit<ComponentPropsWithRef<"div">, "children" | "onClick"> {
|
|
33
36
|
/**
|
|
34
37
|
* Over the kind's tone: `trial-ending` and `grant-ending` are `info` until the last
|
|
35
38
|
* three days and `warning` in them; `payment-failed` is `danger` (money did not
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
2
|
|
|
3
3
|
import { useKitLocale } from "../i18n/kit-labels";
|
|
4
4
|
import type { LabelOverride } from "../i18n/kit-labels";
|
|
@@ -22,7 +22,10 @@ export function planLimitMailto(email: string, subject: string): string {
|
|
|
22
22
|
return `mailto:${to}?subject=${encodeStrict(subject)}`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
/** A `div`'s props, `ref` included since 0.35 (round 0.35 R4, the follow-up to API-2): they
|
|
26
|
+
* go on to the {@link AlertBanner}, so the ref is the notice's `<div>` — its `href` is the
|
|
27
|
+
* action button's, never the banner's, so the frame is never a link. */
|
|
28
|
+
interface PlanLimitNoticeBaseProps extends Omit<ComponentPropsWithRef<"div">, "children" | "onClick"> {
|
|
26
29
|
/** The dimension as the refusal names it (`"budgets"`, `"seats"`) — `isPlanLimit(err)`'s
|
|
27
30
|
* `dimension`. Carried as `data-dimension`. */
|
|
28
31
|
dimension: string;
|
package/src/chart.ts
CHANGED
|
@@ -20,10 +20,12 @@ export * from "./components/treemap";
|
|
|
20
20
|
export * from "./components/series-chart";
|
|
21
21
|
// 0.32.1 (keksdose's 0.32 report): the height every chart takes, for an app's wrappers.
|
|
22
22
|
export type { ChartHeight } from "./components/chart-height";
|
|
23
|
+
// SharedXZoom and the zoom's types: the public face of ./chart-zoom-core, whose arithmetic
|
|
24
|
+
// stays the kit's (refactor audit 2026-10, API-6b; off the surface in 0.35).
|
|
23
25
|
export * from "./components/chart-zoom";
|
|
24
|
-
// The
|
|
25
|
-
//
|
|
26
|
-
//
|
|
26
|
+
// The same binding, named from the module that holds it and the drag layer (recharts): the
|
|
27
|
+
// packaging contract reads this entry's own imports to know which modules may import
|
|
28
|
+
// recharts, so chart-zoom-core has to be one of them (MOD-6).
|
|
27
29
|
export { SharedXZoom } from "./components/chart-zoom-core";
|
|
28
30
|
export * from "./components/toggle-legend";
|
|
29
31
|
export * from "./components/facing-pair";
|