pne-ui 5.0.0-rc.8 → 5.0.0-rc.9

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.
Files changed (44) hide show
  1. package/README.md +64 -28
  2. package/cjs/brandRamp.js +62 -38
  3. package/cjs/buttonPalette.js +143 -55
  4. package/cjs/checkboxPalette.js +34 -20
  5. package/cjs/color.js +65 -31
  6. package/cjs/component/PneButton.js +37 -18
  7. package/cjs/component/PneField.js +38 -8
  8. package/cjs/component/PneLabeledCheckbox.js +99 -3
  9. package/cjs/component/PneSwitch.js +1 -1
  10. package/cjs/component/fieldLook.js +7 -0
  11. package/cjs/component/search-ui/filters/component/template/SearchUITemplateEditor.js +10 -3
  12. package/cjs/component/search-ui/filters/state/actions.js +19 -6
  13. package/cjs/dropdownPalette.js +9 -9
  14. package/cjs/fieldPalette.js +16 -14
  15. package/cjs/switchPalette.js +32 -31
  16. package/cjs/themeColors.js +52 -24
  17. package/esm/brandRamp.d.ts +14 -5
  18. package/esm/brandRamp.js +62 -38
  19. package/esm/buttonPalette.d.ts +27 -9
  20. package/esm/buttonPalette.js +143 -57
  21. package/esm/checkboxPalette.d.ts +16 -0
  22. package/esm/checkboxPalette.js +35 -21
  23. package/esm/color.d.ts +10 -3
  24. package/esm/color.js +61 -29
  25. package/esm/component/PneButton.d.ts +15 -2
  26. package/esm/component/PneButton.js +37 -18
  27. package/esm/component/PneField.d.ts +6 -0
  28. package/esm/component/PneField.js +38 -8
  29. package/esm/component/PneLabeledCheckbox.d.ts +5 -0
  30. package/esm/component/PneLabeledCheckbox.js +100 -4
  31. package/esm/component/PneSwitch.js +1 -1
  32. package/esm/component/fieldLook.js +7 -0
  33. package/esm/component/search-ui/filters/component/template/SearchUITemplateEditor.js +10 -3
  34. package/esm/component/search-ui/filters/state/actions.js +20 -7
  35. package/esm/createTheme.d.ts +1 -1
  36. package/esm/dropdownPalette.js +10 -10
  37. package/esm/exports/inputs.d.ts +2 -2
  38. package/esm/fieldPalette.d.ts +4 -1
  39. package/esm/fieldPalette.js +16 -14
  40. package/esm/switchPalette.d.ts +4 -4
  41. package/esm/switchPalette.js +33 -32
  42. package/esm/themeColors.d.ts +19 -14
  43. package/esm/themeColors.js +52 -24
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -138,21 +138,33 @@ zod-схемами, нужны свои схемы. `dayjs` берётся у п
138
138
  | `pneStyle` | Вариант UI Kit | Назначение |
139
139
  |---|---|---|
140
140
  | `contained` или prop не задан | Primary | единственное главное действие на странице |
141
- | `outlined` | Secondary | второстепенное действие: кольцо цвета бренда, без заливки |
142
- | `text` | Tertiary | нейтральная кнопка, как вкладка светлой группы без Active |
141
+ | `outlined` | Secondary | второстепенное действие: кольцо цвета бренда; под указателем заливка подкрашивается |
142
+ | `text` | Tertiary | нейтральная кнопка на серой заливке; под указателем меняется только цвет подписи |
143
+ | `errorText` | Tertiary danger | `text` с красной подписью: удаление, которому не нужен вес залитой кнопки |
144
+ | `successText` | Tertiary success | `text` с зелёной подписью: активация |
143
145
  | `error` | Destructive | удаление, красная заливка |
144
- | `warning` | Warning | неразрушающее предупреждение, оранжевая заливка |
145
- | `neutral`, `neutralText`, `primaryLight`, `white` | Soft | подпись цвета бренда без заливки в покое, для таблиц и панелей |
146
+ | `warning` | Warning | неразрушающее предупреждение, янтарная заливка |
147
+ | `neutral`, `neutralText`, `primaryLight`, `white` | Soft | подпись цвета бренда на серой заливке, для таблиц и панелей |
146
148
 
147
149
  Размеры: `small` 24 px (таблицы, группы), `medium` 32 px (формы), `large` 40 px (главное действие
148
- страницы, по умолчанию). Подпись Roboto Medium 12/13/14 px, иконки 14/16/18 px, радиус 4 px. Рамки —
149
- внутренние кольца в 1 px, поэтому наведение и фокус не сдвигают раскладку. Подпись переносится на
150
- вторую строку, многоточия нет. Кнопка без детей и с иконкой — квадрат со стороной в высоту.
150
+ страницы, по умолчанию). Подпись Roboto Medium 12/14/14 px, иконки 14/16/18 px, радиус 4 px. Между иконкой
151
+ и подписью 2 px у `small` и `medium` и 8 px у `large`. Рамки — внутренние кольца в 1 px, поэтому
152
+ наведение и фокус не сдвигают раскладку. Подпись переносится на вторую строку, многоточия нет. Кнопка
153
+ без детей и с иконкой — квадрат со стороной в высоту.
154
+
155
+ `active` отмечает выбранный пункт набора — вкладку, текущую страницу: белая приподнятая кнопка `text`,
156
+ вид сохраняется под указателем. Кнопка с `active` рисуется так при любом `pneStyle`. Prop задаёт только
157
+ вид; смысл передавайте через `aria-current`, `aria-pressed` или `aria-selected`.
158
+
159
+ `activated` есть только у `successText`: это необратимый итог активации. Кнопка становится зелёным
160
+ статусом, не принимает клики и фокус. Подпись и иконку итога передаёт вызывающий код.
151
161
 
152
162
  Цвета берутся из `theme.palette.pne.button[variant][state]` (роли `btn-*` UI Kit) и выводятся из
153
163
  одного цвета скина (`experimentalColor`) по шкале `theme.palette.pne.ramp`. Три правила держат любой
154
- скин в рабочем виде: цвет бренда как текст или кольцо берёт первую ступень, читаемую на странице (3:1);
155
- у почти чёрного скина наведение и нажатие светлеют; подпись на заливке белая при 3:1, иначе тёмная.
164
+ скин в рабочем виде:
165
+ - цвет бренда на странице берёт первую ступень, которая там читается: текст при 4,5:1, кольцо при 3:1;
166
+ - у почти чёрного скина наведение и нажатие светлеют;
167
+ - подпись на заливке белая при 4,5:1, иначе та из тёмной и белой, что контрастнее.
156
168
 
