@agent-native/design-system 0.229.0 → 0.237.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 +45 -16
- package/css/components/announcement.css +6 -0
- package/css/components/autocomplete.css +4 -0
- package/css/components/button.css +2 -0
- package/css/components/combobox.css +3 -0
- package/css/components/design-file-panel.css +5 -0
- package/css/components/dialog.css +2 -0
- package/css/components/dock-workspace.css +5 -0
- package/css/components/font-picker.css +7 -0
- package/css/components/icon-button.css +2 -0
- package/css/components/image-card.css +4 -0
- package/css/components/layer-tree.css +4 -0
- package/css/components/meter.css +1 -0
- package/css/components/progress.css +2 -0
- package/css/components/property-token.css +3 -0
- package/css/components/tabs.css +3 -0
- package/css/components/toast.css +2 -0
- package/css/direction.css +24 -0
- package/css/main.css +3 -2
- package/css/parts/accordion.css +4 -3
- package/css/parts/alert-dialog.css +19 -51
- package/css/parts/alignment-picker.css +363 -0
- package/css/parts/autocomplete.css +47 -117
- package/css/parts/avatar.css +3 -30
- package/css/parts/badge.css +11 -25
- package/css/parts/blockquote.css +1 -1
- package/css/parts/button.css +75 -61
- package/css/parts/callout.css +4 -24
- package/css/parts/card.css +31 -39
- package/css/parts/checkbox-cards.css +10 -11
- package/css/parts/checkbox-group.css +1 -1
- package/css/parts/checkbox.css +35 -18
- package/css/parts/code.css +4 -64
- package/css/parts/color-swatch.css +36 -0
- package/css/parts/combobox.css +24 -10
- package/css/parts/constraint-controls.css +140 -0
- package/css/parts/context-menu.css +1 -1
- package/css/parts/data-list.css +9 -22
- package/css/parts/design-file-panel.css +189 -0
- package/css/parts/design-property-inspector.css +200 -0
- package/css/parts/dialog.css +87 -91
- package/css/parts/dock-workspace.css +123 -0
- package/css/parts/drawer.css +14 -54
- package/css/parts/field.css +2 -2
- package/css/parts/fieldset.css +1 -1
- package/css/parts/font-picker.css +205 -0
- package/css/parts/grid-size-picker.css +220 -0
- package/css/parts/heading.css +1 -1
- package/css/parts/icon-button.css +2 -12
- package/css/parts/image-card.css +126 -0
- package/css/parts/input.css +37 -31
- package/css/parts/inset.css +1 -0
- package/css/parts/inspector.css +67 -0
- package/css/parts/item.css +5 -8
- package/css/parts/kbd.css +10 -49
- package/css/parts/layer-tree.css +174 -0
- package/css/parts/layout.css +18 -0
- package/css/parts/link.css +1 -1
- package/css/parts/menu.css +48 -47
- package/css/parts/menubar.css +3 -3
- package/css/parts/meter.css +28 -14
- package/css/parts/navigation-menu.css +6 -6
- package/css/parts/number-field.css +18 -12
- package/css/parts/otp-field.css +12 -26
- package/css/parts/page-header.css +1 -1
- package/css/parts/paint-editor.css +70 -0
- package/css/parts/popover.css +33 -36
- package/css/parts/preview-card.css +19 -21
- package/css/parts/progress.css +32 -18
- package/css/parts/property-list.css +34 -0
- package/css/parts/property-token.css +104 -0
- package/css/parts/radio-cards.css +28 -20
- package/css/parts/radio-group.css +28 -15
- package/css/parts/scroll-area.css +10 -17
- package/css/parts/segmented-control.css +66 -45
- package/css/parts/select.css +56 -53
- package/css/parts/separator.css +7 -19
- package/css/parts/sidebar.css +6 -9
- package/css/parts/skeleton.css +14 -1
- package/css/parts/slider.css +33 -24
- package/css/parts/spinner.css +5 -14
- package/css/parts/split-pane.css +117 -0
- package/css/parts/switch.css +73 -36
- package/css/parts/tab-nav.css +1 -1
- package/css/parts/table.css +23 -38
- package/css/parts/tabs.css +151 -30
- package/css/parts/text-area.css +11 -20
- package/css/parts/text.css +21 -58
- package/css/parts/toast.css +28 -19
- package/css/parts/toggle-group.css +1 -1
- package/css/parts/toggle.css +34 -21
- package/css/parts/toolbar.css +40 -37
- package/css/parts/tooltip.css +2 -2
- package/css/styles.css +18 -3
- package/css/text-style-utilities.css +113 -0
- package/css/text-styles.css +115 -0
- package/css/themes/agent-native.css +51 -44
- package/css/themes/analytics.css +40 -30
- package/css/themes/assets.css +40 -30
- package/css/themes/baseline.css +93 -28
- package/css/themes/brain.css +40 -30
- package/css/themes/calendar.css +40 -30
- package/css/themes/chat.css +40 -30
- package/css/themes/clips.css +40 -30
- package/css/themes/content.css +40 -30
- package/css/themes/crm.css +40 -30
- package/css/themes/design.css +40 -30
- package/css/themes/desktop.css +40 -30
- package/css/themes/dispatch.css +40 -30
- package/css/themes/docs.css +40 -30
- package/css/themes/factory.css +40 -30
- package/css/themes/forms.css +40 -30
- package/css/themes/mail.css +40 -30
- package/css/themes/plan.css +40 -30
- package/css/themes/slides.css +40 -30
- package/css/themes/tasks.css +40 -30
- package/css/tokens.css +93 -72
- package/dist/catalog/components/alert-dialog.d.ts +2 -0
- package/dist/catalog/components/alert-dialog.d.ts.map +1 -0
- package/dist/catalog/components/alert-dialog.js +2 -0
- package/dist/catalog/components/alert-dialog.js.map +1 -0
- package/dist/catalog/components/alignment-picker.d.ts +11 -0
- package/dist/catalog/components/alignment-picker.d.ts.map +1 -0
- package/dist/catalog/components/alignment-picker.js +12 -0
- package/dist/catalog/components/alignment-picker.js.map +1 -0
- package/dist/catalog/components/aspect-ratio.d.ts +7 -0
- package/dist/catalog/components/aspect-ratio.d.ts.map +1 -0
- package/dist/catalog/components/aspect-ratio.js +7 -0
- package/dist/catalog/components/aspect-ratio.js.map +1 -0
- package/dist/catalog/components/autocomplete.d.ts +13 -0
- package/dist/catalog/components/autocomplete.d.ts.map +1 -0
- package/dist/catalog/components/autocomplete.js +14 -0
- package/dist/catalog/components/autocomplete.js.map +1 -0
- package/dist/catalog/components/avatar.d.ts +7 -0
- package/dist/catalog/components/avatar.d.ts.map +1 -0
- package/dist/catalog/components/avatar.js +8 -0
- package/dist/catalog/components/avatar.js.map +1 -0
- package/dist/catalog/components/badge.d.ts +8 -0
- package/dist/catalog/components/badge.d.ts.map +1 -0
- package/dist/catalog/components/badge.js +9 -0
- package/dist/catalog/components/badge.js.map +1 -0
- package/dist/catalog/components/blockquote.d.ts +8 -0
- package/dist/catalog/components/blockquote.d.ts.map +1 -0
- package/dist/catalog/components/blockquote.js +9 -0
- package/dist/catalog/components/blockquote.js.map +1 -0
- package/dist/catalog/components/button.d.ts +29 -0
- package/dist/catalog/components/button.d.ts.map +1 -0
- package/dist/catalog/components/button.js +23 -0
- package/dist/catalog/components/button.js.map +1 -0
- package/dist/catalog/components/callout.d.ts +6 -0
- package/dist/catalog/components/callout.d.ts.map +1 -0
- package/dist/catalog/components/callout.js +7 -0
- package/dist/catalog/components/callout.js.map +1 -0
- package/dist/catalog/components/card.d.ts +4 -0
- package/dist/catalog/components/card.d.ts.map +1 -0
- package/dist/catalog/components/card.js +5 -0
- package/dist/catalog/components/card.js.map +1 -0
- package/dist/catalog/components/checkbox-cards.d.ts +7 -0
- package/dist/catalog/components/checkbox-cards.d.ts.map +1 -0
- package/dist/catalog/components/checkbox-cards.js +8 -0
- package/dist/catalog/components/checkbox-cards.js.map +1 -0
- package/dist/catalog/components/checkbox-group.d.ts +6 -0
- package/dist/catalog/components/checkbox-group.d.ts.map +1 -0
- package/dist/catalog/components/checkbox-group.js +7 -0
- package/dist/catalog/components/checkbox-group.js.map +1 -0
- package/dist/catalog/components/checkbox.d.ts +6 -0
- package/dist/catalog/components/checkbox.d.ts.map +1 -0
- package/dist/catalog/components/checkbox.js +7 -0
- package/dist/catalog/components/checkbox.js.map +1 -0
- package/dist/catalog/components/code.d.ts +9 -0
- package/dist/catalog/components/code.d.ts.map +1 -0
- package/dist/catalog/components/code.js +10 -0
- package/dist/catalog/components/code.js.map +1 -0
- package/dist/catalog/components/color-swatch.d.ts +5 -0
- package/dist/catalog/components/color-swatch.d.ts.map +1 -0
- package/dist/catalog/components/color-swatch.js +6 -0
- package/dist/catalog/components/color-swatch.js.map +1 -0
- package/dist/catalog/components/combobox.d.ts +13 -0
- package/dist/catalog/components/combobox.d.ts.map +1 -0
- package/dist/catalog/components/combobox.js +14 -0
- package/dist/catalog/components/combobox.js.map +1 -0
- package/dist/catalog/components/context-menu.d.ts +11 -0
- package/dist/catalog/components/context-menu.d.ts.map +1 -0
- package/dist/catalog/components/context-menu.js +12 -0
- package/dist/catalog/components/context-menu.js.map +1 -0
- package/dist/catalog/components/data-list.d.ts +5 -0
- package/dist/catalog/components/data-list.d.ts.map +1 -0
- package/dist/catalog/components/data-list.js +6 -0
- package/dist/catalog/components/data-list.js.map +1 -0
- package/dist/catalog/components/dialog.d.ts +2 -0
- package/dist/catalog/components/dialog.d.ts.map +1 -0
- package/dist/catalog/components/dialog.js +2 -0
- package/dist/catalog/components/dialog.js.map +1 -0
- package/dist/catalog/components/drawer.d.ts +4 -0
- package/dist/catalog/components/drawer.d.ts.map +1 -0
- package/dist/catalog/components/drawer.js +5 -0
- package/dist/catalog/components/drawer.js.map +1 -0
- package/dist/catalog/components/font-picker.d.ts +10 -0
- package/dist/catalog/components/font-picker.d.ts.map +1 -0
- package/dist/catalog/components/font-picker.js +11 -0
- package/dist/catalog/components/font-picker.js.map +1 -0
- package/dist/catalog/components/grid-size-picker.d.ts +11 -0
- package/dist/catalog/components/grid-size-picker.d.ts.map +1 -0
- package/dist/catalog/components/grid-size-picker.js +12 -0
- package/dist/catalog/components/grid-size-picker.js.map +1 -0
- package/dist/catalog/components/heading.d.ts +13 -0
- package/dist/catalog/components/heading.d.ts.map +1 -0
- package/dist/catalog/components/heading.js +9 -0
- package/dist/catalog/components/heading.js.map +1 -0
- package/dist/catalog/components/index.d.ts +56 -0
- package/dist/catalog/components/index.d.ts.map +1 -0
- package/dist/catalog/components/index.js +56 -0
- package/dist/catalog/components/index.js.map +1 -0
- package/dist/catalog/components/input.d.ts +11 -0
- package/dist/catalog/components/input.d.ts.map +1 -0
- package/dist/catalog/components/input.js +12 -0
- package/dist/catalog/components/input.js.map +1 -0
- package/dist/catalog/components/inset.d.ts +6 -0
- package/dist/catalog/components/inset.d.ts.map +1 -0
- package/dist/catalog/components/inset.js +7 -0
- package/dist/catalog/components/inset.js.map +1 -0
- package/dist/catalog/components/item.d.ts +11 -0
- package/dist/catalog/components/item.d.ts.map +1 -0
- package/dist/catalog/components/item.js +12 -0
- package/dist/catalog/components/item.js.map +1 -0
- package/dist/catalog/components/kbd.d.ts +4 -0
- package/dist/catalog/components/kbd.d.ts.map +1 -0
- package/dist/catalog/components/kbd.js +5 -0
- package/dist/catalog/components/kbd.js.map +1 -0
- package/dist/catalog/components/link.d.ts +10 -0
- package/dist/catalog/components/link.d.ts.map +1 -0
- package/dist/catalog/components/link.js +11 -0
- package/dist/catalog/components/link.js.map +1 -0
- package/dist/catalog/components/menu.d.ts +11 -0
- package/dist/catalog/components/menu.d.ts.map +1 -0
- package/dist/catalog/components/menu.js +12 -0
- package/dist/catalog/components/menu.js.map +1 -0
- package/dist/catalog/components/menubar.d.ts +11 -0
- package/dist/catalog/components/menubar.d.ts.map +1 -0
- package/dist/catalog/components/menubar.js +12 -0
- package/dist/catalog/components/menubar.js.map +1 -0
- package/dist/catalog/components/meter.d.ts +7 -0
- package/dist/catalog/components/meter.d.ts.map +1 -0
- package/dist/catalog/components/meter.js +8 -0
- package/dist/catalog/components/meter.js.map +1 -0
- package/dist/catalog/components/number-field.d.ts +8 -0
- package/dist/catalog/components/number-field.d.ts.map +1 -0
- package/dist/catalog/components/number-field.js +9 -0
- package/dist/catalog/components/number-field.js.map +1 -0
- package/dist/catalog/components/otp-field.d.ts +6 -0
- package/dist/catalog/components/otp-field.d.ts.map +1 -0
- package/dist/catalog/components/otp-field.js +7 -0
- package/dist/catalog/components/otp-field.js.map +1 -0
- package/dist/catalog/components/popover.d.ts +2 -0
- package/dist/catalog/components/popover.d.ts.map +1 -0
- package/dist/catalog/components/popover.js +2 -0
- package/dist/catalog/components/popover.js.map +1 -0
- package/dist/catalog/components/preview-card.d.ts +2 -0
- package/dist/catalog/components/preview-card.d.ts.map +1 -0
- package/dist/catalog/components/preview-card.js +2 -0
- package/dist/catalog/components/preview-card.js.map +1 -0
- package/dist/catalog/components/progress.d.ts +11 -0
- package/dist/catalog/components/progress.d.ts.map +1 -0
- package/dist/catalog/components/progress.js +12 -0
- package/dist/catalog/components/progress.js.map +1 -0
- package/dist/catalog/components/radio-cards.d.ts +7 -0
- package/dist/catalog/components/radio-cards.d.ts.map +1 -0
- package/dist/catalog/components/radio-cards.js +8 -0
- package/dist/catalog/components/radio-cards.js.map +1 -0
- package/dist/catalog/components/radio-group.d.ts +6 -0
- package/dist/catalog/components/radio-group.d.ts.map +1 -0
- package/dist/catalog/components/radio-group.js +7 -0
- package/dist/catalog/components/radio-group.js.map +1 -0
- package/dist/catalog/components/scroll-area.d.ts +5 -0
- package/dist/catalog/components/scroll-area.d.ts.map +1 -0
- package/dist/catalog/components/scroll-area.js +6 -0
- package/dist/catalog/components/scroll-area.js.map +1 -0
- package/dist/catalog/components/segmented-control.d.ts +7 -0
- package/dist/catalog/components/segmented-control.d.ts.map +1 -0
- package/dist/catalog/components/segmented-control.js +8 -0
- package/dist/catalog/components/segmented-control.js.map +1 -0
- package/dist/catalog/components/select.d.ts +15 -0
- package/dist/catalog/components/select.d.ts.map +1 -0
- package/dist/catalog/components/select.js +16 -0
- package/dist/catalog/components/select.js.map +1 -0
- package/dist/catalog/components/separator.d.ts +4 -0
- package/dist/catalog/components/separator.d.ts.map +1 -0
- package/dist/catalog/components/separator.js +5 -0
- package/dist/catalog/components/separator.js.map +1 -0
- package/dist/catalog/components/skeleton.d.ts +8 -0
- package/dist/catalog/components/skeleton.d.ts.map +1 -0
- package/dist/catalog/components/skeleton.js +8 -0
- package/dist/catalog/components/skeleton.js.map +1 -0
- package/dist/catalog/components/slider.d.ts +7 -0
- package/dist/catalog/components/slider.d.ts.map +1 -0
- package/dist/catalog/components/slider.js +8 -0
- package/dist/catalog/components/slider.js.map +1 -0
- package/dist/catalog/components/spinner.d.ts +8 -0
- package/dist/catalog/components/spinner.d.ts.map +1 -0
- package/dist/catalog/components/spinner.js +8 -0
- package/dist/catalog/components/spinner.js.map +1 -0
- package/dist/catalog/components/switch.d.ts +7 -0
- package/dist/catalog/components/switch.d.ts.map +1 -0
- package/dist/catalog/components/switch.js +8 -0
- package/dist/catalog/components/switch.js.map +1 -0
- package/dist/catalog/components/tab-nav.d.ts +8 -0
- package/dist/catalog/components/tab-nav.d.ts.map +1 -0
- package/dist/catalog/components/tab-nav.js +9 -0
- package/dist/catalog/components/tab-nav.js.map +1 -0
- package/dist/catalog/components/table.d.ts +23 -0
- package/dist/catalog/components/table.d.ts.map +1 -0
- package/dist/catalog/components/table.js +15 -0
- package/dist/catalog/components/table.js.map +1 -0
- package/dist/catalog/components/tabs.d.ts +8 -0
- package/dist/catalog/components/tabs.d.ts.map +1 -0
- package/dist/catalog/components/tabs.js +9 -0
- package/dist/catalog/components/tabs.js.map +1 -0
- package/dist/catalog/components/text-area.d.ts +8 -0
- package/dist/catalog/components/text-area.d.ts.map +1 -0
- package/dist/catalog/components/text-area.js +9 -0
- package/dist/catalog/components/text-area.js.map +1 -0
- package/dist/catalog/components/text.d.ts +13 -0
- package/dist/catalog/components/text.d.ts.map +1 -0
- package/dist/catalog/components/text.js +9 -0
- package/dist/catalog/components/text.js.map +1 -0
- package/dist/catalog/components/toast.d.ts +7 -0
- package/dist/catalog/components/toast.d.ts.map +1 -0
- package/dist/catalog/components/toast.js +8 -0
- package/dist/catalog/components/toast.js.map +1 -0
- package/dist/catalog/components/toggle-group.d.ts +9 -0
- package/dist/catalog/components/toggle-group.d.ts.map +1 -0
- package/dist/catalog/components/toggle-group.js +10 -0
- package/dist/catalog/components/toggle-group.js.map +1 -0
- package/dist/catalog/components/toggle.d.ts +9 -0
- package/dist/catalog/components/toggle.d.ts.map +1 -0
- package/dist/catalog/components/toggle.js +10 -0
- package/dist/catalog/components/toggle.js.map +1 -0
- package/dist/catalog/components/toolbar.d.ts +5 -0
- package/dist/catalog/components/toolbar.d.ts.map +1 -0
- package/dist/catalog/components/toolbar.js +6 -0
- package/dist/catalog/components/toolbar.js.map +1 -0
- package/dist/catalog/css-inputs.d.ts +258 -0
- package/dist/catalog/css-inputs.d.ts.map +1 -0
- package/dist/catalog/css-inputs.js +232 -0
- package/dist/catalog/css-inputs.js.map +1 -0
- package/dist/catalog/index.d.ts +6 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +4 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalog/parts.d.ts +40 -0
- package/dist/catalog/parts.d.ts.map +1 -0
- package/dist/catalog/parts.js +971 -0
- package/dist/catalog/parts.js.map +1 -0
- package/dist/catalog/prop-types-source.d.ts +11 -0
- package/dist/catalog/prop-types-source.d.ts.map +1 -0
- package/dist/catalog/prop-types-source.js +75 -0
- package/dist/catalog/prop-types-source.js.map +1 -0
- package/dist/catalog/prop-types.generated.d.ts +1155 -0
- package/dist/catalog/prop-types.generated.d.ts.map +1 -0
- package/dist/catalog/prop-types.generated.js +3 -0
- package/dist/catalog/prop-types.generated.js.map +1 -0
- package/dist/catalog/props.d.ts +87 -0
- package/dist/catalog/props.d.ts.map +1 -0
- package/dist/catalog/props.js +142 -0
- package/dist/catalog/props.js.map +1 -0
- package/dist/css.d.ts +38 -0
- package/dist/css.d.ts.map +1 -0
- package/dist/css.js +257 -0
- package/dist/css.js.map +1 -0
- package/dist/generated-css.d.ts +6 -0
- package/dist/generated-css.d.ts.map +1 -0
- package/dist/generated-css.js +19 -0
- package/dist/generated-css.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/model/compare.d.ts +40 -0
- package/dist/model/compare.d.ts.map +1 -0
- package/dist/model/compare.js +83 -0
- package/dist/model/compare.js.map +1 -0
- package/dist/model/dom.d.ts +60 -0
- package/dist/model/dom.d.ts.map +1 -0
- package/dist/model/dom.js +192 -0
- package/dist/model/dom.js.map +1 -0
- package/dist/model/ids.d.ts +8 -0
- package/dist/model/ids.d.ts.map +1 -0
- package/dist/model/ids.js +25 -0
- package/dist/model/ids.js.map +1 -0
- package/dist/model/index.d.ts +8 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +8 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/parts.d.ts +18 -0
- package/dist/model/parts.d.ts.map +1 -0
- package/dist/model/parts.js +91 -0
- package/dist/model/parts.js.map +1 -0
- package/dist/model/styles.d.ts +59 -0
- package/dist/model/styles.d.ts.map +1 -0
- package/dist/model/styles.js +191 -0
- package/dist/model/styles.js.map +1 -0
- package/dist/model/types.d.ts +96 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +2 -0
- package/dist/model/types.js.map +1 -0
- package/dist/model/validate.d.ts +54 -0
- package/dist/model/validate.d.ts.map +1 -0
- package/dist/model/validate.js +92 -0
- package/dist/model/validate.js.map +1 -0
- package/dist/themes/appearances.d.ts +98 -0
- package/dist/themes/appearances.d.ts.map +1 -0
- package/dist/themes/appearances.js +98 -0
- package/dist/themes/appearances.js.map +1 -0
- package/dist/themes/baseline.d.ts +9 -0
- package/dist/themes/baseline.d.ts.map +1 -0
- package/dist/themes/baseline.js +21 -0
- package/dist/themes/baseline.js.map +1 -0
- package/dist/themes/index.d.ts +15 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +68 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/reference.d.ts +7 -0
- package/dist/themes/reference.d.ts.map +1 -0
- package/dist/themes/reference.js +9 -0
- package/dist/themes/reference.js.map +1 -0
- package/dist/themes/shadcn.d.ts +21 -0
- package/dist/themes/shadcn.d.ts.map +1 -0
- package/dist/themes/shadcn.js +189 -0
- package/dist/themes/shadcn.js.map +1 -0
- package/dist/themes/types.d.ts +58 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +2 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/tokens/at.d.ts +6 -0
- package/dist/tokens/at.d.ts.map +1 -0
- package/dist/tokens/at.js +12 -0
- package/dist/tokens/at.js.map +1 -0
- package/dist/tokens/base.d.ts +21 -0
- package/dist/tokens/base.d.ts.map +1 -0
- package/dist/tokens/base.js +43 -0
- package/dist/tokens/base.js.map +1 -0
- package/dist/tokens/color/bezier.d.ts +2 -0
- package/dist/tokens/color/bezier.d.ts.map +1 -0
- package/dist/tokens/color/bezier.js +79 -0
- package/dist/tokens/color/bezier.js.map +1 -0
- package/dist/tokens/color/index.d.ts +3 -0
- package/dist/tokens/color/index.d.ts.map +1 -0
- package/dist/tokens/color/index.js +3 -0
- package/dist/tokens/color/index.js.map +1 -0
- package/dist/tokens/color/radix-generator.d.ts +31 -0
- package/dist/tokens/color/radix-generator.d.ts.map +1 -0
- package/dist/tokens/color/radix-generator.js +311 -0
- package/dist/tokens/color/radix-generator.js.map +1 -0
- package/dist/tokens/component-inputs.d.ts +15 -0
- package/dist/tokens/component-inputs.d.ts.map +1 -0
- package/dist/tokens/component-inputs.js +119 -0
- package/dist/tokens/component-inputs.js.map +1 -0
- package/dist/tokens/dtcg.d.ts +59 -0
- package/dist/tokens/dtcg.d.ts.map +1 -0
- package/dist/tokens/dtcg.js +214 -0
- package/dist/tokens/dtcg.js.map +1 -0
- package/dist/tokens/files/components.tokens.json +184 -0
- package/dist/tokens/files/foundations.tokens.json +322 -0
- package/dist/tokens/files/palette.tokens.json +58 -0
- package/dist/tokens/files/text-styles.tokens.json +158 -0
- package/dist/tokens/files/themes/agent-native.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/agent-native.light.tokens.json +391 -0
- package/dist/tokens/files/themes/analytics.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/analytics.light.tokens.json +391 -0
- package/dist/tokens/files/themes/assets.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/assets.light.tokens.json +391 -0
- package/dist/tokens/files/themes/brain.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/brain.light.tokens.json +391 -0
- package/dist/tokens/files/themes/calendar.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/calendar.light.tokens.json +391 -0
- package/dist/tokens/files/themes/chat.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/chat.light.tokens.json +391 -0
- package/dist/tokens/files/themes/clips.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/clips.light.tokens.json +391 -0
- package/dist/tokens/files/themes/content.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/content.light.tokens.json +391 -0
- package/dist/tokens/files/themes/crm.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/crm.light.tokens.json +391 -0
- package/dist/tokens/files/themes/design.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/design.light.tokens.json +391 -0
- package/dist/tokens/files/themes/desktop.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/desktop.light.tokens.json +391 -0
- package/dist/tokens/files/themes/dispatch.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/dispatch.light.tokens.json +391 -0
- package/dist/tokens/files/themes/docs.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/docs.light.tokens.json +391 -0
- package/dist/tokens/files/themes/factory.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/factory.light.tokens.json +391 -0
- package/dist/tokens/files/themes/forms.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/forms.light.tokens.json +391 -0
- package/dist/tokens/files/themes/mail.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/mail.light.tokens.json +391 -0
- package/dist/tokens/files/themes/plan.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/plan.light.tokens.json +391 -0
- package/dist/tokens/files/themes/slides.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/slides.light.tokens.json +391 -0
- package/dist/tokens/files/themes/tasks.dark.tokens.json +391 -0
- package/dist/tokens/files/themes/tasks.light.tokens.json +391 -0
- package/dist/tokens/palette.d.ts +46 -0
- package/dist/tokens/palette.d.ts.map +1 -0
- package/dist/tokens/palette.js +223 -0
- package/dist/tokens/palette.js.map +1 -0
- package/dist/tokens/primitives.d.ts +52 -0
- package/dist/tokens/primitives.d.ts.map +1 -0
- package/dist/tokens/primitives.js +80 -0
- package/dist/tokens/primitives.js.map +1 -0
- package/dist/tokens/roles.d.ts +37 -0
- package/dist/tokens/roles.d.ts.map +1 -0
- package/dist/tokens/roles.js +208 -0
- package/dist/tokens/roles.js.map +1 -0
- package/dist/tokens/round-trip.d.ts +50 -0
- package/dist/tokens/round-trip.d.ts.map +1 -0
- package/dist/tokens/round-trip.js +226 -0
- package/dist/tokens/round-trip.js.map +1 -0
- package/dist/tokens/source.d.ts +111 -0
- package/dist/tokens/source.d.ts.map +1 -0
- package/dist/tokens/source.js +311 -0
- package/dist/tokens/source.js.map +1 -0
- package/package.json +21 -15
- package/src/catalog/components/alert-dialog.ts +1 -9
- package/src/catalog/components/alignment-picker.ts +16 -0
- package/src/catalog/components/autocomplete.ts +2 -2
- package/src/catalog/components/avatar.ts +0 -3
- package/src/catalog/components/badge.ts +0 -2
- package/src/catalog/components/blockquote.ts +1 -2
- package/src/catalog/components/button.ts +14 -2
- package/src/catalog/components/callout.ts +1 -11
- package/src/catalog/components/card.ts +1 -6
- package/src/catalog/components/checkbox-cards.ts +1 -7
- package/src/catalog/components/checkbox-group.ts +1 -7
- package/src/catalog/components/checkbox.ts +1 -7
- package/src/catalog/components/code.ts +0 -5
- package/src/catalog/components/color-swatch.ts +6 -0
- package/src/catalog/components/combobox.ts +2 -2
- package/src/catalog/components/context-menu.ts +1 -3
- package/src/catalog/components/data-list.ts +0 -1
- package/src/catalog/components/dialog.ts +1 -9
- package/src/catalog/components/font-picker.ts +11 -0
- package/src/catalog/components/grid-size-picker.ts +12 -0
- package/src/catalog/components/heading.ts +10 -1
- package/src/catalog/components/index.ts +4 -3
- package/src/catalog/components/input.ts +2 -2
- package/src/catalog/components/item.ts +1 -6
- package/src/catalog/components/kbd.ts +1 -5
- package/src/catalog/components/link.ts +1 -5
- package/src/catalog/components/menu.ts +1 -3
- package/src/catalog/components/menubar.ts +1 -3
- package/src/catalog/components/meter.ts +0 -6
- package/src/catalog/components/number-field.ts +8 -3
- package/src/catalog/components/otp-field.ts +1 -3
- package/src/catalog/components/popover.ts +1 -9
- package/src/catalog/components/preview-card.ts +1 -9
- package/src/catalog/components/progress.ts +0 -6
- package/src/catalog/components/radio-cards.ts +1 -7
- package/src/catalog/components/radio-group.ts +1 -7
- package/src/catalog/components/scroll-area.ts +0 -5
- package/src/catalog/components/segmented-control.ts +2 -2
- package/src/catalog/components/select.ts +3 -3
- package/src/catalog/components/separator.ts +0 -5
- package/src/catalog/components/slider.ts +0 -6
- package/src/catalog/components/spinner.ts +0 -7
- package/src/catalog/components/switch.ts +0 -6
- package/src/catalog/components/tab-nav.ts +0 -1
- package/src/catalog/components/table.ts +0 -5
- package/src/catalog/components/tabs.ts +0 -1
- package/src/catalog/components/text-area.ts +2 -2
- package/src/catalog/components/text.ts +5 -0
- package/src/catalog/components/toggle-group.ts +3 -3
- package/src/catalog/components/toggle.ts +2 -2
- package/src/catalog/components/toolbar.ts +2 -2
- package/src/catalog/css-inputs.ts +261 -0
- package/src/catalog/index.ts +1 -0
- package/src/catalog/parts.ts +292 -49
- package/src/catalog/prop-types-source.ts +1 -1
- package/src/catalog/prop-types.generated.ts +179 -277
- package/src/catalog/props.ts +29 -11
- package/src/css.ts +115 -31
- package/src/generated-css.ts +12 -8
- package/src/model/compare.ts +11 -11
- package/src/model/dom.ts +30 -30
- package/src/model/index.ts +1 -0
- package/src/model/parts.ts +114 -0
- package/src/model/styles.ts +28 -28
- package/src/model/types.ts +2 -2
- package/src/model/validate.ts +4 -13
- package/src/themes/index.ts +13 -9
- package/src/themes/shadcn.ts +1 -1
- package/src/tokens/component-inputs.ts +165 -0
- package/src/tokens/files/components.tokens.json +184 -0
- package/src/tokens/files/foundations.tokens.json +5 -1
- package/src/tokens/files/text-styles.tokens.json +158 -0
- package/src/tokens/files/themes/agent-native.dark.tokens.json +0 -14
- package/src/tokens/files/themes/agent-native.light.tokens.json +0 -14
- package/src/tokens/primitives.ts +28 -3
- package/src/tokens/roles.ts +6 -6
- package/src/tokens/round-trip.ts +46 -1
- package/src/tokens/source.ts +114 -2
- package/css/parts/em.css +0 -16
- package/css/parts/quote.css +0 -18
- package/css/parts/strong.css +0 -15
- package/src/catalog/components/em.ts +0 -7
- package/src/catalog/components/quote.ts +0 -7
- package/src/catalog/components/strong.ts +0 -7
package/src/catalog/props.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
type ControlSize,
|
|
2
|
+
type ControlHeightStep,
|
|
4
3
|
RADIUS_PRESETS,
|
|
5
4
|
type RadiusPreset,
|
|
6
5
|
} from "../tokens/roles.js";
|
|
@@ -111,7 +110,22 @@ export function booleanProp(description: string): BooleanPropDef {
|
|
|
111
110
|
return { type: "boolean", default: false, description };
|
|
112
111
|
}
|
|
113
112
|
|
|
114
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* The two control sizes: `md` (24px), the standard, and `sm` (20px) for
|
|
115
|
+
* dense rows and toolbars. Every other part has one size.
|
|
116
|
+
*/
|
|
117
|
+
export const CONTROL_SIZES = ["sm", "md"] as const;
|
|
118
|
+
export type ControlSize = (typeof CONTROL_SIZES)[number];
|
|
119
|
+
|
|
120
|
+
/** The step of the `--control-height-*` tokens each control size draws from. */
|
|
121
|
+
export const CONTROL_SIZE_STEPS: Readonly<
|
|
122
|
+
Record<ControlSize, ControlHeightStep>
|
|
123
|
+
> = {
|
|
124
|
+
sm: "2",
|
|
125
|
+
md: "3",
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** `size` over a component's subset of the size names. */
|
|
115
129
|
export function sizeProp<const V extends ControlSize>(
|
|
116
130
|
values: readonly V[],
|
|
117
131
|
defaultValue: NoInfer<V>,
|
|
@@ -124,10 +138,8 @@ export function sizeProp<const V extends ControlSize>(
|
|
|
124
138
|
}
|
|
125
139
|
|
|
126
140
|
const CONTROL_HEIGHT_PX: Readonly<Record<ControlSize, number>> = {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"3": 24,
|
|
130
|
-
"4": 32,
|
|
141
|
+
sm: 20,
|
|
142
|
+
md: 24,
|
|
131
143
|
};
|
|
132
144
|
|
|
133
145
|
/** `variant` over a component's subset of the variants. */
|
|
@@ -164,6 +176,7 @@ export const radiusProp: EnumPropDef<Radius> = enumProp<Radius>(
|
|
|
164
176
|
|
|
165
177
|
/** The data attribute a prop is written to: `highContrast` is `data-high-contrast`. */
|
|
166
178
|
export function propAttribute(name: string): string {
|
|
179
|
+
if (!/[A-Z]/.test(name)) return `data-${name}`;
|
|
167
180
|
return `data-${name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
|
|
168
181
|
}
|
|
169
182
|
|
|
@@ -177,11 +190,15 @@ export function propAttributes(
|
|
|
177
190
|
defs: PropDefs,
|
|
178
191
|
props: object,
|
|
179
192
|
): Record<string, string | undefined> {
|
|
180
|
-
const values
|
|
193
|
+
const values = props as Readonly<Record<string, unknown>>;
|
|
181
194
|
const attributes: Record<string, string | undefined> = {};
|
|
182
195
|
for (const [name, def] of Object.entries(defs)) {
|
|
196
|
+
if (def.type !== "enum" && def.type !== "boolean") continue;
|
|
197
|
+
const given = Object.prototype.propertyIsEnumerable.call(values, name)
|
|
198
|
+
? values[name]
|
|
199
|
+
: undefined;
|
|
183
200
|
if (def.type === "enum") {
|
|
184
|
-
const value =
|
|
201
|
+
const value = given ?? def.default;
|
|
185
202
|
if (value === undefined) continue;
|
|
186
203
|
if (typeof value !== "string" || !def.values.includes(value)) {
|
|
187
204
|
throw new TypeError(
|
|
@@ -189,8 +206,8 @@ export function propAttributes(
|
|
|
189
206
|
);
|
|
190
207
|
}
|
|
191
208
|
attributes[propAttribute(name)] = value;
|
|
192
|
-
} else if (
|
|
193
|
-
|
|
209
|
+
} else if (given === true) {
|
|
210
|
+
attributes[propAttribute(name)] = "";
|
|
194
211
|
}
|
|
195
212
|
}
|
|
196
213
|
return attributes;
|
|
@@ -201,6 +218,7 @@ export const TEXT_WEIGHTS = [
|
|
|
201
218
|
"light",
|
|
202
219
|
"regular",
|
|
203
220
|
"medium",
|
|
221
|
+
"strong",
|
|
204
222
|
"semibold",
|
|
205
223
|
"bold",
|
|
206
224
|
] as const;
|
package/src/css.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { COLOR_SCALES, COLORS } from "./catalog/props.js";
|
|
|
2
2
|
import { APPEARANCES } from "./themes/appearances.js";
|
|
3
3
|
import { SHADCN_SLOTS } from "./themes/shadcn.js";
|
|
4
4
|
import type { ThemeDefinition } from "./themes/types.js";
|
|
5
|
+
import { switchColorLiterals } from "./tokens/component-inputs.js";
|
|
5
6
|
import {
|
|
6
7
|
createPalette,
|
|
7
8
|
DEFAULT_PALETTE_INPUT,
|
|
@@ -10,6 +11,8 @@ import {
|
|
|
10
11
|
import {
|
|
11
12
|
staticPrimitives,
|
|
12
13
|
RADIUS_STEPS,
|
|
14
|
+
TEXT_STYLES,
|
|
15
|
+
textStyleDeclarations,
|
|
13
16
|
type TokenMap,
|
|
14
17
|
} from "./tokens/primitives.js";
|
|
15
18
|
import {
|
|
@@ -98,9 +101,17 @@ export function tokensCss(
|
|
|
98
101
|
const sections: string[] = [GENERATED_HEADER];
|
|
99
102
|
|
|
100
103
|
sections.push(
|
|
101
|
-
block(":root", {
|
|
104
|
+
block(":root", {
|
|
105
|
+
"--radius-factor": "1",
|
|
106
|
+
...staticPrimitives(),
|
|
107
|
+
...switchColorLiterals,
|
|
108
|
+
}),
|
|
102
109
|
);
|
|
103
110
|
|
|
111
|
+
sections.push(
|
|
112
|
+
":where(.light) { color-scheme: light; }",
|
|
113
|
+
":where(.dark) { color-scheme: dark; }",
|
|
114
|
+
);
|
|
104
115
|
sections.push(block(":root,\n.light", palette.light.srgb));
|
|
105
116
|
sections.push(block(".dark", palette.dark.srgb));
|
|
106
117
|
sections.push(
|
|
@@ -120,12 +131,17 @@ export function tokensCss(
|
|
|
120
131
|
}
|
|
121
132
|
|
|
122
133
|
for (const radius of RADIUS_PRESETS) {
|
|
134
|
+
const selectors = ":scope[data-radius],\n[data-app-theme][data-app-theme]";
|
|
123
135
|
sections.push(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
`@scope ([data-radius="${radius}"]) {\n${block(
|
|
137
|
+
selectors,
|
|
138
|
+
{
|
|
139
|
+
...radiusStepTokens(),
|
|
140
|
+
...STANDARD_SHAPE_TOKENS,
|
|
141
|
+
...radiusTokens(radius),
|
|
142
|
+
},
|
|
143
|
+
" ",
|
|
144
|
+
)}\n}`,
|
|
129
145
|
);
|
|
130
146
|
}
|
|
131
147
|
|
|
@@ -154,13 +170,6 @@ const ROOT_LIGHT_SCALES = [":root", ".light"]
|
|
|
154
170
|
.map((selector) => `${selector}${NO_PALETTE}`)
|
|
155
171
|
.join(",\n");
|
|
156
172
|
const ROOT_DARK_SCALES = `.dark${NO_PALETTE}`;
|
|
157
|
-
const THEME_LIGHT_SCALES = [":scope", ":scope.light", ".light"]
|
|
158
|
-
.map((selector) => `${selector}${NO_PALETTE}`)
|
|
159
|
-
.join(",\n");
|
|
160
|
-
const THEME_DARK_SCALES = [":scope.dark", ".dark"]
|
|
161
|
-
.map((selector) => `${selector}${NO_PALETTE}`)
|
|
162
|
-
.join(",\n");
|
|
163
|
-
|
|
164
173
|
function withResets(own: TokenMap, keys: ReadonlySet<string>): TokenMap {
|
|
165
174
|
const tokens: TokenMap = { ...own };
|
|
166
175
|
for (const key of keys) {
|
|
@@ -173,7 +182,7 @@ function withResets(own: TokenMap, keys: ReadonlySet<string>): TokenMap {
|
|
|
173
182
|
* A theme's roles, values and tokens. The default theme is written twice:
|
|
174
183
|
* unscoped, so it applies with no attribute, and inside `@scope`, like every
|
|
175
184
|
* other theme, so the nearest `data-app-theme` ancestor wins by scope proximity.
|
|
176
|
-
*
|
|
185
|
+
* The shared token inventory covers every theme that may enclose this one.
|
|
177
186
|
*/
|
|
178
187
|
export function themeCss(
|
|
179
188
|
theme: ThemeDefinition,
|
|
@@ -218,39 +227,72 @@ export function themeCss(
|
|
|
218
227
|
);
|
|
219
228
|
}
|
|
220
229
|
|
|
230
|
+
const root = `[data-app-theme="${theme.name}"]`;
|
|
231
|
+
const themeRoot = `:where(:scope)${root}`;
|
|
221
232
|
const scoped = [
|
|
222
233
|
block(
|
|
223
|
-
baseSelectors(
|
|
234
|
+
baseSelectors(themeRoot),
|
|
224
235
|
{ ...withResets(theme.base, appearanceKeys), ...theme.scopedOnly?.base },
|
|
225
236
|
" ",
|
|
226
237
|
),
|
|
238
|
+
block(themeRoot, withResets(theme.tokens, tokenKeys), " "),
|
|
239
|
+
].filter(Boolean);
|
|
240
|
+
const limit = theme.readsScales ? " to ([data-app-theme])" : "";
|
|
241
|
+
sections.push(`@scope (${root})${limit} {\n${scoped.join("\n\n")}\n}`);
|
|
242
|
+
|
|
243
|
+
const appearanceSelectors = (mode: string) => [
|
|
244
|
+
`:scope:where(${root}) .${mode}`,
|
|
245
|
+
`:scope:where(.${mode}) ${root}`,
|
|
246
|
+
`:scope:where(.${mode})${root}`,
|
|
247
|
+
];
|
|
248
|
+
const light = appearanceSelectors("light");
|
|
249
|
+
const dark = appearanceSelectors("dark");
|
|
250
|
+
const scales = (selectors: string[]) =>
|
|
251
|
+
selectors.map((selector) => `${selector}${NO_PALETTE}`).join(",\n");
|
|
252
|
+
const lightScales = scales([themeRoot, ...light]);
|
|
253
|
+
const darkScales = scales(dark);
|
|
254
|
+
const foreignSlots = new Set(
|
|
255
|
+
[...appearanceKeys].filter(
|
|
256
|
+
(key) => !(key in theme.base || key in theme.light || key in theme.dark),
|
|
257
|
+
),
|
|
258
|
+
);
|
|
259
|
+
const scopedLight: TokenMap = {};
|
|
260
|
+
for (const key of Object.keys(
|
|
261
|
+
theme.scopedOnly?.dark ?? {},
|
|
262
|
+
) as (keyof TokenMap)[]) {
|
|
263
|
+
scopedLight[key] = theme.scopedOnly?.base[key] ?? "initial";
|
|
264
|
+
}
|
|
265
|
+
const appearances = [
|
|
227
266
|
block(
|
|
228
|
-
"
|
|
229
|
-
{ ...theme.dark, ...theme.scopedOnly?.dark },
|
|
267
|
+
dark.join(",\n"),
|
|
268
|
+
withResets({ ...theme.dark, ...theme.scopedOnly?.dark }, foreignSlots),
|
|
230
269
|
" ",
|
|
231
270
|
),
|
|
232
|
-
block(":scope.light,\n.light", theme.light, " "),
|
|
233
|
-
block(":scope", withResets(theme.tokens, tokenKeys), " "),
|
|
234
271
|
block(
|
|
235
|
-
|
|
272
|
+
light.join(",\n"),
|
|
273
|
+
withResets({ ...theme.light, ...scopedLight }, foreignSlots),
|
|
274
|
+
" ",
|
|
275
|
+
),
|
|
276
|
+
block(
|
|
277
|
+
lightScales,
|
|
236
278
|
{ ...theme.palette.light.srgb, ...colorScopeTokens("brand") },
|
|
237
279
|
" ",
|
|
238
280
|
),
|
|
239
281
|
block(
|
|
240
|
-
|
|
282
|
+
darkScales,
|
|
241
283
|
{ ...theme.palette.dark.srgb, ...colorScopeTokens("brand") },
|
|
242
284
|
" ",
|
|
243
285
|
),
|
|
244
286
|
p3Block([
|
|
245
|
-
block(
|
|
246
|
-
block(
|
|
287
|
+
block(lightScales, theme.palette.light.p3),
|
|
288
|
+
block(darkScales, theme.palette.dark.p3),
|
|
247
289
|
])
|
|
248
290
|
.split("\n")
|
|
249
291
|
.map((line) => ` ${line}`)
|
|
250
292
|
.join("\n"),
|
|
251
293
|
].filter(Boolean);
|
|
252
294
|
sections.push(
|
|
253
|
-
`@scope (
|
|
295
|
+
`@scope (${root}, .light, .dark) {\n${appearances.join("\n\n")}\n}`,
|
|
254
296
|
);
|
|
255
297
|
|
|
256
298
|
return `${sections.filter(Boolean).join("\n\n")}\n`;
|
|
@@ -306,13 +348,55 @@ export function paletteCss(
|
|
|
306
348
|
throw new TypeError(`Palette id must be alphanumeric with dashes: ${id}`);
|
|
307
349
|
}
|
|
308
350
|
const scope = `[data-palette="${id}"]`;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
351
|
+
function selectors(mode: "light" | "dark") {
|
|
352
|
+
const appearance =
|
|
353
|
+
mode === "light" ? ":where(:root:not(.dark), .light)" : ":where(.dark)";
|
|
354
|
+
return [
|
|
355
|
+
`:scope${appearance}${scope}`,
|
|
356
|
+
`:scope${appearance} ${scope}`,
|
|
357
|
+
`:scope:where(${scope}) .${mode}:not(:where([data-palette]))`,
|
|
358
|
+
].join(",\n");
|
|
359
|
+
}
|
|
360
|
+
const light = selectors("light");
|
|
361
|
+
const dark = selectors("dark");
|
|
313
362
|
return [
|
|
314
|
-
|
|
315
|
-
block(
|
|
363
|
+
"@scope (:root, .light, .dark, [data-palette]) {",
|
|
364
|
+
block(light, palette.light.srgb, " "),
|
|
365
|
+
block(dark, palette.dark.srgb, " "),
|
|
316
366
|
p3Block([block(light, palette.light.p3), block(dark, palette.dark.p3)]),
|
|
317
|
-
|
|
367
|
+
"}",
|
|
368
|
+
].join("\n");
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function declarations(
|
|
372
|
+
properties: Readonly<Record<string, string>>,
|
|
373
|
+
indent: string,
|
|
374
|
+
): string {
|
|
375
|
+
return Object.entries(properties)
|
|
376
|
+
.map(([name, value]) => `${indent}${name}: ${value};`)
|
|
377
|
+
.join("\n");
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Text and Heading's `textStyle`: one rule per text style, in `@layer components`. */
|
|
381
|
+
export function textStylesCss(): string {
|
|
382
|
+
const rules = TEXT_STYLES.map(
|
|
383
|
+
(style) =>
|
|
384
|
+
` :is(.text, .heading)[data-text-style="${style.name}"] {\n${declarations(
|
|
385
|
+
textStyleDeclarations(style),
|
|
386
|
+
" ",
|
|
387
|
+
)}\n }`,
|
|
388
|
+
);
|
|
389
|
+
return `${GENERATED_HEADER}\n\n@layer components {\n${rules.join("\n\n")}\n}\n`;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** A Tailwind `type-<style>` utility per text style, for app chrome. */
|
|
393
|
+
export function textStyleUtilitiesCss(): string {
|
|
394
|
+
const rules = TEXT_STYLES.map(
|
|
395
|
+
(style) =>
|
|
396
|
+
`@utility type-${style.name} {\n${declarations(
|
|
397
|
+
textStyleDeclarations(style),
|
|
398
|
+
" ",
|
|
399
|
+
)}\n}`,
|
|
400
|
+
);
|
|
401
|
+
return `${GENERATED_HEADER}\n\n${rules.join("\n\n")}\n`;
|
|
318
402
|
}
|
package/src/generated-css.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
appearancesCss,
|
|
3
|
+
textStylesCss,
|
|
4
|
+
textStyleUtilitiesCss,
|
|
5
|
+
themeCss,
|
|
6
|
+
tokensCss,
|
|
7
|
+
} from "./css.js";
|
|
8
|
+
import { THEMES } from "./themes/index.js";
|
|
3
9
|
|
|
4
10
|
/**
|
|
5
11
|
* Every generated stylesheet, keyed by its path under `css/`. Each theme has
|
|
6
|
-
* its own file
|
|
7
|
-
* so a theme resets only what the default sets.
|
|
12
|
+
* its own file. A theme region can be nested inside any other loaded theme.
|
|
8
13
|
*/
|
|
9
14
|
export function generatedStylesheets(): Record<string, string> {
|
|
10
15
|
const files: Record<string, string> = {
|
|
11
16
|
"tokens.css": tokensCss(),
|
|
12
17
|
"appearances.css": appearancesCss(),
|
|
18
|
+
"text-styles.css": textStylesCss(),
|
|
19
|
+
"text-style-utilities.css": textStyleUtilitiesCss(),
|
|
13
20
|
};
|
|
14
21
|
for (const theme of THEMES) {
|
|
15
|
-
files[`themes/${theme.name}.css`] = themeCss(
|
|
16
|
-
theme,
|
|
17
|
-
theme.isDefault ? [theme] : [agentNativeTheme, theme],
|
|
18
|
-
);
|
|
22
|
+
files[`themes/${theme.name}.css`] = themeCss(theme, THEMES);
|
|
19
23
|
}
|
|
20
24
|
return files;
|
|
21
25
|
}
|
package/src/model/compare.ts
CHANGED
|
@@ -3,13 +3,13 @@ import type { RowSnapshot } from "./dom.js";
|
|
|
3
3
|
export type RowField = Exclude<keyof RowSnapshot, "id">;
|
|
4
4
|
|
|
5
5
|
export type RowDifference =
|
|
6
|
-
| { rowId: string; field: "missing";
|
|
6
|
+
| { rowId: string; field: "missing"; target: RowSnapshot }
|
|
7
7
|
| { rowId: string; field: "extra"; ours: RowSnapshot }
|
|
8
8
|
| {
|
|
9
9
|
rowId: string;
|
|
10
10
|
field: RowField;
|
|
11
11
|
ours: RowSnapshot[RowField];
|
|
12
|
-
|
|
12
|
+
target: RowSnapshot[RowField];
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -52,7 +52,7 @@ const FIELDS: readonly RowField[] = [
|
|
|
52
52
|
function indexById(rows: readonly RowSnapshot[], side: string) {
|
|
53
53
|
const byId = new Map<string, RowSnapshot>();
|
|
54
54
|
for (const row of rows) {
|
|
55
|
-
if (!row.id) throw new Error(`A ${side} row has no data-
|
|
55
|
+
if (!row.id) throw new Error(`A ${side} row has no data-rid value`);
|
|
56
56
|
if (byId.has(row.id)) {
|
|
57
57
|
throw new Error(
|
|
58
58
|
`Row ${row.id} is rendered twice by the ${side} part set`,
|
|
@@ -70,7 +70,7 @@ function indexById(rows: readonly RowSnapshot[], side: string) {
|
|
|
70
70
|
*/
|
|
71
71
|
export function compareRowSnapshots(
|
|
72
72
|
ours: readonly RowSnapshot[],
|
|
73
|
-
|
|
73
|
+
target: readonly RowSnapshot[],
|
|
74
74
|
accepted: readonly AcceptedRowDifference[] = [],
|
|
75
75
|
): EquivalenceReport {
|
|
76
76
|
for (const entry of accepted) {
|
|
@@ -81,28 +81,28 @@ export function compareRowSnapshots(
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
const oursById = indexById(ours, "our");
|
|
84
|
-
const
|
|
84
|
+
const targetById = indexById(target, "target");
|
|
85
85
|
const all: RowDifference[] = [];
|
|
86
86
|
|
|
87
|
-
for (const [rowId,
|
|
87
|
+
for (const [rowId, targetRow] of targetById) {
|
|
88
88
|
const ourRow = oursById.get(rowId);
|
|
89
89
|
if (!ourRow) {
|
|
90
|
-
all.push({ rowId, field: "missing",
|
|
90
|
+
all.push({ rowId, field: "missing", target: targetRow });
|
|
91
91
|
continue;
|
|
92
92
|
}
|
|
93
93
|
for (const field of FIELDS) {
|
|
94
|
-
if (ourRow[field] !==
|
|
94
|
+
if (ourRow[field] !== targetRow[field]) {
|
|
95
95
|
all.push({
|
|
96
96
|
rowId,
|
|
97
97
|
field,
|
|
98
98
|
ours: ourRow[field],
|
|
99
|
-
|
|
99
|
+
target: targetRow[field],
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
for (const [rowId, ourRow] of oursById) {
|
|
105
|
-
if (!
|
|
105
|
+
if (!targetById.has(rowId))
|
|
106
106
|
all.push({ rowId, field: "extra", ours: ourRow });
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -114,7 +114,7 @@ export function compareRowSnapshots(
|
|
|
114
114
|
)?.reason;
|
|
115
115
|
|
|
116
116
|
const report: EquivalenceReport = {
|
|
117
|
-
compared:
|
|
117
|
+
compared: targetById.size,
|
|
118
118
|
differences: [],
|
|
119
119
|
accepted: [],
|
|
120
120
|
};
|
package/src/model/dom.ts
CHANGED
|
@@ -9,15 +9,15 @@ import type { ModelRow, RowBadge, RowEffect } from "./types.js";
|
|
|
9
9
|
* has no state for.
|
|
10
10
|
*/
|
|
11
11
|
export interface RowAttributes {
|
|
12
|
-
"data-
|
|
12
|
+
"data-rid": string;
|
|
13
13
|
"data-part": string;
|
|
14
|
-
"data-
|
|
15
|
-
"data-
|
|
16
|
-
"data-
|
|
17
|
-
"data-
|
|
18
|
-
"data-
|
|
19
|
-
"data-
|
|
20
|
-
"data-
|
|
14
|
+
"data-rid-kind"?: string;
|
|
15
|
+
"data-rid-effect"?: string;
|
|
16
|
+
"data-rid-badge"?: string;
|
|
17
|
+
"data-rid-slot"?: string;
|
|
18
|
+
"data-rid-regions"?: string;
|
|
19
|
+
"data-rid-hosts"?: string;
|
|
20
|
+
"data-rid-complete"?: "true";
|
|
21
21
|
id?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -57,23 +57,23 @@ export function encodeRegions(
|
|
|
57
57
|
|
|
58
58
|
export function rowAttributes(row: ModelRow): RowAttributes {
|
|
59
59
|
const attributes: RowAttributes = {
|
|
60
|
-
"data-
|
|
60
|
+
"data-rid": row.id,
|
|
61
61
|
"data-part": row.part,
|
|
62
62
|
};
|
|
63
|
-
if (row.kind) attributes["data-
|
|
64
|
-
if (row.effect) attributes["data-
|
|
63
|
+
if (row.kind) attributes["data-rid-kind"] = row.kind;
|
|
64
|
+
if (row.effect) attributes["data-rid-effect"] = encodeEffect(row.effect);
|
|
65
65
|
if (row.state?.badge) {
|
|
66
|
-
attributes["data-
|
|
66
|
+
attributes["data-rid-badge"] = encodeBadge(row.state.badge);
|
|
67
67
|
}
|
|
68
|
-
if (row.slot) attributes["data-
|
|
68
|
+
if (row.slot) attributes["data-rid-slot"] = row.slot;
|
|
69
69
|
if (row.hosts === "any") {
|
|
70
|
-
attributes["data-
|
|
70
|
+
attributes["data-rid-hosts"] = "any";
|
|
71
71
|
} else if (row.hosts && row.hosts.length > 0) {
|
|
72
|
-
attributes["data-
|
|
72
|
+
attributes["data-rid-hosts"] = row.hosts.join(" ");
|
|
73
73
|
}
|
|
74
|
-
if (row.state?.complete) attributes["data-
|
|
74
|
+
if (row.state?.complete) attributes["data-rid-complete"] = "true";
|
|
75
75
|
if (row.regions && Object.keys(row.regions).length > 0) {
|
|
76
|
-
attributes["data-
|
|
76
|
+
attributes["data-rid-regions"] = encodeRegions(row.regions);
|
|
77
77
|
}
|
|
78
78
|
if (row.anchor) attributes.id = row.anchor;
|
|
79
79
|
return attributes;
|
|
@@ -102,7 +102,7 @@ export interface RowSnapshot {
|
|
|
102
102
|
complete: boolean;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
const ROW_SELECTOR = "[data-
|
|
105
|
+
const ROW_SELECTOR = "[data-rid]";
|
|
106
106
|
const CONTROL_SELECTOR =
|
|
107
107
|
"input,select,textarea,button,[role=switch],[role=checkbox],[role=radio],[role=option],[role=menuitem],[role=menuitemcheckbox],[role=menuitemradio],[role=tab],[role=treeitem],a[href]";
|
|
108
108
|
|
|
@@ -146,7 +146,7 @@ function rowControl(row: Element): Element {
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* The accessible name, in the order assistive technology resolves the common
|
|
149
|
-
* cases: aria-label, aria-labelledby, an explicit `[data-
|
|
149
|
+
* cases: aria-label, aria-labelledby, an explicit `[data-rid-label]`, then
|
|
150
150
|
* the row's own text.
|
|
151
151
|
*/
|
|
152
152
|
export function rowName(row: Element): string {
|
|
@@ -157,7 +157,7 @@ export function rowName(row: Element): string {
|
|
|
157
157
|
const labelledBy = labelledByText(element);
|
|
158
158
|
if (labelledBy) return labelledBy;
|
|
159
159
|
}
|
|
160
|
-
const explicit = row.querySelector("[data-
|
|
160
|
+
const explicit = row.querySelector("[data-rid-label]");
|
|
161
161
|
if (explicit && explicit.closest(ROW_SELECTOR) === row) {
|
|
162
162
|
return normalizeSpace(explicit.textContent);
|
|
163
163
|
}
|
|
@@ -213,11 +213,11 @@ function snapshotRow(row: Element, position: number): RowSnapshot {
|
|
|
213
213
|
|
|
214
214
|
const parent = row.parentElement?.closest(ROW_SELECTOR) ?? null;
|
|
215
215
|
return {
|
|
216
|
-
id: row.getAttribute("data-
|
|
216
|
+
id: row.getAttribute("data-rid") ?? "",
|
|
217
217
|
part: row.getAttribute("data-part") ?? "",
|
|
218
|
-
parentId: parent?.getAttribute("data-
|
|
218
|
+
parentId: parent?.getAttribute("data-rid") ?? null,
|
|
219
219
|
position,
|
|
220
|
-
kind: row.getAttribute("data-
|
|
220
|
+
kind: row.getAttribute("data-rid-kind"),
|
|
221
221
|
name: rowName(row),
|
|
222
222
|
selected,
|
|
223
223
|
checked: checked === null ? null : checked,
|
|
@@ -227,12 +227,12 @@ function snapshotRow(row: Element, position: number): RowSnapshot {
|
|
|
227
227
|
(element) => element.getAttribute("aria-busy") === "true",
|
|
228
228
|
),
|
|
229
229
|
value,
|
|
230
|
-
effect: row.getAttribute("data-
|
|
231
|
-
badge: row.getAttribute("data-
|
|
232
|
-
slot: row.getAttribute("data-
|
|
233
|
-
regions: row.getAttribute("data-
|
|
234
|
-
hosts: row.getAttribute("data-
|
|
235
|
-
complete: row.getAttribute("data-
|
|
230
|
+
effect: row.getAttribute("data-rid-effect"),
|
|
231
|
+
badge: row.getAttribute("data-rid-badge"),
|
|
232
|
+
slot: row.getAttribute("data-rid-slot"),
|
|
233
|
+
regions: row.getAttribute("data-rid-regions"),
|
|
234
|
+
hosts: row.getAttribute("data-rid-hosts"),
|
|
235
|
+
complete: row.getAttribute("data-rid-complete") === "true",
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -244,7 +244,7 @@ export function captureRows(root: ParentNode): RowSnapshot[] {
|
|
|
244
244
|
const positions = new Map<string | null, number>();
|
|
245
245
|
return [...root.querySelectorAll(ROW_SELECTOR)].map((row) => {
|
|
246
246
|
const parentId =
|
|
247
|
-
row.parentElement?.closest(ROW_SELECTOR)?.getAttribute("data-
|
|
247
|
+
row.parentElement?.closest(ROW_SELECTOR)?.getAttribute("data-rid") ??
|
|
248
248
|
null;
|
|
249
249
|
const position = positions.get(parentId) ?? 0;
|
|
250
250
|
positions.set(parentId, position + 1);
|
package/src/model/index.ts
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export type ModelPartGroup =
|
|
2
|
+
| "shell"
|
|
3
|
+
| "overlay"
|
|
4
|
+
| "content"
|
|
5
|
+
| "agent"
|
|
6
|
+
| "primitive";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A part a model row can name. Sub-parts are rows nested in the part
|
|
10
|
+
* (`sidebar.item`); a part set gives each its own markup.
|
|
11
|
+
*/
|
|
12
|
+
export interface ModelPart {
|
|
13
|
+
name: string;
|
|
14
|
+
group: ModelPartGroup;
|
|
15
|
+
subParts: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const part = (
|
|
19
|
+
group: ModelPartGroup,
|
|
20
|
+
name: string,
|
|
21
|
+
subParts: readonly string[] = [],
|
|
22
|
+
): ModelPart => ({ name, group, subParts });
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Version 1 of the model vocabulary, shared by every app and part set. It is
|
|
26
|
+
* frozen: a new part or sub-part changes the snapshot in `parts.spec.ts`.
|
|
27
|
+
*/
|
|
28
|
+
export const MODEL_PARTS: readonly ModelPart[] = [
|
|
29
|
+
part("shell", "app-shell", [
|
|
30
|
+
"nav",
|
|
31
|
+
"topbar",
|
|
32
|
+
"main",
|
|
33
|
+
"aside",
|
|
34
|
+
"banner",
|
|
35
|
+
"overlays",
|
|
36
|
+
"skeleton",
|
|
37
|
+
"split",
|
|
38
|
+
]),
|
|
39
|
+
part("shell", "sidebar", [
|
|
40
|
+
"header",
|
|
41
|
+
"item",
|
|
42
|
+
"section",
|
|
43
|
+
"tree",
|
|
44
|
+
"rail",
|
|
45
|
+
"footer",
|
|
46
|
+
"resize-handle",
|
|
47
|
+
"slot",
|
|
48
|
+
]),
|
|
49
|
+
part("shell", "page-header"),
|
|
50
|
+
part("shell", "toolbar"),
|
|
51
|
+
part("shell", "filter-bar"),
|
|
52
|
+
part("shell", "tabs"),
|
|
53
|
+
part("shell", "search"),
|
|
54
|
+
part("shell", "command-palette"),
|
|
55
|
+
part("shell", "shortcuts-panel"),
|
|
56
|
+
part("shell", "settings", [
|
|
57
|
+
"nav",
|
|
58
|
+
"nav-group",
|
|
59
|
+
"nav-item",
|
|
60
|
+
"group",
|
|
61
|
+
"row",
|
|
62
|
+
"content",
|
|
63
|
+
"section",
|
|
64
|
+
"notice",
|
|
65
|
+
"report",
|
|
66
|
+
]),
|
|
67
|
+
part("overlay", "menu"),
|
|
68
|
+
part("overlay", "popover"),
|
|
69
|
+
part("overlay", "picker"),
|
|
70
|
+
part("overlay", "select"),
|
|
71
|
+
part("overlay", "date-picker"),
|
|
72
|
+
part("overlay", "dialog"),
|
|
73
|
+
part("overlay", "toast"),
|
|
74
|
+
part("overlay", "tooltip"),
|
|
75
|
+
part("overlay", "banner"),
|
|
76
|
+
part("overlay", "form"),
|
|
77
|
+
part("overlay", "file-upload"),
|
|
78
|
+
part("overlay", "empty-state"),
|
|
79
|
+
part("overlay", "skeleton"),
|
|
80
|
+
part("content", "list", ["section", "row"]),
|
|
81
|
+
part("content", "card"),
|
|
82
|
+
part("content", "table"),
|
|
83
|
+
part("content", "data-grid"),
|
|
84
|
+
part("content", "board"),
|
|
85
|
+
part("content", "timeline"),
|
|
86
|
+
part("content", "calendar-view"),
|
|
87
|
+
part("content", "chart"),
|
|
88
|
+
part("content", "inspector"),
|
|
89
|
+
part("content", "property-list"),
|
|
90
|
+
part("content", "activity-feed"),
|
|
91
|
+
part("content", "rich-text-editor"),
|
|
92
|
+
part("agent", "chat-thread"),
|
|
93
|
+
part("agent", "composer"),
|
|
94
|
+
part("agent", "agent-panel"),
|
|
95
|
+
part("primitive", "button"),
|
|
96
|
+
part("primitive", "input"),
|
|
97
|
+
part("primitive", "checkbox"),
|
|
98
|
+
part("primitive", "switch"),
|
|
99
|
+
part("primitive", "badge"),
|
|
100
|
+
part("primitive", "avatar"),
|
|
101
|
+
part("primitive", "kbd"),
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
/** Every reference a row can name: `sidebar`, `sidebar.item`, ... */
|
|
105
|
+
export function modelPartRefs(
|
|
106
|
+
parts: readonly ModelPart[] = MODEL_PARTS,
|
|
107
|
+
): Set<string> {
|
|
108
|
+
const refs = new Set<string>();
|
|
109
|
+
for (const { name, subParts } of parts) {
|
|
110
|
+
refs.add(name);
|
|
111
|
+
for (const sub of subParts) refs.add(`${name}.${sub}`);
|
|
112
|
+
}
|
|
113
|
+
return refs;
|
|
114
|
+
}
|