@editora/ui-core 0.1.25 → 0.2.1
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 +132 -0
- package/dist/accordion.cjs.js +13 -12
- package/dist/accordion.esm.js +13 -12
- package/dist/alert-dialog.cjs.js +92 -53
- package/dist/alert-dialog.esm.js +211 -159
- package/dist/alert.cjs.js +42 -33
- package/dist/alert.esm.js +80 -71
- package/dist/animated-beam.cjs.js +42 -50
- package/dist/animated-beam.esm.js +47 -55
- package/dist/animated-list.cjs.js +11 -27
- package/dist/animated-list.esm.js +12 -28
- package/dist/animated-text.cjs.js +9 -9
- package/dist/animated-text.esm.js +9 -9
- package/dist/app-header.cjs.js +17 -12
- package/dist/app-header.esm.js +18 -13
- package/dist/aspect-ratio.cjs.js +10 -12
- package/dist/aspect-ratio.esm.js +11 -13
- package/dist/avatar.cjs.js +16 -20
- package/dist/avatar.esm.js +16 -20
- package/dist/badge.cjs.js +27 -22
- package/dist/badge.esm.js +32 -27
- package/dist/block-controls.cjs.js +11 -12
- package/dist/block-controls.esm.js +8 -9
- package/dist/box.cjs.js +2 -3
- package/dist/box.esm.js +2 -3
- package/dist/breadcrumb.cjs.js +12 -18
- package/dist/breadcrumb.esm.js +11 -17
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/{calendar-D-mXMgqc.js → calendar-CzpWDxLc.js} +56 -46
- package/dist/{calendar-B3PUKHQm.mjs → calendar-DkSDFg33.mjs} +127 -117
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/card.cjs.js +6 -7
- package/dist/card.esm.js +5 -6
- package/dist/chart.cjs.js +58 -52
- package/dist/chart.esm.js +101 -95
- package/dist/checkbox.cjs.js +19 -15
- package/dist/checkbox.esm.js +19 -15
- package/dist/collapsible.cjs.js +9 -13
- package/dist/collapsible.esm.js +9 -13
- package/dist/color-picker.cjs.js +38 -19
- package/dist/color-picker.esm.js +134 -115
- package/dist/combobox.cjs.js +60 -57
- package/dist/combobox.esm.js +96 -92
- package/dist/command-palette.cjs.js +1 -0
- package/dist/command-palette.esm.js +1 -0
- package/dist/command.cjs.js +32 -14
- package/dist/command.esm.js +46 -28
- package/dist/components/date-time-utils.d.ts.map +1 -1
- package/dist/components/ui-accordion.d.ts.map +1 -1
- package/dist/components/ui-alert-dialog.d.ts +2 -0
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-alert.d.ts.map +1 -1
- package/dist/components/ui-animated-beam.d.ts.map +1 -1
- package/dist/components/ui-animated-list.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
- package/dist/components/ui-avatar.d.ts.map +1 -1
- package/dist/components/ui-badge.d.ts.map +1 -1
- package/dist/components/ui-block-controls.d.ts.map +1 -1
- package/dist/components/ui-box.d.ts.map +1 -1
- package/dist/components/ui-breadcrumb.d.ts.map +1 -1
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-card.d.ts.map +1 -1
- package/dist/components/ui-chart.d.ts.map +1 -1
- package/dist/components/ui-checkbox.d.ts.map +1 -1
- package/dist/components/ui-collapsible.d.ts.map +1 -1
- package/dist/components/ui-color-picker.d.ts.map +1 -1
- package/dist/components/ui-combobox.d.ts.map +1 -1
- package/dist/components/ui-command-palette.d.ts.map +1 -1
- package/dist/components/ui-command.d.ts.map +1 -1
- package/dist/components/ui-container.d.ts.map +1 -1
- package/dist/components/ui-context-menu.d.ts.map +1 -1
- package/dist/components/ui-data-table.d.ts +7 -0
- package/dist/components/ui-data-table.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-dialog.d.ts +2 -0
- package/dist/components/ui-dialog.d.ts.map +1 -1
- package/dist/components/ui-dock.d.ts.map +1 -1
- package/dist/components/ui-drawer.d.ts.map +1 -1
- package/dist/components/ui-dropdown.d.ts.map +1 -1
- package/dist/components/ui-empty-state.d.ts.map +1 -1
- package/dist/components/ui-field.d.ts.map +1 -1
- package/dist/components/ui-fieldset.d.ts.map +1 -1
- package/dist/components/ui-file-upload.d.ts.map +1 -1
- package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
- package/dist/components/ui-form.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-icon-cloud.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-input.d.ts.map +1 -1
- package/dist/components/ui-marquee.d.ts.map +1 -1
- package/dist/components/ui-menu.d.ts.map +1 -1
- package/dist/components/ui-menubar.d.ts.map +1 -1
- package/dist/components/ui-meter.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-number-field.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-pagination.d.ts.map +1 -1
- package/dist/components/ui-password-field.d.ts.map +1 -1
- package/dist/components/ui-pin-input.d.ts.map +1 -1
- package/dist/components/ui-popover.d.ts.map +1 -1
- package/dist/components/ui-progress.d.ts.map +1 -1
- package/dist/components/ui-radio-group.d.ts.map +1 -1
- package/dist/components/ui-radio.d.ts.map +1 -1
- package/dist/components/ui-rating.d.ts +1 -0
- package/dist/components/ui-rating.d.ts.map +1 -1
- package/dist/components/ui-scroll-area.d.ts.map +1 -1
- package/dist/components/ui-section.d.ts.map +1 -1
- package/dist/components/ui-select.d.ts.map +1 -1
- package/dist/components/ui-selection-popup.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-slider.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts.map +1 -1
- package/dist/components/ui-spinning-text.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-splitter.d.ts.map +1 -1
- package/dist/components/ui-stepper.d.ts.map +1 -1
- package/dist/components/ui-switch.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-tags-input.d.ts.map +1 -1
- package/dist/components/ui-textarea.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/components/ui-toggle-group.d.ts +2 -0
- package/dist/components/ui-toggle-group.d.ts.map +1 -1
- package/dist/components/ui-toggle.d.ts.map +1 -1
- package/dist/components/ui-toolbar.d.ts +2 -0
- package/dist/components/ui-toolbar.d.ts.map +1 -1
- package/dist/components/ui-tooltip.d.ts.map +1 -1
- package/dist/components/ui-transfer-list.d.ts.map +1 -1
- package/dist/components/ui-tree-item.d.ts.map +1 -1
- package/dist/components/ui-tree.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/container.cjs.js +6 -12
- package/dist/container.esm.js +8 -14
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +42 -41
- package/dist/data-table.cjs.js +21 -18
- package/dist/data-table.esm.js +210 -190
- package/dist/date-field.cjs.js +9 -9
- package/dist/date-field.esm.js +19 -19
- package/dist/date-picker.cjs.js +29 -20
- package/dist/date-picker.esm.js +59 -50
- package/dist/date-range-picker.cjs.js +24 -19
- package/dist/date-range-picker.esm.js +86 -81
- package/dist/date-range-time-picker.cjs.js +27 -20
- package/dist/date-range-time-picker.esm.js +24 -17
- package/dist/date-time-picker.cjs.js +24 -17
- package/dist/date-time-picker.esm.js +89 -82
- package/dist/date-time-utils-C-4eHTyy.js +1 -0
- package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-zAx4ghvC.mjs} +75 -68
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +59 -43
- package/dist/dialog.esm.js +86 -53
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dock.cjs.js +16 -30
- package/dist/dock.esm.js +26 -40
- package/dist/drawer.cjs.js +8 -12
- package/dist/drawer.esm.js +6 -10
- package/dist/dropdown.cjs.js +8 -6
- package/dist/dropdown.esm.js +33 -30
- package/dist/empty-state.cjs.js +17 -15
- package/dist/empty-state.esm.js +13 -11
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +23 -14
- package/dist/field.esm.js +30 -21
- package/dist/fieldset.cjs.js +16 -9
- package/dist/fieldset.esm.js +19 -12
- package/dist/file-upload.cjs.js +79 -37
- package/dist/file-upload.esm.js +154 -112
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/floating-toolbar.cjs.js +6 -7
- package/dist/floating-toolbar.esm.js +8 -9
- package/dist/form.cjs.js +24 -27
- package/dist/form.esm.js +24 -27
- package/dist/gantt.cjs.js +13 -11
- package/dist/gantt.esm.js +13 -11
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +8 -8
- package/dist/hover-card.esm.js +18 -15
- package/dist/icon-cloud.cjs.js +19 -36
- package/dist/icon-cloud.esm.js +41 -58
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +108 -104
- package/dist/inline-edit.cjs.js +50 -22
- package/dist/inline-edit.esm.js +77 -49
- package/dist/input.cjs.js +45 -38
- package/dist/input.esm.js +60 -53
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- package/dist/layout.cjs.js +3 -3
- package/dist/layout.esm.js +3 -3
- package/dist/marquee.cjs.js +7 -10
- package/dist/marquee.esm.js +7 -10
- package/dist/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
- package/dist/menu.cjs.js +8 -24
- package/dist/menu.esm.js +52 -72
- package/dist/menubar.cjs.js +9 -31
- package/dist/menubar.esm.js +127 -153
- package/dist/meter.cjs.js +4 -9
- package/dist/meter.esm.js +6 -11
- package/dist/multi-select.cjs.js +53 -40
- package/dist/multi-select.esm.js +87 -73
- package/dist/navigation-menu.cjs.js +10 -10
- package/dist/navigation-menu.esm.js +33 -33
- package/dist/number-field.cjs.js +28 -17
- package/dist/number-field.esm.js +37 -26
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +9 -9
- package/dist/odometer.esm.js +17 -17
- package/dist/orbiter.cjs.js +11 -28
- package/dist/orbiter.esm.js +28 -45
- package/dist/overlay-motion-B56x1GoY.js +49 -0
- package/dist/overlay-motion-BX3dPLay.mjs +120 -0
- package/dist/pagination.cjs.js +28 -25
- package/dist/pagination.esm.js +54 -51
- package/dist/password-field.cjs.js +39 -34
- package/dist/password-field.esm.js +63 -58
- package/dist/pin-input.cjs.js +18 -14
- package/dist/pin-input.esm.js +24 -20
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/plugin-panel.cjs.js +1 -1
- package/dist/plugin-panel.esm.js +1 -1
- package/dist/popover.cjs.js +16 -28
- package/dist/popover.esm.js +29 -45
- package/dist/portal-DeaM1tYY.mjs +121 -0
- package/dist/portal-XbYR3m_q.js +1 -0
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.d.ts +3 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
- package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
- package/dist/positioner.cjs.js +1 -1
- package/dist/positioner.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/primitives/overlay-motion.d.ts +47 -0
- package/dist/primitives/overlay-motion.d.ts.map +1 -0
- package/dist/primitives/positioner.d.ts.map +1 -1
- package/dist/progress.cjs.js +11 -16
- package/dist/progress.esm.js +37 -42
- package/dist/quick-actions.cjs.js +14 -14
- package/dist/quick-actions.esm.js +12 -12
- package/dist/radio-group.cjs.js +50 -26
- package/dist/radio-group.esm.js +53 -29
- package/dist/radio.cjs.js +16 -13
- package/dist/radio.esm.js +16 -13
- package/dist/rating.cjs.js +11 -15
- package/dist/rating.esm.js +48 -50
- package/dist/{runtime-CFnK53iC.mjs → runtime-BRT7E4A8.mjs} +563 -531
- package/dist/runtime-CXw4SGV9.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.esm.js +36 -32
- package/dist/scroll-area.cjs.js +3 -4
- package/dist/scroll-area.esm.js +3 -4
- package/dist/section.cjs.js +2 -4
- package/dist/section.esm.js +2 -4
- package/dist/select.cjs.js +42 -75
- package/dist/select.esm.js +57 -89
- package/dist/selection-popup.cjs.js +3 -4
- package/dist/selection-popup.esm.js +3 -4
- package/dist/semantic-tokens.d.ts +17 -0
- package/dist/semantic-tokens.d.ts.map +1 -0
- package/dist/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +29 -28
- package/dist/sidebar.esm.js +32 -31
- package/dist/skeleton.cjs.js +2 -2
- package/dist/skeleton.esm.js +2 -2
- package/dist/slider.cjs.js +22 -26
- package/dist/slider.esm.js +25 -29
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +10 -11
- package/dist/sortable.esm.js +10 -11
- package/dist/spinning-text.cjs.js +4 -13
- package/dist/spinning-text.esm.js +4 -13
- package/dist/split-button.cjs.js +7 -7
- package/dist/split-button.esm.js +17 -16
- package/dist/splitter.cjs.js +52 -10
- package/dist/splitter.esm.js +55 -13
- package/dist/stepper.cjs.js +31 -65
- package/dist/stepper.esm.js +32 -66
- package/dist/switch.cjs.js +20 -22
- package/dist/switch.esm.js +20 -22
- package/dist/table.cjs.js +5 -5
- package/dist/table.esm.js +20 -20
- package/dist/tabs.cjs.js +101 -26
- package/dist/tabs.esm.js +187 -112
- package/dist/tags-input.cjs.js +43 -17
- package/dist/tags-input.esm.js +75 -49
- package/dist/textarea.cjs.js +34 -35
- package/dist/textarea.esm.js +50 -51
- package/dist/theme.d.ts +25 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +8 -8
- package/dist/time-field.esm.js +29 -29
- package/dist/time-picker.cjs.js +17 -14
- package/dist/time-picker.esm.js +28 -25
- package/dist/timeline.cjs.js +10 -10
- package/dist/timeline.esm.js +7 -7
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- package/dist/toggle-group.cjs.js +13 -13
- package/dist/toggle-group.esm.js +66 -61
- package/dist/toggle.cjs.js +52 -34
- package/dist/toggle.esm.js +80 -62
- package/dist/toolbar.cjs.js +14 -14
- package/dist/toolbar.esm.js +41 -33
- package/dist/tooltip.cjs.js +3 -3
- package/dist/tooltip.esm.js +39 -33
- package/dist/transfer-list.cjs.js +37 -38
- package/dist/transfer-list.esm.js +32 -33
- package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
- package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
- package/dist/tree-item.cjs.js +9 -8
- package/dist/tree-item.esm.js +13 -12
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +1 -1
- package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
- package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
- package/dist/wizard.cjs.js +51 -39
- package/dist/wizard.esm.js +51 -39
- package/package.json +1 -1
- package/dist/date-time-utils-y3AvNvGe.js +0 -1
- package/dist/portal-DgpQ3Jo1.js +0 -1
- package/dist/portal-bR42gHvG.mjs +0 -118
- package/dist/runtime-DwE-tizc.js +0 -1
package/README.md
CHANGED
|
@@ -541,6 +541,138 @@ argument:
|
|
|
541
541
|
Apply the theme early, before the first render. To theme one part of the page, call
|
|
542
542
|
`applyTheme(tokens, element)`.
|
|
543
543
|
|
|
544
|
+
Theme a part of the page with `applyTheme(tokens, element)` (or `ThemeProvider` in `@editora/ui-react`), not by
|
|
545
|
+
setting a few `--ui-color-*` variables yourself. The fills, lines and soft accent colours that components read
|
|
546
|
+
(`--ui-color-fill`, `--ui-color-line`, `--ui-color-accent-fill` and the like) are derived from the whole theme, so
|
|
547
|
+
overriding only `--ui-color-text` and `--ui-color-surface` on an element leaves them at the page theme. If you need
|
|
548
|
+
plain CSS, spread `themeToVariables(tokens)` (below) onto the element instead.
|
|
549
|
+
|
|
550
|
+
### Follow the system light/dark setting
|
|
551
|
+
|
|
552
|
+
```js
|
|
553
|
+
import { applySystemTheme } from '@editora/ui-core';
|
|
554
|
+
|
|
555
|
+
const stop = applySystemTheme({ accentPalette: 'blue' }); // stop() ends following the system
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
It applies the light or dark theme to match the operating system and switches live when the person changes it. The
|
|
559
|
+
mode is also written as `data-ui-mode="light|dark"` and `color-scheme` on the page, so your own CSS can follow it.
|
|
560
|
+
`light` and `dark` take token overrides for each mode.
|
|
561
|
+
|
|
562
|
+
### As a stylesheet (server rendering)
|
|
563
|
+
|
|
564
|
+
`themeToCss(tokens, ':root')` returns the same variables as CSS text, to put in a `<style>` tag or a `.css` file so the
|
|
565
|
+
first paint is themed without JavaScript. `themeToVariables(tokens)` returns them as a `{ name: value }` object.
|
|
566
|
+
|
|
567
|
+
### Tokens to build on
|
|
568
|
+
|
|
569
|
+
Every value below follows the accent palette, the gray scale and light/dark mode, so custom components that read them
|
|
570
|
+
stay on theme.
|
|
571
|
+
|
|
572
|
+
| Tokens | Meaning |
|
|
573
|
+
| --- | --- |
|
|
574
|
+
| `--ui-color-fill`, `-fill-hover`, `-fill-active` | resting, hover and pressed fill of a neutral control |
|
|
575
|
+
| `--ui-color-line-subtle`, `-line`, `-line-strong` | borders and separators, from quiet to strong |
|
|
576
|
+
| `--ui-color-text-secondary`, `-text-strong` | secondary and primary text |
|
|
577
|
+
| `--ui-color-accent-subtle`, `-accent-fill`, `-accent-fill-hover`, `-accent-fill-active` | tinted accent backgrounds |
|
|
578
|
+
| `--ui-color-accent-line`, `-accent-solid`, `-accent-solid-hover`, `-accent-text` | accent border, solid fill, solid hover and accent text |
|
|
579
|
+
| `--ui-color-surface-elevated`, `--ui-color-info` | raised surface (menus, popovers) and the informational colour |
|
|
580
|
+
| `--ui-color-placeholder` | placeholder text (62% of the text colour, 4.5:1 or better on the field) |
|
|
581
|
+
| `--ui-color-foreground-on-warning` | text on a solid warning fill: dark when the warning colour is light (amber) |
|
|
582
|
+
| `--ui-color-danger-text`, `-success-text`, `-warning-text`, `-info-text`, `-accent-text` | the status and accent hues as text: pulled toward the text colour until they read at 4.5:1 or better on the surface and on their own tint. The plain `--ui-color-danger` and the like are fill and icon colours (about 3-4:1 as text on white) |
|
|
583
|
+
| `--ui-color-danger-solid`, `-success-solid`, `--ui-color-foreground-on-danger`, `-on-success` | a solid fill that white text reads on, and that text colour |
|
|
584
|
+
| `--ui-ring-color`, `--ui-ring-width`, `--ui-ring-offset` | the focus ring |
|
|
585
|
+
| `--ui-control-height-{1..4}`, `--ui-control-font-size-{1..4}`, `--ui-control-padding-inline-{1..4}`, `--ui-control-radius-{1..4}` | the control scale: 24, 32, 40 and 48px (see below) |
|
|
586
|
+
| `--ui-motion-enter-easing`, `--ui-motion-exit-easing` | easing for things that appear and disappear |
|
|
587
|
+
|
|
588
|
+
### The default look
|
|
589
|
+
|
|
590
|
+
Light and dark, with the default amber accent (`radius` is 6px):
|
|
591
|
+
|
|
592
|
+
<p align="center">
|
|
593
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/look-light.png" alt="Buttons, fields, checkboxes, switches, badges, tabs and a card in the light theme" width="49%">
|
|
594
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-core/docs/images/look-dark.png" alt="The same components in the dark theme" width="49%">
|
|
595
|
+
</p>
|
|
596
|
+
|
|
597
|
+
- **Buttons** are flat fills with no shadow. `variant` picks the colour (`primary`, `danger`, `success`, `warning`,
|
|
598
|
+
neutral `secondary`, `ghost`) and `recipe` the style: `solid` (default), `soft`, `surface`, `outline`, `ghost` or
|
|
599
|
+
`classic`. Status fills are a shade deeper than the status colour so white text reads at 4.5:1.
|
|
600
|
+
- **Fields** (input, select, textarea, combobox, pickers) share a hairline border that darkens on hover, and a 2px
|
|
601
|
+
focus ring drawn inside it.
|
|
602
|
+
- **`ui-field`** is flat: label, control and message with no box. `variant="surface"`, `outline`, `soft`, `contrast` or
|
|
603
|
+
`elevated` draw the box.
|
|
604
|
+
- **Tabs** are a line: a hairline under the tabs and a 2px accent line under the selected one. The boxed pill look is
|
|
605
|
+
`variant="segmented"`; `soft`, `outline`, `solid`, `cards` and `indicator` keep working.
|
|
606
|
+
- **Cards** have a single hairline border and no shadow. **Badges** are soft tinted labels without a border
|
|
607
|
+
(`variant="solid"` for a filled one).
|
|
608
|
+
- **Alerts** are a tinted fill with a hairline in the tone colour and a plain icon; the coloured bar on the leading edge
|
|
609
|
+
is opt-in (`indicator="line"`). **Slider**, **progress** and **meter** are flat tracks (4–6px) with a solid fill; the
|
|
610
|
+
slider thumb is a white circle.
|
|
611
|
+
- **Avatars** are a soft tint with initials. **Breadcrumbs** show the current page in bold, with no pill.
|
|
612
|
+
**Pagination** is a row of 32px buttons with a solid accent for the current page, no bar around them.
|
|
613
|
+
- **Calendar** days are plain cells; the selected day is solid accent, the range a soft tint.
|
|
614
|
+
- **Accordion** and **collapsible** are one hairline box with dividers; the accent bar on an open item is opt-in
|
|
615
|
+
(`indicator="line"` on the accordion). **Stepper** steps have no card: the current one is a solid circle.
|
|
616
|
+
- **Toggle** and **toggle group** are outlined buttons that turn a soft accent when pressed (no dot glyph unless you pass
|
|
617
|
+
`icon-on` / `icon-off`). **Toolbar**, **hover card** and **drawer** take the same flat surface as popovers.
|
|
618
|
+
- **Pin input** slots are 40px (one control tall), **empty state** and **file upload** use a primary button.
|
|
619
|
+
- **Tables** (`ui-table`, `ui-data-table`) are a hairline frame with quiet dividers and a subtle header; **tree** rows are
|
|
620
|
+
32px with a soft accent for the selected one; **timeline**, **form**, **fieldset** and **stepper** have no box
|
|
621
|
+
(`variant="surface"`, `outline`, `soft`, `contrast` or `elevated` on `ui-form` and `ui-fieldset` draw it).
|
|
622
|
+
- **Sidebar**, **app header** and **navigation menu** use the 32px control rhythm and a soft accent for the current
|
|
623
|
+
item; **transfer list**, **chart**, **wizard** and **gantt** drop their nested boxes and heavy shadows.
|
|
624
|
+
- **Command**, **selection popup**, **floating toolbar** and **quick actions** share the flat overlay surface.
|
|
625
|
+
- **Marquee**, **animated list**, **spinning text**, **icon cloud**, **orbiter** and **dock** keep their motion but drop the
|
|
626
|
+
card chrome: a hairline frame, no shadow. **Layout**, **container** and **section** use the theme radius, and their
|
|
627
|
+
boxed variants use the theme shadows.
|
|
628
|
+
|
|
629
|
+
### Control sizes
|
|
630
|
+
|
|
631
|
+
Buttons and form controls share one scale, so a row of mixed controls lines up:
|
|
632
|
+
|
|
633
|
+
| `size` | Height | Text |
|
|
634
|
+
| --- | --- | --- |
|
|
635
|
+
| `sm` (or `1`) | 24px | 12px |
|
|
636
|
+
| default (`md`, `2`) | 32px | 14px |
|
|
637
|
+
| `lg` (or `3`) | 40px | 16px |
|
|
638
|
+
|
|
639
|
+
This covers `ui-button`, `ui-input`, `ui-password-field`, `ui-number-field`, `ui-select`, `ui-combobox`,
|
|
640
|
+
`ui-multi-select`, `ui-tags-input`, `ui-toggle`, `ui-textarea` and the date and time pickers. `ui-button` also takes
|
|
641
|
+
`scale="4"` for 48px. The control radius follows the theme's `radius`.
|
|
642
|
+
|
|
643
|
+
To change a size for the whole page, set the tokens, for example `:root { --ui-control-height-2: 36px; }`. To
|
|
644
|
+
change one control, use `--ui-control-min-height` (buttons) or `--ui-min-height` (inputs) on it. The older
|
|
645
|
+
`components.button['height-md']`-style theme values still work if you set them.
|
|
646
|
+
|
|
647
|
+
The 24px size is small for touch. Buttons inside a small field (clear, show password, the dropdown arrow) stay 24px
|
|
648
|
+
tall so they still meet the WCAG 2.2 minimum target size, but prefer the default size on touch screens.
|
|
649
|
+
|
|
650
|
+
## Overlays
|
|
651
|
+
|
|
652
|
+
Popovers, menus, dropdowns, selects, comboboxes, tooltips and dialogs share one set of behaviours.
|
|
653
|
+
|
|
654
|
+
**They animate in and out.** A surface fades and scales in from the side it opens on, and plays a quicker exit before it
|
|
655
|
+
is removed, so it no longer disappears with a pop. With `prefers-reduced-motion: reduce` there is no animation. Tune it
|
|
656
|
+
with CSS variables on the page: `--ui-overlay-in-duration` (150ms), `--ui-overlay-out-duration` (100ms) and
|
|
657
|
+
`--ui-overlay-shift` (4px), plus `--ui-motion-enter-easing` and `--ui-motion-exit-easing`.
|
|
658
|
+
|
|
659
|
+
**They expose their state for CSS.** The open surface carries `data-state="open"` or `"closed"`, and positioned ones
|
|
660
|
+
also `data-side` (`top`, `right`, `bottom`, `left`) and `data-align` (`start`, `center`, `end`), as Radix does:
|
|
661
|
+
|
|
662
|
+
```css
|
|
663
|
+
.ui-menu-surface[data-side="top"][data-state="open"] {
|
|
664
|
+
/* your own rule */
|
|
665
|
+
}
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
**Popovers, menus, tooltips, dropdown-style menus and dialogs sit in the browser's top layer**, above every `z-index` on
|
|
669
|
+
the page, so a sticky header with `z-index: 9999` can no longer cover them. This uses `popover="manual"` (Chrome 114,
|
|
670
|
+
Safari 17, Firefox 125); older browsers keep the previous `z-index` stacking. Dismissal (Escape, click outside) is still
|
|
671
|
+
handled by the components.
|
|
672
|
+
|
|
673
|
+
Not in the top layer: the panels of `ui-select`, `ui-dropdown`, `ui-combobox` and `ui-multi-select`, which open inside
|
|
674
|
+
their own field and are clipped like it; `ui-hover-card` and `ui-drawer`. They do have the state attributes and the motion.
|
|
675
|
+
|
|
544
676
|
## Floating positioning
|
|
545
677
|
|
|
546
678
|
The positioning engine behind the menus, popovers and tooltips is available on its own, from
|
package/dist/accordion.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
ui-accordion[data-ui-accordion-root="true"] {
|
|
3
3
|
display: block;
|
|
4
4
|
overflow-anchor: none;
|
|
5
|
-
--ui-accordion-radius: var(--base-card-radius, var(--ui-radius,
|
|
5
|
+
--ui-accordion-radius: var(--base-card-radius, var(--ui-radius, 6px));
|
|
6
6
|
--ui-accordion-accent: var(--ui-color-primary, var(--ui-primary, #2563eb));
|
|
7
7
|
--ui-accordion-border-color: color-mix(in srgb, var(--ui-color-border, rgba(15, 23, 42, 0.16)) 82%, transparent);
|
|
8
8
|
--ui-accordion-border: 1px solid var(--ui-accordion-border-color);
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
--ui-accordion-surface-alt-base: var(--color-surface, var(--ui-color-surface-alt, #f8fafc));
|
|
12
12
|
--ui-accordion-surface: var(--ui-accordion-surface-base);
|
|
13
13
|
--ui-accordion-surface-alt: var(--ui-accordion-surface-alt-base);
|
|
14
|
-
--ui-accordion-hover-surface: color-mix(in srgb, var(--ui-accordion-accent) 6%, var(--ui-accordion-surface-alt));
|
|
15
|
-
--ui-accordion-open-surface:
|
|
14
|
+
--ui-accordion-hover-surface: var(--ui-color-fill, color-mix(in srgb, var(--ui-accordion-accent) 6%, var(--ui-accordion-surface-alt)));
|
|
15
|
+
--ui-accordion-open-surface: var(--ui-accordion-surface);
|
|
16
16
|
--ui-accordion-text: var(--ui-color-text, var(--ui-text, #202020));
|
|
17
17
|
--ui-accordion-muted: var(--ui-color-muted, var(--ui-muted, #646464));
|
|
18
18
|
--ui-accordion-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
19
|
-
--ui-accordion-shadow: var(--base-card-shadow,
|
|
19
|
+
--ui-accordion-shadow: var(--base-card-shadow, none);
|
|
20
20
|
--ui-accordion-duration: 190ms;
|
|
21
21
|
--ui-accordion-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
22
22
|
--ui-accordion-padding-x: 16px;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
--ui-accordion-gap: var(--ui-default-gap, 8px);
|
|
25
25
|
--ui-accordion-title-size: var(--ui-default-font-size, 14px);
|
|
26
26
|
--ui-accordion-title-line-height: var(--ui-default-line-height, 20px);
|
|
27
|
-
--ui-accordion-title-weight:
|
|
27
|
+
--ui-accordion-title-weight: 500;
|
|
28
28
|
--ui-accordion-description-size: 12px;
|
|
29
29
|
--ui-accordion-description-line-height: 16px;
|
|
30
30
|
--ui-accordion-panel-size: 14px;
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
inset-block: 0;
|
|
154
154
|
inset-inline-start: 0;
|
|
155
155
|
inline-size: 0;
|
|
156
|
-
background:
|
|
156
|
+
background: var(--ui-accordion-accent);
|
|
157
157
|
transition: inline-size var(--ui-accordion-duration) var(--ui-accordion-easing);
|
|
158
158
|
pointer-events: none;
|
|
159
159
|
}
|
|
@@ -166,7 +166,8 @@
|
|
|
166
166
|
inline-size: var(--ui-accordion-indicator-size);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
/* The accent bar on an open item is opt-in: indicator="line". */
|
|
170
|
+
ui-accordion[data-ui-accordion-root="true"]:not([indicator="line"]) > [data-ui-accordion-item]::before {
|
|
170
171
|
display: none;
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -199,11 +200,11 @@
|
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
ui-accordion[data-ui-accordion-root="true"] > [data-ui-accordion-item][open] [data-ui-accordion-trigger] {
|
|
202
|
-
color:
|
|
203
|
+
color: var(--ui-accordion-text);
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
ui-accordion[data-ui-accordion-root="true"] [data-ui-accordion-trigger]:focus-visible {
|
|
206
|
-
outline: 2px solid var(--ui-accordion-focus-ring);
|
|
207
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-accordion-focus-ring));
|
|
207
208
|
outline-offset: -2px;
|
|
208
209
|
position: relative;
|
|
209
210
|
z-index: 1;
|
|
@@ -234,12 +235,12 @@
|
|
|
234
235
|
border-radius: var(--ui-accordion-badge-radius);
|
|
235
236
|
padding: 3px 8px;
|
|
236
237
|
font-size: 10px;
|
|
237
|
-
font-weight:
|
|
238
|
+
font-weight: 500;
|
|
238
239
|
letter-spacing: 0.02em;
|
|
239
240
|
text-transform: uppercase;
|
|
240
241
|
line-height: 1.2;
|
|
241
242
|
background: color-mix(in srgb, var(--ui-accordion-accent) 14%, transparent);
|
|
242
|
-
color: color-mix(in srgb, var(--ui-accordion-accent)
|
|
243
|
+
color: color-mix(in srgb, var(--ui-accordion-accent) 32%, var(--ui-color-text-strong, var(--ui-accordion-text)));
|
|
243
244
|
}
|
|
244
245
|
|
|
245
246
|
ui-accordion[data-ui-accordion-root="true"] [data-ui-accordion-chevron] {
|
|
@@ -353,7 +354,7 @@
|
|
|
353
354
|
color: HighlightText;
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
|
-
`;function u(c){const i=Number(c);if(!Number.isFinite(i))return-1;const r=Math.trunc(i);return r>=0?r:-1}function
|
|
357
|
+
`;function u(c){const i=Number(c);if(!Number.isFinite(i))return-1;const r=Math.trunc(i);return r>=0?r:-1}function v(c,i){if(c==null)return i;const r=c.toLowerCase();return r!=="false"&&r!=="0"&&r!=="no"}function m(c,i){if(!c)return[];if(!i){const o=u(c);return o>=0?[o]:[]}try{const o=JSON.parse(c);if(Array.isArray(o))return o.map(u).filter(e=>e>=0)}catch{}const r=u(c);return r>=0?[r]:[]}function h(c,i){return i?JSON.stringify(c):String(c[0]??-1)}function x(c,i="var(--base-card-radius, var(--ui-radius, 6px))"){if(!c||!c.trim())return i;const r=c.trim().toLowerCase();return r==="full"||r==="pill"?"999px":r==="square"||r==="none"?"0px":/^-?\d+(\.\d+)?$/.test(r)?`${r}px`:c.trim()}function y(c){return c instanceof HTMLElement&&c.hasAttribute("data-ui-accordion-item")}class g extends b.ElementBase{constructor(){super(),this._uid=`ui-accordion-${Math.random().toString(36).slice(2,8)}`,this._observer=null,this._panelResizeObserver=null,this._heightSyncRaf=0,this._syncingOpenAttr=!1,this._syncingDom=!1,this._syncingDomResetTimer=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onMutations=this._onMutations.bind(this)}static get observedAttributes(){return["open","multiple","collapsible","headless","shape","elevation","variant","size","tone","radius","indicator"]}connectedCallback(){super.connectedCallback(),this.setAttribute("data-ui-accordion-root","true"),this._syncHostStyles(),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(this._onMutations),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),typeof ResizeObserver<"u"&&(this._panelResizeObserver=new ResizeObserver(()=>{this._syncPanelHeights()}))}disconnectedCallback(){this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._heightSyncRaf&&(cancelAnimationFrame(this._heightSyncRaf),this._heightSyncRaf=0),this._syncingDomResetTimer!=null&&(clearTimeout(this._syncingDomResetTimer),this._syncingDomResetTimer=null),super.disconnectedCallback()}attributeChangedCallback(i,r,o){if(r!==o){if(i==="radius"||i==="shape"){this._syncHostStyles();return}if(this.isConnected){if(i==="open"){this._applyOpenState();return}this.requestRender()}}}get multiple(){return this.hasAttribute("multiple")}set multiple(i){i!==this.multiple&&(i?this.setAttribute("multiple",""):this.removeAttribute("multiple"))}get collapsible(){return v(this.getAttribute("collapsible"),!0)}set collapsible(i){this.setAttribute("collapsible",String(!!i))}get open(){const i=this._normalizeOpen(this._sourceItems());return this.multiple?i:i[0]??-1}set open(i){const r=Array.isArray(i)?i:[i];this._commitOpen(r.map(u).filter(o=>o>=0),!1)}_sourceItems(){return Array.from(this.children).filter(y).map((r,o)=>{const e=Array.from(r.children),t=e.find(n=>n.hasAttribute("data-ui-accordion-trigger"))||null,a=e.find(n=>n.hasAttribute("data-ui-accordion-panel"))||null;return{index:o,itemNode:r,trigger:t,panel:a,disabled:r.hasAttribute("disabled")||t?.hasAttribute("disabled")||!1,description:r.getAttribute("description")||r.getAttribute("data-description")||"",badge:r.getAttribute("badge")||r.getAttribute("data-badge")||""}})}_normalizeOpen(i){const r=m(this.getAttribute("open"),this.multiple),o=Array.from(new Set(r.map(u).filter(t=>t>=0&&t<i.length&&!i[t]?.disabled))).sort((t,a)=>t-a),e=i.findIndex(t=>!t.disabled);return this.multiple?this.collapsible||i.length===0||o.length>0?o:e>=0?[e]:[]:o.length>0?[o[0]]:this.collapsible||i.length===0?[]:e>=0?[e]:[]}_normalizeNext(i,r){const o=Array.from(new Set(i.map(u).filter(t=>t>=0&&t<r.length&&!r[t]?.disabled))).sort((t,a)=>t-a),e=r.findIndex(t=>!t.disabled);return this.multiple?this.collapsible||r.length===0||o.length>0?o:e>=0?[e]:[]:o.length>0?[o[0]]:this.collapsible||r.length===0?[]:e>=0?[e]:[]}_commitOpen(i,r){const o=this._sourceItems(),e=this._normalizeNext(i,o),t=h(e,this.multiple),a=this.getAttribute("open")??(this.multiple?"[]":"-1");if(t!==a&&(this._syncingOpenAttr=!0,this.setAttribute("open",t),this._syncingOpenAttr=!1,this._applyOpenState()),!r)return;const n=this.multiple?e:e[0]??-1;this.dispatchEvent(new CustomEvent("toggle",{detail:{open:n},bubbles:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{open:n},bubbles:!0}))}_ensureStyleNode(){let i=this.querySelector(":scope > style[data-ui-accordion-style]");if(!i){i=document.createElement("style"),i.setAttribute("data-ui-accordion-style",""),i.textContent=p,this.prepend(i);return}i.textContent!==p&&(i.textContent=p)}_markSyncingDom(){this._syncingDom=!0,this._syncingDomResetTimer!=null&&clearTimeout(this._syncingDomResetTimer),this._syncingDomResetTimer=window.setTimeout(()=>{this._syncingDom=!1,this._syncingDomResetTimer=null},0)}_syncHostStyles(){const i=this.getAttribute("radius"),r=this.getAttribute("shape");if(i&&i.trim()){this.style.setProperty("--ui-accordion-radius",x(i));return}if(r==="square"){this.style.setProperty("--ui-accordion-radius","4px");return}if(r==="pill"){this.style.setProperty("--ui-accordion-radius","999px");return}this.style.removeProperty("--ui-accordion-radius")}_ensureGeneratedNodes(i){const{trigger:r,itemNode:o,description:e,badge:t}=i;if(!r)return;let a=r.querySelector("[data-ui-accordion-trailing]");a||(a=document.createElement("span"),a.setAttribute("data-ui-accordion-trailing",""),r.appendChild(a));let n=a.querySelector("[data-ui-accordion-generated-badge]");t?(n||(n=document.createElement("span"),n.setAttribute("data-ui-accordion-generated-badge",""),a.appendChild(n)),n.textContent=t):n&&n.remove();let s=a.querySelector("[data-ui-accordion-chevron]");s||(s=document.createElement("span"),s.setAttribute("data-ui-accordion-chevron",""),s.setAttribute("aria-hidden","true"),s.innerHTML=`
|
|
357
358
|
<svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
358
359
|
<path d="M5 7.5 10 12.5 15 7.5"></path>
|
|
359
360
|
</svg>
|
package/dist/accordion.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ const p = `
|
|
|
3
3
|
ui-accordion[data-ui-accordion-root="true"] {
|
|
4
4
|
display: block;
|
|
5
5
|
overflow-anchor: none;
|
|
6
|
-
--ui-accordion-radius: var(--base-card-radius, var(--ui-radius,
|
|
6
|
+
--ui-accordion-radius: var(--base-card-radius, var(--ui-radius, 6px));
|
|
7
7
|
--ui-accordion-accent: var(--ui-color-primary, var(--ui-primary, #2563eb));
|
|
8
8
|
--ui-accordion-border-color: color-mix(in srgb, var(--ui-color-border, rgba(15, 23, 42, 0.16)) 82%, transparent);
|
|
9
9
|
--ui-accordion-border: 1px solid var(--ui-accordion-border-color);
|
|
@@ -12,12 +12,12 @@ const p = `
|
|
|
12
12
|
--ui-accordion-surface-alt-base: var(--color-surface, var(--ui-color-surface-alt, #f8fafc));
|
|
13
13
|
--ui-accordion-surface: var(--ui-accordion-surface-base);
|
|
14
14
|
--ui-accordion-surface-alt: var(--ui-accordion-surface-alt-base);
|
|
15
|
-
--ui-accordion-hover-surface: color-mix(in srgb, var(--ui-accordion-accent) 6%, var(--ui-accordion-surface-alt));
|
|
16
|
-
--ui-accordion-open-surface:
|
|
15
|
+
--ui-accordion-hover-surface: var(--ui-color-fill, color-mix(in srgb, var(--ui-accordion-accent) 6%, var(--ui-accordion-surface-alt)));
|
|
16
|
+
--ui-accordion-open-surface: var(--ui-accordion-surface);
|
|
17
17
|
--ui-accordion-text: var(--ui-color-text, var(--ui-text, #202020));
|
|
18
18
|
--ui-accordion-muted: var(--ui-color-muted, var(--ui-muted, #646464));
|
|
19
19
|
--ui-accordion-focus-ring: var(--ui-color-focus-ring, var(--ui-focus-ring, #2563eb));
|
|
20
|
-
--ui-accordion-shadow: var(--base-card-shadow,
|
|
20
|
+
--ui-accordion-shadow: var(--base-card-shadow, none);
|
|
21
21
|
--ui-accordion-duration: 190ms;
|
|
22
22
|
--ui-accordion-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
23
23
|
--ui-accordion-padding-x: 16px;
|
|
@@ -25,7 +25,7 @@ const p = `
|
|
|
25
25
|
--ui-accordion-gap: var(--ui-default-gap, 8px);
|
|
26
26
|
--ui-accordion-title-size: var(--ui-default-font-size, 14px);
|
|
27
27
|
--ui-accordion-title-line-height: var(--ui-default-line-height, 20px);
|
|
28
|
-
--ui-accordion-title-weight:
|
|
28
|
+
--ui-accordion-title-weight: 500;
|
|
29
29
|
--ui-accordion-description-size: 12px;
|
|
30
30
|
--ui-accordion-description-line-height: 16px;
|
|
31
31
|
--ui-accordion-panel-size: 14px;
|
|
@@ -154,7 +154,7 @@ const p = `
|
|
|
154
154
|
inset-block: 0;
|
|
155
155
|
inset-inline-start: 0;
|
|
156
156
|
inline-size: 0;
|
|
157
|
-
background:
|
|
157
|
+
background: var(--ui-accordion-accent);
|
|
158
158
|
transition: inline-size var(--ui-accordion-duration) var(--ui-accordion-easing);
|
|
159
159
|
pointer-events: none;
|
|
160
160
|
}
|
|
@@ -167,7 +167,8 @@ const p = `
|
|
|
167
167
|
inline-size: var(--ui-accordion-indicator-size);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
/* The accent bar on an open item is opt-in: indicator="line". */
|
|
171
|
+
ui-accordion[data-ui-accordion-root="true"]:not([indicator="line"]) > [data-ui-accordion-item]::before {
|
|
171
172
|
display: none;
|
|
172
173
|
}
|
|
173
174
|
|
|
@@ -200,11 +201,11 @@ const p = `
|
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
ui-accordion[data-ui-accordion-root="true"] > [data-ui-accordion-item][open] [data-ui-accordion-trigger] {
|
|
203
|
-
color:
|
|
204
|
+
color: var(--ui-accordion-text);
|
|
204
205
|
}
|
|
205
206
|
|
|
206
207
|
ui-accordion[data-ui-accordion-root="true"] [data-ui-accordion-trigger]:focus-visible {
|
|
207
|
-
outline: 2px solid var(--ui-accordion-focus-ring);
|
|
208
|
+
outline: var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--ui-accordion-focus-ring));
|
|
208
209
|
outline-offset: -2px;
|
|
209
210
|
position: relative;
|
|
210
211
|
z-index: 1;
|
|
@@ -235,12 +236,12 @@ const p = `
|
|
|
235
236
|
border-radius: var(--ui-accordion-badge-radius);
|
|
236
237
|
padding: 3px 8px;
|
|
237
238
|
font-size: 10px;
|
|
238
|
-
font-weight:
|
|
239
|
+
font-weight: 500;
|
|
239
240
|
letter-spacing: 0.02em;
|
|
240
241
|
text-transform: uppercase;
|
|
241
242
|
line-height: 1.2;
|
|
242
243
|
background: color-mix(in srgb, var(--ui-accordion-accent) 14%, transparent);
|
|
243
|
-
color: color-mix(in srgb, var(--ui-accordion-accent)
|
|
244
|
+
color: color-mix(in srgb, var(--ui-accordion-accent) 32%, var(--ui-color-text-strong, var(--ui-accordion-text)));
|
|
244
245
|
}
|
|
245
246
|
|
|
246
247
|
ui-accordion[data-ui-accordion-root="true"] [data-ui-accordion-chevron] {
|
|
@@ -383,7 +384,7 @@ function m(c, i) {
|
|
|
383
384
|
function h(c, i) {
|
|
384
385
|
return i ? JSON.stringify(c) : String(c[0] ?? -1);
|
|
385
386
|
}
|
|
386
|
-
function v(c, i = "var(--base-card-radius, var(--ui-radius,
|
|
387
|
+
function v(c, i = "var(--base-card-radius, var(--ui-radius, 6px))") {
|
|
387
388
|
if (!c || !c.trim()) return i;
|
|
388
389
|
const r = c.trim().toLowerCase();
|
|
389
390
|
return r === "full" || r === "pill" ? "999px" : r === "square" || r === "none" ? "0px" : /^-?\d+(\.\d+)?$/.test(r) ? `${r}px` : c.trim();
|