157
169
  `loading` показывает спиннер на месте стартовой иконки, прячет конечную, блокирует клики и сохраняет
158
170
  цвета покоя. Давайте такой кнопке стартовую иконку, тогда её ширина не меняется.
@@ -174,6 +186,10 @@ zod-схемами, нужны свои схемы. `dayjs` берётся у п
174
186
  Внутри `PneField` должен быть ровно один логический control; для группы передавайте один group component, а не
175
187
  несколько соседних controls. `PneField` не принимает ID произвольной layout-обёртки за ID самого control.
176
188
 
189
+ Подпись стоит над control (UI Kit Field, Label position Top): 12/16 Medium, в ошибке цвет не меняется — краснеет
190
+ helper text. `labelPosition="left"` ставит подпись слева в колонку 160 px, по центру control, 14/20 цветом
191
+ значения; helper text остаётся под control.
192
+
177
193
  `id` принадлежит root `FormControl` и служит namespace для сгенерированных ID. `controlId` принадлежит самому
178
194
  интерактивному control и используется в `label[for]`; эти ID должны различаться. Указанный на child `id` не
179
195
  переопределяет field-owned ID, поэтому при миграции переносите его в `controlId`. Prop `htmlFor` оставлен только
@@ -264,10 +280,12 @@ const { ref, ...field } = controllerField
264
280
  ```
265
281
 
266
282
  Вид поля (UI Kit Field). Вариант `outlined` (по умолчанию) — белое поле с кольцом Neutral/200, `filled` —
267
- серое поле Neutral/50 со скруглением 4 и тонким кольцом, без подчёркивания MUI. Кольцо по состояниям: наведение
268
- темнее, фокус — шаг бренда, читаемый на странице (кольцо 1px), ошибка — Error/500, `disabled` — Neutral/100;
269
- ошибка остаётся видна и в фокусе. Значение — Neutral/900, подсказка внутри поля — Neutral/600, helper text —
270
- Neutral/600, в ошибке Error/650. Цвета берутся из `theme.palette.pne.field`, тёмная тема — на нейтралях pne-ui.
283
+ серое поле Neutral/100 со скруглением 4 и тонким кольцом, без подчёркивания MUI; под указателем оно светлеет
284
+ до Neutral/50. Кольцо по состояниям: наведение темнее, фокус — шаг бренда, читаемый на странице (кольцо 1px),
285
+ ошибка — Red/600, `disabled` — Neutral/100; ошибка остаётся видна и в фокусе. Значение — Neutral/900,
286
+ подсказка внутри поля — Neutral/500, helper text — Neutral/700, в ошибке Red/700. Подпись внутри поля
287
+ (`slotProps.input.startAdornment`) читается как значение. Цвета берутся из `theme.palette.pne.field`,
288
+ тёмная тема — на нейтралях pne-ui.
271
289
  Высоты, размер текста и плавающая подпись MUI не менялись. Вид получает каждое поле, в том числе внутри
272
290
  автокомплитов и фильтров SearchUI. В режиме `select` поле рисует шеврон и список как `PneSelect` (свой
273
291
  `IconComponent` и `native` остаются за потребителем). `data-pne-state="hover" | "focus"` закрепляет состояние для образцов в Storybook;
@@ -298,9 +316,8 @@ pointer, label и keyboard activation, но не делает input disabled: о
298
316
  для `defaultChecked` commit и rollback полностью принадлежат самому `PneSwitch`. Нативный input во время
299
317
  запроса не становится `disabled`, поэтому не теряет focus и сохраняет текущее ON/OFF-состояние.
300
318
 
301
- У заблокированного (`disabled`) `PneSwitch` состояние ON/OFF остаётся различимым в светлой и тёмной теме:
302
- у включённого серая дорожка и белая ручка, у выключенного светлая дорожка и серая ручка (нейтральные цвета
303
- UI Kit). Над заблокированным переключателем курсор `not-allowed`, а при наведении появляется
319
+ У заблокированного (`disabled`) `PneSwitch` дорожка и ручка нейтральные и одинаковые в обоих значениях,
320
+ как в UI Kit: ON от OFF отличает положение ручки. Над заблокированным переключателем курсор `not-allowed`, а при наведении появляется
304
321
  нейтральная подсказка `pne.switch.disabledHint` (по умолчанию «Cannot be changed»). Конкретную причину
305
322
  передайте в `disabledHint`: она заменит общий текст, а `disabledHint={false}` отключает подсказку (курсор
306
323
  остаётся). Это касается и `disabled` от `PneField`, но не `readOnly` и не async-запроса. Подсказка рендерится рядом
@@ -312,6 +329,11 @@ UI Kit). Над заблокированным переключателем ку
312
329
  самому checkbox или switch. `PneLabeledCheckbox` добавляет локальные `label`, `helperText` и `error`, генерирует
313
330
  ID helper text, сохраняет явный `helperTextProps.id` и объединяет все `aria-describedby`.
314
331
 
332
+ Вид `PneLabeledCheckbox` — UI Kit Checkboxes/Set: подпись 14/20 в 8 px от флажка и на одной линии с ним,
333
+ пояснение 12/16 под подписью, в ошибке пояснение красное. `variant="card"` (в Figma — Frame) рисует флажок
334
+ карточкой для нескольких крупных вариантов: серая карточка, при выборе — подложка и кольцо цвета бренда,
335
+ клик в любом месте карточки переключает флажок. Цвета — `theme.palette.pne.checkbox.text` и `.card`.
336
+
315
337
  ```tsx
316
338
  <PneField label="Notifications" helperText={error?.message} error={Boolean(error)} required>
317
339
  <PneSwitch
@@ -328,9 +350,10 @@ ID helper text, сохраняет явный `helperTextProps.id` и объед
328
350
 
329
351
  Переключатель UI Kit (Switcher): Value × State × Size. Применяется сразу, без кнопки «Сохранить»; для
330
352
  выбора, который ждёт сохранения, используйте чекбокс. Размеры: `medium` — дорожка 32×20 с ручкой 16
331
- (область нажатия 58×32), `small` — 24×16 с ручкой 12 (40×24). Выключен: дорожка Brand/50 с кольцом
332
- Neutral/200 и ручка цвета бренда; включён: дорожка цвета бренда и белая ручка. Цвета берутся из
333
- `theme.palette.pne.switch[on|off][state]` и подчиняются тем же трём правилам для скинов, что и кнопки.
353
+ (область нажатия 58×32), `small` — 24×16 с ручкой 12 (40×24). Выключен: серая дорожка Neutral/300 и
354
+ белая ручка; включён: дорожка цвета бренда и белая ручка. У ручки нет тени и кольца. Дорожка, нажатая в
355
+ выключенном состоянии, уже берёт цвет включённого. Цвета берутся из `theme.palette.pne.switch[on|off][state]`
356
+ и подчиняются тем же трём правилам для скинов, что и кнопки: на светлой заливке скина ручка тёмная.
334
357
 
335
358
  Состояния: наведение, нажатие, фокус (кольцо на дорожке), `disabled` с подсказкой `disabledHint`,
336
359
  `readOnly` (значение в нейтральных цветах, клики не работают) и ожидание ответа: когда `onChange`
@@ -351,7 +374,7 @@ Storybook; в коде продукта атрибут не задаётся.
351
374
 
352
375
  Цвета берутся из `theme.palette.pne.checkbox[off|on][state]` и подчиняются тем же трём правилам для скинов:
353
376
  включённый — заливка цвета бренда с белой галочкой (тёмной, если белая не читается), выключенный — белый с кольцом
354
- Neutral/400; при наведении кольцо или заливка бренда темнее, при нажатии выключенный заливается Brand/50. Цвет
377
+ Neutral/400; при наведении кольцо или заливка бренда темнее, при нажатии выключенный заливается Brand/100. Цвет
355
378
  корня (`color`) — это кольцо выключенного и заливка включённого флажка, поэтому перекраска через
356
379
  `sx={{color: …}}` работает, как с иконками MUI.
357
380
 
@@ -507,7 +530,7 @@ numeric/string ID. `getOptionLabel`, `getOptionProps`, `getOptionDisabled`, `ren
507
530
  кольцо по состояниям, цвет значения и подсказки; пока список открыт, поле остаётся в фокусе. Шеврон UI Kit 14px (как
508
531
  у Input в дизайн-системе Claude, на месте иконки MUI и так же переворачивается) — цвета значения, у `disabled`
509
532
  бледный; свой `IconComponent` по-прежнему можно передать, он сохраняет свой размер. Список — панель UI Kit: радиус 8, 4px от поля и 4px внутри, тонкое кольцо и тень всплывающей панели.
510
- Строки со скруглением 4: наведение и подсветка с клавиатуры — Neutral/50, выбранная строка — Brand/50 с галочкой в
533
+ Строки со скруглением 4: наведение и подсветка с клавиатуры — Neutral/100, выбранная строка — Brand/100 с галочкой в
511
534
  конце (галочку рисует CSS, в значение поля она не попадает), `disabled` — бледный текст без прозрачности MUI. Высота
512
535
  строки и размер текста — как у MUI. Цвета берутся из `theme.palette.pne.dropdown` и `field`, тёмная тема — на
513
536
  нейтралях pne-ui. `sx` из `MenuProps` применяется после вида списка. `data-pne-state="hover" | "focus"` на
@@ -547,9 +570,9 @@ type Region = {code: string; title: string; disabled: boolean}
547
570
 
548
571
  Вид (UI Kit: поле и Dropdown list, у `PneAsyncAutocomplete` такой же). Поле — как у `PneTextField`. Шеврон и крестик
549
572
  очистки — тонкие значки UI Kit 14px цвета значения, на местах значков MUI (крестик MUI показывает при наведении и в
550
- фокусе). Значения `multiple` — бейджи UI Kit: скругление 4, белые с кольцом Neutral/200, тонкий крестик удаления.
551
- Список — панель UI Kit, как у `PneSelect`: строки со скруглением 4, подсветка Neutral/50, выбранная строка
552
- одиночного списка — Brand/50 с галочкой. В списке `multiple` в каждой строке флажок PneCheckbox, выбранные строки не
573
+ фокусе). Значения `multiple` — бейджи UI Kit: скругление 4, цвета страницы с кольцом Neutral/300, тонкий крестик
574
+ удаления. Список — панель UI Kit, как у `PneSelect`: строки со скруглением 4, подсветка Neutral/100, выбранная
575
+ строка одиночного списка — Brand/100 с галочкой. В списке `multiple` в каждой строке флажок PneCheckbox, выбранные строки не
553
576
  подкрашиваются. Строки, которые рисует потребитель (`renderOption`), остаются его: в списке `multiple` их выбранные
554
577
  строки подкрашиваются, потому что флажок у них может быть свой. Подписи групп `groupBy` — 12px Neutral/600 с линией
555
578
  между группами; строки «загрузка» и «ничего не найдено» — по центру, Neutral/600, ошибка загрузки
@@ -1241,6 +1264,9 @@ MUI popover/modal/listbox может находиться вне DOM-подде
1241
1264
  Имя шаблона остаётся пользовательским значением/accessible name и не копируется в technical ID. Create,
1242
1265
  Cancel и обычные поля формы ищутся внутри scoped dialog по native role/name.
1243
1266
 
1267
+ Имя сохраняется и проверяется на занятость без пробелов по краям. Одни пробелы именем не считаются: поле
1268
+ остаётся пустым, и его `required` останавливает Create так же, как у незаполненного поля.
1269
+
1244
1270
  #### Actions без отдельного `data-autotest`
1245
1271
 
1246
1272
  Для нескольких стандартных dialog actions контрактом служат native button + computed accessible name внутри
@@ -1980,6 +2006,10 @@ const config = {
1980
2006
  2999-12-31 00:00, по умолчанию по Москве, при заданном `dateOnlyTimeZone` — в нём; момент нажатия на результат
1981
2007
  не влияет.
1982
2008
 
2009
+ Переход на `EXACTLY` с любого другого режима начинает период с сегодняшнего дня, как поле Wicket: без времени
2010
+ в поле стоит сегодня–сегодня (ищется один день), со временем — с начала сегодняшнего дня до текущего момента.
2011
+ Даты прежнего режима в поле не переносятся: его конец — полночь после последнего дня, а не сам этот день.
2012
+
1983
2013
  Параметр `maxRangeSpanInDays` задаёт включительную верхнюю границу диапазона.
1984
2014
  Он проверяет уже разрешённые границы всех режимов даты; для date-only `EXACTLY`
1985
2015
  пользовательская конечная дата считается включительной. Значение должно быть
@@ -2490,15 +2520,21 @@ return (
2490
2520
  Цвета компонентов `pne-ui` 5 собраны из трёх шкал UI Kit. Приложению они нужны, когда собственный элемент
2491
2521
  должен попасть в тон компонентам библиотеки:
2492
2522
 
2493
- - `theme.palette.pne.ramp` — шкала бренда скина, шаги `PNE_BRAND_RAMP_STEPS` (от `0` до `1000`): `0` — белый,
2494
- `500` — цвет скина, `1000` — самый тёмный. Вне темы ту же шкалу строит `createPneBrandRamp(skinColor)`
2523
+ - `theme.palette.pne.ramp` — шкала бренда скина, шаги `PNE_BRAND_RAMP_STEPS` (от `0` до `950`): `0` — белый,
2524
+ `600` — заливка, `950` — самый тёмный. Вне темы ту же шкалу строит `createPneBrandRamp(skinColor)`
2495
2525
  из одного цвета скина;
2496
- - `PNE_NEUTRAL_RAMP` — нейтральная шкала, шаги от `0` до `950`, одинаковая для всех скинов;
2497
- - `PNE_STATUS_COLORS` — шкалы `error` и `warning`, одинаковые для всех скинов;
2526
+ - `PNE_NEUTRAL_RAMP` — нейтральная шкала, шаги от `0` до `1050`, одинаковая для всех скинов;
2527
+ - `PNE_STATUS_COLORS` — шкалы `error`, `warning` и `success` с шагами от `50` до `950`, одинаковые для
2528
+ всех скинов;
2498
2529
  - `theme.palette.pne.button`, `.switch`, `.checkbox`, `.field` и `.dropdown` — готовые цвета компонентов
2499
2530
  по ролям UI Kit и состояниям, уже подобранные под светлую и тёмную схему; `focusRing` и `link` — цвет
2500
2531
  кольца фокуса и текста ссылки.
2501
2532
 
2533
+ Заливка (шаг `600`) — это цвет скина, если белая подпись читается на нём при 4,5:1. Светлый цвет скина,
2534
+ на котором белая подпись не читается и при 3:1, тоже остаётся заливкой и берёт тёмную подпись. Цвет между
2535
+ ними темнеет до светлоты заливки UI Kit, пока белая подпись не читается при 4,5:1. Остальные шаги — шкала
2536
+ бренда UI Kit, перенесённая на эту заливку: для `#026FD7` выходит шкала UI Kit точно.
2537
+
2502
2538
  Шкалы от схемы не зависят, поэтому для своего элемента берите готовую роль, а не шаг шкалы: роль остаётся
2503
2539
  читаемой и в тёмной схеме, и при любом скине. `resolvePneSemanticPalette(theme)` возвращает
2504
2540
  `theme.palette.pne`, а для темы, созданной без `createPneTheme`, строит такую же палитру из `primary.main`.
package/cjs/brandRamp.js CHANGED
@@ -1,49 +1,73 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPneBrandRamp = exports.PNE_BRAND_RAMP_STEPS = void 0;
3
+ exports.createPneBrandRamp = exports.PNE_LIGHT_FILL_CONTRAST = exports.PNE_LABEL_CONTRAST = exports.PNE_BRAND_RAMP_STEPS = void 0;
4
4
  const color_1 = require("./color");
5
- /** Steps of the brand ramp as in UI Kit (Claude): 0 is white, 500 is the skin colour, 1000 the darkest. */
6
- exports.PNE_BRAND_RAMP_STEPS = [
7
- 0, 50, 100, 150, 200, 300, 400, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000,
8
- ];
9
- // UI Kit mixes its seed with white for the lighter steps and with step 1000 for the darker ones.
10
- const WHITE_SHARE = {
11
- 0: 1, 50: 0.95, 100: 0.8, 150: 0.7, 200: 0.6, 300: 0.4, 400: 0.2,
12
- };
13
- const ANCHOR_SHARE = {
14
- 550: 0.1, 600: 0.2, 650: 0.3, 700: 0.4, 750: 0.5, 800: 0.6, 850: 0.7, 900: 0.8, 950: 0.95, 1000: 1,
15
- };
16
- // UI Kit's step 1000 for its seed #007DFF is #2E445B: the seed's hue at 45/137 of its
17
- // saturation and 137/255 of its lightness. Scaling keeps the same relation for any skin.
18
- const ANCHOR_SATURATION = 45 / 137;
19
- const ANCHOR_LIGHTNESS = 137 / 255;
20
- // UI Kit rounds halves to even (green of #007DFF step 50 is 248.5 → 248), so the ramp does too.
21
- const roundHalfToEven = (value) => {
22
- const floor = Math.floor(value);
23
- if (Math.abs(value - floor - 0.5) > 1e-9)
24
- return Math.round(value);
25
- return floor % 2 === 0 ? floor : floor + 1;
26
- };
27
- const mix = (color, target, share) => {
28
- const source = (0, color_1.hexToRgb)(color);
29
- const goal = (0, color_1.hexToRgb)(target);
30
- const [red, green, blue] = source.map((channel, index) => roundHalfToEven(channel + (goal[index] - channel) * share));
31
- return (0, color_1.rgbToHex)(red, green, blue);
5
+ /** Steps of the brand ramp as in UI Kit (Claude): 0 is white, 600 is the fill, 950 the darkest. */
6
+ exports.PNE_BRAND_RAMP_STEPS = [0, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
7
+ /** The UI Kit brand ramp. Its steps share one hue and go down in even OKLCH lightness. */
8
+ const UI_KIT_BRAND_RAMP = Object.freeze({
9
+ 0: '#FFFFFF',
10
+ 50: '#F7FAFE',
11
+ 100: '#EBF3FF',
12
+ 200: '#D7E8FF',
13
+ 300: '#B3D4FF',
14
+ 400: '#80B7FE',
15
+ 500: '#3E95FE',
16
+ 600: '#026FD7',
17
+ 700: '#005EB9',
18
+ 800: '#004B96',
19
+ 900: '#003670',
20
+ 950: '#002552',
21
+ });
22
+ const FILL_STEP = 600;
23
+ const WHITE = '#FFFFFF';
24
+ /** A white label reads on a fill from this contrast on (WCAG AA). */
25
+ exports.PNE_LABEL_CONTRAST = 4.5;
26
+ /**
27
+ * Below this contrast with white a skin colour is a light one: it stays the fill as it is and
28
+ * carries a dark label. From it on the fill carries a white label.
29
+ */
30
+ exports.PNE_LIGHT_FILL_CONTRAST = 3;
31
+ const [UI_KIT_FILL_LIGHTNESS, UI_KIT_FILL_CHROMA, UI_KIT_FILL_HUE] = (0, color_1.hexToOklch)(UI_KIT_BRAND_RAMP[FILL_STEP]);
32
+ const LIGHTNESS_STEP = 0.005;
33
+ /**
34
+ * The fill of a skin, step 600. A skin colour on which a white label reads at 4.5:1 is the fill
35
+ * itself, and so is a light one, which takes a dark label. A mid-tone in between goes down to the
36
+ * lightness of the UI Kit fill, and further if white still does not read on it at 4.5:1.
37
+ */
38
+ const createFill = (skinColor) => {
39
+ const whiteContrast = (0, color_1.contrastRatio)(skinColor, WHITE);
40
+ if (whiteContrast >= exports.PNE_LABEL_CONTRAST || whiteContrast < exports.PNE_LIGHT_FILL_CONTRAST)
41
+ return skinColor;
42
+ const [skinLightness, chroma, hue] = (0, color_1.hexToOklch)(skinColor);
43
+ let lightness = Math.min(skinLightness, UI_KIT_FILL_LIGHTNESS);
44
+ let fill = (0, color_1.oklchToHex)(lightness, chroma, hue);
45
+ while ((0, color_1.contrastRatio)(fill, WHITE) < exports.PNE_LABEL_CONTRAST && lightness > 0) {
46
+ lightness -= LIGHTNESS_STEP;
47
+ fill = (0, color_1.oklchToHex)(lightness, chroma, hue);
48
+ }
49
+ return fill;
32
50
  };
33
51
  /**
34
- * Builds the brand ramp from the one colour a Paynet skin has (`experimentalColor`), the way
35
- * UI Kit builds its own: the skin colour is step 500. For the UI Kit seed #007DFF the result
36
- * is exactly the UI Kit brand ramp.
52
+ * Builds the brand ramp from the one colour a Paynet skin has (`experimentalColor`): the UI Kit
53
+ * brand ramp moved to the fill of the skin. The lighter steps keep their share of the way from the
54
+ * fill to white. The darker ones keep their distance from the fill, or their ratio to it when that
55
+ * is darker. Chroma and hue follow the fill the way the UI Kit steps follow the UI Kit fill. For
56
+ * the UI Kit brand colour #026FD7 the result is exactly the UI Kit brand ramp.
37
57
  */
38
58
  const createPneBrandRamp = (skinColor) => {
39
- const seed = (0, color_1.normalizeHexColor)(skinColor);
40
- const [hue, saturation, lightness] = (0, color_1.hexToHsl)(seed);
41
- const anchor = (0, color_1.hslToHex)(hue, saturation * ANCHOR_SATURATION, lightness * ANCHOR_LIGHTNESS);
59
+ const fill = createFill((0, color_1.normalizeHexColor)(skinColor));
60
+ const [fillLightness, fillChroma, fillHue] = (0, color_1.hexToOklch)(fill);
42
61
  const entries = exports.PNE_BRAND_RAMP_STEPS.map(step => {
43
- const whiteShare = WHITE_SHARE[step];
44
- if (whiteShare !== undefined)
45
- return [step, mix(seed, '#FFFFFF', whiteShare)];
46
- return [step, mix(seed, anchor, ANCHOR_SHARE[step] ?? 0)];
62
+ if (step === 0)
63
+ return [step, WHITE];
64
+ if (step === FILL_STEP)
65
+ return [step, fill];
66
+ const [lightness, chroma, hue] = (0, color_1.hexToOklch)(UI_KIT_BRAND_RAMP[step]);
67
+ const stepLightness = step < FILL_STEP
68
+ ? 1 - (1 - fillLightness) * (1 - lightness) / (1 - UI_KIT_FILL_LIGHTNESS)
69
+ : Math.max(0, Math.min(fillLightness - (UI_KIT_FILL_LIGHTNESS - lightness), fillLightness * lightness / UI_KIT_FILL_LIGHTNESS));
70
+ return [step, (0, color_1.oklchToHex)(stepLightness, chroma * fillChroma / UI_KIT_FILL_CHROMA, fillHue + hue - UI_KIT_FILL_HUE)];
47
71
  });
48
72
  return Object.freeze(Object.fromEntries(entries));
49
73
  };
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPneLinkColor = exports.createPneFocusRing = exports.createPneButtonPalette = exports.brandFillSteps = exports.labelOnFill = exports.deeperStep = exports.readableBrandStep = exports.readsOnDarkSurfaces = void 0;
3
+ exports.createPneLinkColor = exports.createPneFocusRing = exports.createPneButtonPalette = exports.brandFillSteps = exports.brandFillStep = exports.markOnFill = exports.labelOnFill = exports.deeperStep = exports.readableBrandStep = exports.readsOnDarkSurfaces = void 0;
4
4
  const styles_1 = require("@mui/material/styles");
5
5
  const brandRamp_1 = require("./brandRamp");
6
+ const color_1 = require("./color");
6
7
  const themeColors_1 = require("./themeColors");
7
8
  const TRANSPARENT = 'transparent';
9
+ const WHITE = '#FFFFFF';
10
+ const BLACK = '#000000';
11
+ const DARK_LABEL = 'rgba(0, 0, 0, 0.87)';
8
12
  const MIN_UI_CONTRAST = 3;
9
13
  const DISTINCT_STEP_CONTRAST = 1.15;
10
- const LIGHT_SURFACES = ['#FFFFFF', themeColors_1.PNE_LIGHT_COLORS.surfaceSubtle];
14
+ // UI Kit `--elevation-item-active`.
15
+ const ACTIVE_SHADOW = '0px 0px 4px 0px rgba(0,0,0,0.04), 0px 4px 8px 0px rgba(0,0,0,0.06)';
16
+ const LIGHT_SURFACES = [WHITE, themeColors_1.PNE_NEUTRAL_RAMP[100]];
11
17
  const DARK_SURFACES = [
12
18
  themeColors_1.PNE_DARK_COLORS.backgroundDefault,
13
19
  themeColors_1.PNE_DARK_COLORS.backgroundPaper,
@@ -15,16 +21,19 @@ const DARK_SURFACES = [
15
21
  themeColors_1.PNE_DARK_COLORS.surfaceSubtle,
16
22
  themeColors_1.PNE_DARK_COLORS.surfaceRaised,
17
23
  ];
18
- const readsOn = (color, surfaces) => surfaces.every(surface => (0, styles_1.getContrastRatio)(color, surface) >= MIN_UI_CONTRAST);
24
+ const readsOn = (color, surfaces, minimum = MIN_UI_CONTRAST) => surfaces.every(surface => (0, color_1.contrastRatio)(color, surface) >= minimum);
19
25
  /** Whether a fill is distinguishable (3:1) from every dark-theme surface. */
20
26
  const readsOnDarkSurfaces = (color) => readsOn(color, DARK_SURFACES);
21
27
  exports.readsOnDarkSurfaces = readsOnDarkSurfaces;
22
- /** Rule 1: the first step from `step` away from the page that reads at 3:1 on the page surfaces. */
23
- const readableBrandStep = (ramp, step, mode) => {
28
+ /**
29
+ * Rule 1: the first step from `step` away from the page that reads on the page surfaces, at 3:1
30
+ * for a ring or a mark and at 4.5:1 (`PNE_LABEL_CONTRAST`) for text.
31
+ */
32
+ const readableBrandStep = (ramp, step, mode, minimum = MIN_UI_CONTRAST) => {
24
33
  const order = mode === 'dark' ? [...brandRamp_1.PNE_BRAND_RAMP_STEPS].reverse() : [...brandRamp_1.PNE_BRAND_RAMP_STEPS];
25
34
  const surfaces = mode === 'dark' ? DARK_SURFACES : LIGHT_SURFACES;
26
35
  const candidates = order.slice(Math.max(order.indexOf(step), 0));
27
- return candidates.find(candidate => readsOn(ramp[candidate], surfaces)) ?? candidates[candidates.length - 1];
36
+ return candidates.find(candidate => readsOn(ramp[candidate], surfaces, minimum)) ?? candidates[candidates.length - 1];
28
37
  };
29
38
  exports.readableBrandStep = readableBrandStep;
30
39
  /** The step at least as far from the page as `floor`: the darker one in light, the lighter in dark. */
@@ -32,110 +41,189 @@ const deeperStep = (step, floor, mode) => (mode === 'dark' ? Math.min(step, floo
32
41
  exports.deeperStep = deeperStep;
33
42
  /** Rule 3: the label colour on a fill. */
34
43
  const labelOnFill = (fill, mode) => {
35
- if (mode === 'dark') {
36
- return (0, styles_1.getContrastRatio)(fill, '#000000') >= (0, styles_1.getContrastRatio)(fill, '#FFFFFF') ? '#000000' : '#FFFFFF';
37
- }
38
- return (0, styles_1.getContrastRatio)(fill, '#FFFFFF') >= MIN_UI_CONTRAST ? '#FFFFFF' : 'rgba(0, 0, 0, 0.87)';
44
+ const whiteContrast = (0, color_1.contrastRatio)(fill, WHITE);
45
+ const darkIsStronger = (0, color_1.contrastRatio)(fill, BLACK) >= whiteContrast;
46
+ if (mode === 'dark')
47
+ return darkIsStronger ? BLACK : WHITE;
48
+ if (whiteContrast >= brandRamp_1.PNE_LABEL_CONTRAST)
49
+ return WHITE;
50
+ return darkIsStronger ? DARK_LABEL : WHITE;
39
51
  };
40
52
  exports.labelOnFill = labelOnFill;
53
+ /**
54
+ * The knob of a switch or another solid mark on a fill: white, as in the UI Kit, while it reads
55
+ * at 3:1, dark on a light fill.
56
+ */
57
+ const markOnFill = (fill) => (0, color_1.contrastRatio)(fill, WHITE) >= MIN_UI_CONTRAST ? WHITE : DARK_LABEL;
58
+ exports.markOnFill = markOnFill;
59
+ /** The step a brand fill takes: 600 in the light theme, the lighter 500 on the dark surfaces. */
60
+ const brandFillStep = (mode) => mode === 'dark' ? 500 : 600;
61
+ exports.brandFillStep = brandFillStep;
41
62
  /** Rule 2: hover and pressed steps of a brand fill. */
42
63
  const brandFillSteps = (ramp, mode) => {
43
- const darkerIsVisible = (0, styles_1.getContrastRatio)(ramp[500], ramp[600]) >= DISTINCT_STEP_CONTRAST;
44
- if (mode === 'dark')
64
+ if (mode === 'dark') {
65
+ const darkerIsVisible = (0, color_1.contrastRatio)(ramp[500], ramp[600]) >= DISTINCT_STEP_CONTRAST;
45
66
  return { hover: 400, pressed: darkerIsVisible ? 600 : 300 };
46
- return darkerIsVisible ? { hover: 600, pressed: 700 } : { hover: 400, pressed: 300 };
67
+ }
68
+ const darkerIsVisible = (0, color_1.contrastRatio)(ramp[600], ramp[700]) >= DISTINCT_STEP_CONTRAST;
69
+ return darkerIsVisible ? { hover: 700, pressed: 800 } : { hover: 500, pressed: 400 };
47
70
  };
48
71
  exports.brandFillSteps = brandFillSteps;
72
+ /** The brand text of the light theme: UI Kit step 700, pressed 800, moved by rule 1. */
73
+ const lightBrandText = (ramp) => {
74
+ const step = (0, exports.readableBrandStep)(ramp, 700, 'light', brandRamp_1.PNE_LABEL_CONTRAST);
75
+ return { text: ramp[step], pressed: ramp[(0, exports.deeperStep)(800, step, 'light')] };
76
+ };
77
+ /** The brand text of the dark theme: step 300, pressed 200, moved by rule 1. */
78
+ const darkBrandText = (ramp) => {
79
+ const step = (0, exports.readableBrandStep)(ramp, 300, 'dark', brandRamp_1.PNE_LABEL_CONTRAST);
80
+ return { text: ramp[step], pressed: ramp[(0, exports.deeperStep)(200, step, 'dark')] };
81
+ };
49
82
  const filled = (fill, mode, border = TRANSPARENT) => ({
50
83
  fill,
51
84
  border,
52
85
  text: (0, exports.labelOnFill)(fill, mode),
53
86
  });
54
87
  const createPrimary = (ramp, mode) => {
88
+ const fill = ramp[(0, exports.brandFillStep)(mode)];
55
89
  const steps = (0, exports.brandFillSteps)(ramp, mode);
56
90
  // In the dark theme a fill that does not read on the surfaces gets a ring that does.
57
- const ring = mode === 'dark' && !readsOn(ramp[500], DARK_SURFACES)
91
+ const ring = mode === 'dark' && !readsOn(fill, DARK_SURFACES)
58
92
  ? ramp[(0, exports.readableBrandStep)(ramp, 500, mode)]
59
93
  : TRANSPARENT;
60
94
  return {
61
- default: filled(ramp[500], mode, ring),
95
+ default: filled(fill, mode, ring),
62
96
  hover: filled(ramp[steps.hover], mode, ring),
63
97
  pressed: filled(ramp[steps.pressed], mode, ring),
98
+ focus: filled(fill, mode, ring),
64
99
  disabled: mode === 'dark'
65
100
  ? { fill: themeColors_1.PNE_DARK_COLORS.actionDisabledBackground, border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textDisabled }
66
101
  : { fill: themeColors_1.PNE_NEUTRAL_RAMP[400], border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[0] },
67
102
  };
68
103
  };
104
+ // Secondary: a brand ring; the fill tints under the pointer in the light theme.
69
105
  const createOutline = (ramp, mode) => {
70
106
  if (mode === 'dark') {
71
107
  const border = (0, exports.readableBrandStep)(ramp, 400, mode);
72
- const text = (0, exports.readableBrandStep)(ramp, 300, mode);
108
+ const { text, pressed } = darkBrandText(ramp);
109
+ const resting = { fill: TRANSPARENT, border: ramp[border], text };
73
110
  return {
74
- default: { fill: TRANSPARENT, border: ramp[border], text: ramp[text] },
75
- hover: { fill: TRANSPARENT, border: ramp[(0, exports.deeperStep)(300, border, mode)], text: ramp[text] },
76
- pressed: { fill: TRANSPARENT, border: ramp[(0, exports.deeperStep)(300, border, mode)], text: ramp[(0, exports.deeperStep)(200, text, mode)] },
111
+ default: resting,
112
+ hover: { fill: TRANSPARENT, border: ramp[(0, exports.deeperStep)(300, border, mode)], text },
113
+ pressed: { fill: TRANSPARENT, border: ramp[(0, exports.deeperStep)(300, border, mode)], text: pressed },
114
+ focus: resting,
77
115
  disabled: { fill: TRANSPARENT, border: themeColors_1.PNE_DARK_COLORS.textDisabled, text: themeColors_1.PNE_DARK_COLORS.textDisabled },
78
116
  };
79
117
  }
80
- const base = (0, exports.readableBrandStep)(ramp, 500, mode);
81
- const pressed = (0, exports.deeperStep)(700, base, mode);
118
+ const border = (0, exports.readableBrandStep)(ramp, 600, mode);
119
+ const borderHover = ramp[(0, exports.deeperStep)(700, border, mode)];
120
+ const { text, pressed } = lightBrandText(ramp);
82
121
  return {
83
- default: { fill: TRANSPARENT, border: ramp[base], text: ramp[base] },
84
- hover: { fill: TRANSPARENT, border: ramp[pressed], text: ramp[base] },
85
- pressed: { fill: TRANSPARENT, border: ramp[pressed], text: ramp[pressed] },
86
- disabled: { fill: TRANSPARENT, border: themeColors_1.PNE_NEUTRAL_RAMP[400], text: themeColors_1.PNE_NEUTRAL_RAMP[400] },
122
+ default: { fill: TRANSPARENT, border: ramp[border], text },
123
+ hover: { fill: ramp[100], border: borderHover, text },
124
+ pressed: { fill: ramp[200], border: borderHover, text: pressed },
125
+ focus: { fill: themeColors_1.PNE_NEUTRAL_RAMP[50], border: ramp[border], text },
126
+ disabled: { fill: themeColors_1.PNE_NEUTRAL_RAMP[50], border: themeColors_1.PNE_NEUTRAL_RAMP[400], text: themeColors_1.PNE_NEUTRAL_RAMP[400] },
87
127
  };
88
128
  };
89
- // Tertiary: the light tab group without its Active state; neutral, so every skin reads the same.
90
- const createText = (mode) => mode === 'dark'
91
- ? {
92
- default: { fill: themeColors_1.PNE_DARK_COLORS.surfaceSubtle, border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textSecondary },
93
- hover: { fill: themeColors_1.PNE_DARK_COLORS.surfaceRaised, border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textPrimary },
94
- pressed: { fill: themeColors_1.PNE_DARK_COLORS.surfacePressed, border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textPrimary },
95
- disabled: { fill: TRANSPARENT, border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textDisabled },
129
+ // Tertiary: one sunken fill at rest, under the pointer and disabled; the label carries the state.
130
+ // Active is the picked item of a set. A tone colours the label and tints the fill under the pointer.
131
+ const createText = (mode, resting, tone) => {
132
+ if (mode === 'dark') {
133
+ const d = themeColors_1.PNE_DARK_COLORS;
134
+ const base = { fill: d.surfaceSubtle, border: TRANSPARENT, text: resting };
135
+ return {
136
+ default: base,
137
+ hover: { fill: tone.hoverFill, border: TRANSPARENT, text: tone.text },
138
+ pressed: { fill: d.surfacePressed, border: TRANSPARENT, text: tone.pressed },
139
+ focus: base,
140
+ disabled: { fill: d.surfaceSubtle, border: TRANSPARENT, text: d.textDisabled },
141
+ };
96
142
  }
97
- : {
98
- default: { fill: themeColors_1.PNE_NEUTRAL_RAMP[50], border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[800] },
99
- hover: { fill: themeColors_1.PNE_NEUTRAL_RAMP[100], border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[900] },
100
- pressed: { fill: themeColors_1.PNE_NEUTRAL_RAMP[200], border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[800] },
101
- disabled: { fill: TRANSPARENT, border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[400] },
143
+ const n = themeColors_1.PNE_NEUTRAL_RAMP;
144
+ const base = { fill: n[100], border: TRANSPARENT, text: resting };
145
+ return {
146
+ default: base,
147
+ hover: { fill: tone.hoverFill, border: TRANSPARENT, text: tone.text },
148
+ pressed: { fill: n[200], border: TRANSPARENT, text: tone.pressed },
149
+ focus: base,
150
+ disabled: { fill: n[100], border: TRANSPARENT, text: n[400] },
151
+ };
152
+ };
153
+ const createTertiary = (ramp, mode) => {
154
+ if (mode === 'dark') {
155
+ const d = themeColors_1.PNE_DARK_COLORS;
156
+ return {
157
+ ...createText(mode, d.textSecondary, { text: d.textPrimary, pressed: d.textPrimary, hoverFill: d.surfaceRaised }),
158
+ active: { fill: d.surfacePressed, border: TRANSPARENT, text: d.textPrimary, shadow: ACTIVE_SHADOW },
159
+ };
160
+ }
161
+ const n = themeColors_1.PNE_NEUTRAL_RAMP;
162
+ const { text, pressed } = lightBrandText(ramp);
163
+ return {
164
+ ...createText(mode, n[700], { text, pressed, hoverFill: n[100] }),
165
+ active: { fill: n[0], border: TRANSPARENT, text: n[700], shadow: ACTIVE_SHADOW },
102
166
  };
167
+ };
168
+ const createTonedTertiary = (ramp, colors, mode) => {
169
+ const text = colors[mode === 'dark' ? 300 : 700];
170
+ const hoverFill = mode === 'dark' ? themeColors_1.PNE_DARK_COLORS.surfaceRaised : ramp[100];
171
+ return createText(mode, text, { text, pressed: text, hoverFill });
172
+ };
173
+ const createActivated = (mode) => {
174
+ const colors = themeColors_1.PNE_STATUS_COLORS.success;
175
+ return mode === 'dark'
176
+ ? { fill: colors[900], border: colors[700], text: colors[300] }
177
+ : { fill: colors[100], border: colors[300], text: colors[700] };
178
+ };
179
+ // Soft: a brand label on the sunken fill; the fill tints under the pointer.
103
180
  const createSoft = (ramp, mode) => {
104
181
  if (mode === 'dark') {
105
- const text = ramp[(0, exports.readableBrandStep)(ramp, 300, mode)];
106
- const pressedText = ramp[(0, exports.deeperStep)(200, (0, exports.readableBrandStep)(ramp, 300, mode), mode)];
182
+ const { text, pressed } = darkBrandText(ramp);
183
+ const resting = { fill: TRANSPARENT, border: TRANSPARENT, text };
107
184
  return {
108
- default: { fill: TRANSPARENT, border: TRANSPARENT, text },
185
+ default: resting,
109
186
  hover: { fill: (0, styles_1.alpha)(text, 0.10), border: TRANSPARENT, text },
110
- pressed: { fill: (0, styles_1.alpha)(text, 0.16), border: TRANSPARENT, text: pressedText },
187
+ pressed: { fill: (0, styles_1.alpha)(text, 0.16), border: TRANSPARENT, text: pressed },
188
+ focus: resting,
111
189
  disabled: { fill: TRANSPARENT, border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textDisabled },
112
190
  };
113
191
  }
114
- const base = (0, exports.readableBrandStep)(ramp, 500, mode);
192
+ const n = themeColors_1.PNE_NEUTRAL_RAMP;
193
+ const { text, pressed } = lightBrandText(ramp);
194
+ const resting = { fill: n[100], border: TRANSPARENT, text };
115
195
  return {
116
- default: { fill: TRANSPARENT, border: TRANSPARENT, text: ramp[base] },
117
- hover: { fill: ramp[50], border: TRANSPARENT, text: ramp[base] },
118
- pressed: { fill: ramp[100], border: TRANSPARENT, text: ramp[(0, exports.deeperStep)(700, base, mode)] },
119
- disabled: { fill: TRANSPARENT, border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[400] },
196
+ default: resting,
197
+ hover: { fill: ramp[100], border: TRANSPARENT, text },
198
+ pressed: { fill: ramp[200], border: TRANSPARENT, text: pressed },
199
+ focus: resting,
200
+ disabled: { fill: n[100], border: TRANSPARENT, text: n[400] },
120
201
  };
121
202
  };
122
203
  const createStatus = (colors, mode) => mode === 'dark'
123
204
  ? {
124
- default: filled(colors[650], mode),
205
+ default: filled(colors[600], mode),
125
206
  hover: filled(colors[500], mode),
126
- pressed: filled(colors[750], mode),
127
- disabled: filled(colors[700], mode),
207
+ pressed: filled(colors[700], mode),
208
+ focus: filled(colors[600], mode),
209
+ disabled: { fill: colors[900], border: TRANSPARENT, text: themeColors_1.PNE_DARK_COLORS.textDisabled },
128
210
  }
129
211
  : {
130
- default: filled(colors[650], mode),
131
- hover: filled(colors[750], mode),
132
- pressed: filled(colors[850], mode),
212
+ default: filled(colors[600], mode),
213
+ hover: filled(colors[700], mode),
214
+ pressed: filled(colors[800], mode),
215
+ focus: filled(colors[600], mode),
133
216
  disabled: { fill: colors[300], border: TRANSPARENT, text: themeColors_1.PNE_NEUTRAL_RAMP[0] },
134
217
  };
135
218
  const createPneButtonPalette = (ramp, mode) => ({
136
219
  primary: createPrimary(ramp, mode),
137
220
  outline: createOutline(ramp, mode),
138
- text: createText(mode),
221
+ text: createTertiary(ramp, mode),
222
+ textDanger: createTonedTertiary(ramp, themeColors_1.PNE_STATUS_COLORS.error, mode),
223
+ textSuccess: {
224
+ ...createTonedTertiary(ramp, themeColors_1.PNE_STATUS_COLORS.success, mode),
225
+ activated: createActivated(mode),
226
+ },
139
227
  soft: createSoft(ramp, mode),
140
228
  destructive: createStatus(themeColors_1.PNE_STATUS_COLORS.error, mode),
141
229
  warning: createStatus(themeColors_1.PNE_STATUS_COLORS.warning, mode),
@@ -144,6 +232,6 @@ exports.createPneButtonPalette = createPneButtonPalette;
144
232
  /** The outer 2px of the keyboard focus ring (UI Kit Focus/Ring: brand 600 light, 300 dark). */
145
233
  const createPneFocusRing = (ramp, mode) => ramp[(0, exports.readableBrandStep)(ramp, mode === 'dark' ? 300 : 600, mode)];
146
234
  exports.createPneFocusRing = createPneFocusRing;
147
- /** Link text (UI Kit Tx/Link: brand 400 light, 200 dark). */
148
- const createPneLinkColor = (ramp, mode) => ramp[(0, exports.readableBrandStep)(ramp, mode === 'dark' ? 200 : 400, mode)];
235
+ /** Link text (UI Kit Tx/Link: brand 700 light, 200 dark). */
236
+ const createPneLinkColor = (ramp, mode) => ramp[(0, exports.readableBrandStep)(ramp, mode === 'dark' ? 200 : 700, mode, brandRamp_1.PNE_LABEL_CONTRAST)];
149
237
  exports.createPneLinkColor = createPneLinkColor;