@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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"text-style": {
|
|
3
|
+
"display": {
|
|
4
|
+
"$type": "typography",
|
|
5
|
+
"$description": "Hero and marketing headlines; one per page at most.",
|
|
6
|
+
"$value": {
|
|
7
|
+
"fontFamily": "{font.family.heading}",
|
|
8
|
+
"fontSize": "{font.size.9}",
|
|
9
|
+
"fontWeight": "{font.weight.bold}",
|
|
10
|
+
"lineHeight": "{font.line-height.9}",
|
|
11
|
+
"letterSpacing": "{font.letter-spacing.9}"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"headline": {
|
|
15
|
+
"$type": "typography",
|
|
16
|
+
"$description": "A page's title on a document or landing surface.",
|
|
17
|
+
"$value": {
|
|
18
|
+
"fontFamily": "{font.family.heading}",
|
|
19
|
+
"fontSize": "{font.size.7}",
|
|
20
|
+
"fontWeight": "{font.weight.semibold}",
|
|
21
|
+
"lineHeight": "{font.line-height.7}",
|
|
22
|
+
"letterSpacing": "{font.letter-spacing.7}"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"title-large": {
|
|
26
|
+
"$type": "typography",
|
|
27
|
+
"$description": "A page or dialog title in an app.",
|
|
28
|
+
"$value": {
|
|
29
|
+
"fontFamily": "{font.family.heading}",
|
|
30
|
+
"fontSize": "{font.size.6}",
|
|
31
|
+
"fontWeight": "{font.weight.semibold}",
|
|
32
|
+
"lineHeight": "{font.line-height.6}",
|
|
33
|
+
"letterSpacing": "{font.letter-spacing.6}"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"title": {
|
|
37
|
+
"$type": "typography",
|
|
38
|
+
"$description": "A section title within a page.",
|
|
39
|
+
"$value": {
|
|
40
|
+
"fontFamily": "{font.family.heading}",
|
|
41
|
+
"fontSize": "{font.size.5}",
|
|
42
|
+
"fontWeight": "{font.weight.semibold}",
|
|
43
|
+
"lineHeight": "{font.line-height.5}",
|
|
44
|
+
"letterSpacing": "{font.letter-spacing.5}"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"title-small": {
|
|
48
|
+
"$type": "typography",
|
|
49
|
+
"$description": "A card, panel or group title.",
|
|
50
|
+
"$value": {
|
|
51
|
+
"fontFamily": "{font.family.heading}",
|
|
52
|
+
"fontSize": "{font.size.4}",
|
|
53
|
+
"fontWeight": "{font.weight.semibold}",
|
|
54
|
+
"lineHeight": "{font.line-height.4}",
|
|
55
|
+
"letterSpacing": "{font.letter-spacing.4}"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"body-large": {
|
|
59
|
+
"$type": "typography",
|
|
60
|
+
"$description": "Long-form reading text.",
|
|
61
|
+
"$value": {
|
|
62
|
+
"fontFamily": "{font.family.sans}",
|
|
63
|
+
"fontSize": "{font.size.3}",
|
|
64
|
+
"fontWeight": "{font.weight.regular}",
|
|
65
|
+
"lineHeight": "{font.line-height.3}",
|
|
66
|
+
"letterSpacing": "{font.letter-spacing.3}"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"body": {
|
|
70
|
+
"$type": "typography",
|
|
71
|
+
"$description": "The default text in app UI: rows, descriptions and messages.",
|
|
72
|
+
"$value": {
|
|
73
|
+
"fontFamily": "{font.family.sans}",
|
|
74
|
+
"fontSize": "{font.size.2}",
|
|
75
|
+
"fontWeight": "{font.weight.regular}",
|
|
76
|
+
"lineHeight": "{font.line-height.2}",
|
|
77
|
+
"letterSpacing": "{font.letter-spacing.2}"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"body-small": {
|
|
81
|
+
"$type": "typography",
|
|
82
|
+
"$description": "Dense UI text such as inspector values and table cells.",
|
|
83
|
+
"$value": {
|
|
84
|
+
"fontFamily": "{font.family.sans}",
|
|
85
|
+
"fontSize": "{font.size.1}",
|
|
86
|
+
"fontWeight": "{font.weight.regular}",
|
|
87
|
+
"lineHeight": "{font.line-height.1}",
|
|
88
|
+
"letterSpacing": "{font.letter-spacing.1}"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"label-large": {
|
|
92
|
+
"$type": "typography",
|
|
93
|
+
"$description": "A prominent label, such as a panel header.",
|
|
94
|
+
"$value": {
|
|
95
|
+
"fontFamily": "{font.family.sans}",
|
|
96
|
+
"fontSize": "{font.size.2}",
|
|
97
|
+
"fontWeight": "{font.weight.medium}",
|
|
98
|
+
"lineHeight": "{font.line-height.2}",
|
|
99
|
+
"letterSpacing": "{font.letter-spacing.2}"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"label": {
|
|
103
|
+
"$type": "typography",
|
|
104
|
+
"$description": "Control and field labels; the text inside every control.",
|
|
105
|
+
"$value": {
|
|
106
|
+
"fontFamily": "{font.family.sans}",
|
|
107
|
+
"fontSize": "{font.size.1}",
|
|
108
|
+
"fontWeight": "{font.weight.medium}",
|
|
109
|
+
"lineHeight": "{font.line-height.1}",
|
|
110
|
+
"letterSpacing": "{font.letter-spacing.1}"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"label-strong": {
|
|
114
|
+
"$type": "typography",
|
|
115
|
+
"$description": "A section or popover header in an inspector or panel.",
|
|
116
|
+
"$value": {
|
|
117
|
+
"fontFamily": "{font.family.sans}",
|
|
118
|
+
"fontSize": "{font.size.1}",
|
|
119
|
+
"fontWeight": "{font.weight.strong}",
|
|
120
|
+
"lineHeight": "{font.line-height.1}",
|
|
121
|
+
"letterSpacing": "{font.letter-spacing.1}"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"label-small": {
|
|
125
|
+
"$type": "typography",
|
|
126
|
+
"$description": "Badges, counters and other compact labels.",
|
|
127
|
+
"$value": {
|
|
128
|
+
"fontFamily": "{font.family.sans}",
|
|
129
|
+
"fontSize": "{font.size.0}",
|
|
130
|
+
"fontWeight": "{font.weight.medium}",
|
|
131
|
+
"lineHeight": "{font.line-height.0}",
|
|
132
|
+
"letterSpacing": "{font.letter-spacing.0}"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"caption": {
|
|
136
|
+
"$type": "typography",
|
|
137
|
+
"$description": "Secondary notes, timestamps and hints.",
|
|
138
|
+
"$value": {
|
|
139
|
+
"fontFamily": "{font.family.sans}",
|
|
140
|
+
"fontSize": "{font.size.0}",
|
|
141
|
+
"fontWeight": "{font.weight.regular}",
|
|
142
|
+
"lineHeight": "{font.line-height.0}",
|
|
143
|
+
"letterSpacing": "{font.letter-spacing.0}"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"code": {
|
|
147
|
+
"$type": "typography",
|
|
148
|
+
"$description": "Inline code, keys and identifiers.",
|
|
149
|
+
"$value": {
|
|
150
|
+
"fontFamily": "{font.family.mono}",
|
|
151
|
+
"fontSize": "{font.size.1}",
|
|
152
|
+
"fontWeight": "{font.weight.regular}",
|
|
153
|
+
"lineHeight": "{font.line-height.1}",
|
|
154
|
+
"letterSpacing": "{font.letter-spacing.1}"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"color": {
|
|
3
|
-
"agent-native-shadow-color": {
|
|
4
|
-
"$type": "color",
|
|
5
|
-
"$value": {
|
|
6
|
-
"colorSpace": "srgb",
|
|
7
|
-
"components": [0.1, 0.1, 0.1],
|
|
8
|
-
"alpha": 1,
|
|
9
|
-
"hex": "#1a1a1a"
|
|
10
|
-
},
|
|
11
|
-
"$extensions": {
|
|
12
|
-
"com.agent-native": {
|
|
13
|
-
"hsl": "0 0% 10%"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
3
|
"background": {
|
|
18
4
|
"$type": "color",
|
|
19
5
|
"$value": {
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"color": {
|
|
3
|
-
"agent-native-shadow-color": {
|
|
4
|
-
"$type": "color",
|
|
5
|
-
"$value": {
|
|
6
|
-
"colorSpace": "srgb",
|
|
7
|
-
"components": [0.1, 0.1, 0.1],
|
|
8
|
-
"alpha": 1,
|
|
9
|
-
"hex": "#1a1a1a"
|
|
10
|
-
},
|
|
11
|
-
"$extensions": {
|
|
12
|
-
"com.agent-native": {
|
|
13
|
-
"hsl": "0 0% 10%"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
3
|
"background": {
|
|
18
4
|
"$type": "color",
|
|
19
5
|
"$value": {
|
package/src/tokens/primitives.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
FOUNDATIONS,
|
|
3
|
+
TEXT_STYLE_DEFINITIONS,
|
|
4
|
+
TEXT_STYLE_NAMES,
|
|
5
|
+
type TextStyle,
|
|
6
|
+
type TextStyleName,
|
|
7
|
+
type TypeStep,
|
|
8
|
+
} from "./source.js";
|
|
2
9
|
|
|
3
|
-
export type { TypeStep };
|
|
10
|
+
export type { TextStyle, TextStyleName, TypeStep };
|
|
11
|
+
export { TEXT_STYLE_NAMES };
|
|
4
12
|
|
|
5
13
|
export type TokenName = `--${string}`;
|
|
6
14
|
export type TokenMap = Record<TokenName, string>;
|
|
@@ -26,6 +34,22 @@ export const RADIUS_STEPS: readonly number[] = FOUNDATIONS.radiusSteps;
|
|
|
26
34
|
/** The type scale's steps, `--font-size-0..9` and their line heights and letter spacings. */
|
|
27
35
|
export const TYPE_RAMP: readonly TypeStep[] = FOUNDATIONS.typeRamp;
|
|
28
36
|
|
|
37
|
+
/** The named text styles, in the order the system lists them. */
|
|
38
|
+
export const TEXT_STYLES: readonly TextStyle[] = TEXT_STYLE_DEFINITIONS;
|
|
39
|
+
|
|
40
|
+
/** The declarations a text style sets, each reading a scale token. */
|
|
41
|
+
export function textStyleDeclarations(
|
|
42
|
+
style: TextStyle,
|
|
43
|
+
): Readonly<Record<string, string>> {
|
|
44
|
+
return {
|
|
45
|
+
"font-family": `var(--font-family-${style.family})`,
|
|
46
|
+
"font-size": `var(--font-size-${style.step})`,
|
|
47
|
+
"line-height": `var(--line-height-${style.step})`,
|
|
48
|
+
"letter-spacing": `var(--letter-spacing-${style.step})`,
|
|
49
|
+
"font-weight": `var(--font-weight-${style.weight})`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
29
53
|
export const FONT_WEIGHTS: Readonly<Record<string, number>> =
|
|
30
54
|
FOUNDATIONS.fontWeights;
|
|
31
55
|
|
|
@@ -50,11 +74,12 @@ export const LAYERS = {
|
|
|
50
74
|
"--layer-dialog": "280",
|
|
51
75
|
"--layer-drawer-over-dialog-backdrop": "284",
|
|
52
76
|
"--layer-drawer-over-dialog": "285",
|
|
53
|
-
"--layer-popup": "290",
|
|
54
77
|
"--layer-alert-dialog-backdrop": "340",
|
|
55
78
|
"--layer-alert-dialog": "350",
|
|
79
|
+
"--layer-popup": "360",
|
|
56
80
|
"--layer-toast": "400",
|
|
57
81
|
"--layer-tooltip": "500",
|
|
82
|
+
"--layer-cursor": "510",
|
|
58
83
|
} as const satisfies TokenMap;
|
|
59
84
|
|
|
60
85
|
const px = (value: number) => `${value}px`;
|
package/src/tokens/roles.ts
CHANGED
|
@@ -179,11 +179,11 @@ export const DENSITIES: readonly Density[] = [
|
|
|
179
179
|
"comfortable",
|
|
180
180
|
];
|
|
181
181
|
|
|
182
|
-
/**
|
|
183
|
-
export const
|
|
184
|
-
export type
|
|
182
|
+
/** The control height scale behind the size names: 16, 20, 24 and 32px. */
|
|
183
|
+
export const CONTROL_HEIGHT_STEPS = ["1", "2", "3", "4"] as const;
|
|
184
|
+
export type ControlHeightStep = (typeof CONTROL_HEIGHT_STEPS)[number];
|
|
185
185
|
|
|
186
|
-
const CONTROL_TEXT_STEPS: Readonly<Record<
|
|
186
|
+
const CONTROL_TEXT_STEPS: Readonly<Record<ControlHeightStep, number>> = {
|
|
187
187
|
"1": 1,
|
|
188
188
|
"2": 1,
|
|
189
189
|
"3": 1,
|
|
@@ -230,7 +230,7 @@ export function densityTokens(density: Density): TokenMap {
|
|
|
230
230
|
scale.space.forEach((value, index) => {
|
|
231
231
|
tokens[`--space-${index + 1}`] = `${value}px`;
|
|
232
232
|
});
|
|
233
|
-
|
|
233
|
+
CONTROL_HEIGHT_STEPS.forEach((size, index) => {
|
|
234
234
|
tokens[`--control-height-${size}`] = `${at(CONTROL_HEIGHTS, index)}px`;
|
|
235
235
|
tokens[`--control-padding-x-${size}`] = `${at(scale.padding, index)}px`;
|
|
236
236
|
tokens[`--control-icon-size-${size}`] =
|
|
@@ -239,7 +239,7 @@ export function densityTokens(density: Density): TokenMap {
|
|
|
239
239
|
tokens["--control-gap"] = `${scale.gap}px`;
|
|
240
240
|
tokens["--control-font-size"] = "var(--font-size-1)";
|
|
241
241
|
tokens["--control-line-height"] = "var(--line-height-1)";
|
|
242
|
-
for (const size of
|
|
242
|
+
for (const size of CONTROL_HEIGHT_STEPS) {
|
|
243
243
|
const step = CONTROL_TEXT_STEPS[size];
|
|
244
244
|
tokens[`--control-font-size-${size}`] = `var(--font-size-${step})`;
|
|
245
245
|
tokens[`--control-line-height-${size}`] = `var(--line-height-${step})`;
|
package/src/tokens/round-trip.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { COMPONENTS_FILE, importComponentToken } from "./component-inputs.js";
|
|
1
2
|
import {
|
|
2
3
|
colorComponents,
|
|
3
4
|
colorToken,
|
|
@@ -13,6 +14,7 @@ import { createPalette } from "./palette.js";
|
|
|
13
14
|
import {
|
|
14
15
|
FOUNDATIONS_FILE,
|
|
15
16
|
PALETTE_FILE,
|
|
17
|
+
type TextStyle,
|
|
16
18
|
readTokenFiles,
|
|
17
19
|
THEME_MODES,
|
|
18
20
|
THEME_NAMES,
|
|
@@ -34,6 +36,7 @@ export const COLLECTIONS: readonly Collection[] = [
|
|
|
34
36
|
modes: [{ mode: "Value", source: FOUNDATIONS_FILE }],
|
|
35
37
|
},
|
|
36
38
|
{ folder: "Palette", modes: [{ mode: "Value", source: PALETTE_FILE }] },
|
|
39
|
+
{ folder: "Components", modes: [{ mode: "Value", source: COMPONENTS_FILE }] },
|
|
37
40
|
...THEME_NAMES.map((name) => ({
|
|
38
41
|
folder: `Theme ${name}`,
|
|
39
42
|
modes: THEME_MODES.map((mode) => ({
|
|
@@ -59,6 +62,39 @@ export function exportForFigma(sources: TokenFiles): Map<string, unknown> {
|
|
|
59
62
|
return files;
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
/** A text style as the Figma sync creates it, bound to Foundations variables by name. */
|
|
66
|
+
export interface FigmaTextStyle {
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
variables: {
|
|
70
|
+
fontFamily: string;
|
|
71
|
+
fontSize: string;
|
|
72
|
+
lineHeight: string;
|
|
73
|
+
letterSpacing: string;
|
|
74
|
+
fontWeight: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The text styles for Figma, which its variable import cannot create: each
|
|
80
|
+
* style's name and the Foundations variable each property binds to.
|
|
81
|
+
*/
|
|
82
|
+
export function textStylesForFigma(
|
|
83
|
+
styles: readonly TextStyle[],
|
|
84
|
+
): FigmaTextStyle[] {
|
|
85
|
+
return styles.map((style) => ({
|
|
86
|
+
name: style.name,
|
|
87
|
+
description: style.description,
|
|
88
|
+
variables: {
|
|
89
|
+
fontFamily: `font/family/${style.family}`,
|
|
90
|
+
fontSize: `font/size/${style.step}`,
|
|
91
|
+
lineHeight: `font/line-height/${style.step}`,
|
|
92
|
+
letterSpacing: `font/letter-spacing/${style.step}`,
|
|
93
|
+
fontWeight: `font/weight/${style.weight}`,
|
|
94
|
+
},
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
|
|
62
98
|
/** Token files as the formatter writes them: two-space JSON, number arrays on one line. */
|
|
63
99
|
export function formatTokenFile(group: unknown): string {
|
|
64
100
|
return `${JSON.stringify(group, null, 2).replace(
|
|
@@ -74,6 +110,7 @@ function importToken(
|
|
|
74
110
|
tokenPath: string,
|
|
75
111
|
current: DtcgToken,
|
|
76
112
|
incoming: unknown,
|
|
113
|
+
source: string,
|
|
77
114
|
): DtcgToken {
|
|
78
115
|
if (typeof incoming !== "object" || incoming === null) {
|
|
79
116
|
throw new TokenError(file, tokenPath, "is not a token");
|
|
@@ -86,6 +123,8 @@ function importToken(
|
|
|
86
123
|
`is a ${String(token.$type)}, expected a ${current.$type}`,
|
|
87
124
|
);
|
|
88
125
|
}
|
|
126
|
+
if (source === COMPONENTS_FILE)
|
|
127
|
+
return importComponentToken(file, tokenPath, current, token as DtcgToken);
|
|
89
128
|
const value = token.$value;
|
|
90
129
|
if (typeof value === "string" && ALIAS.test(value)) {
|
|
91
130
|
throw new TokenError(
|
|
@@ -231,7 +270,13 @@ export function importFromFigma(
|
|
|
231
270
|
}
|
|
232
271
|
try {
|
|
233
272
|
const imported = withoutEmptyExtensions(
|
|
234
|
-
importToken(
|
|
273
|
+
importToken(
|
|
274
|
+
label,
|
|
275
|
+
tokenPath,
|
|
276
|
+
token,
|
|
277
|
+
incoming.get(tokenPath),
|
|
278
|
+
source,
|
|
279
|
+
),
|
|
235
280
|
);
|
|
236
281
|
if (
|
|
237
282
|
JSON.stringify(imported.$value) !== JSON.stringify(token.$value)
|
package/src/tokens/source.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { at } from "./at.js";
|
|
2
|
-
import {
|
|
2
|
+
import { COMPONENTS_FILE, readSwitchComponent } from "./component-inputs.js";
|
|
3
|
+
import { flattenTokens, TokenError, TokenReader } from "./dtcg.js";
|
|
4
|
+
import componentsFile from "./files/components.tokens.json" with { type: "json" };
|
|
3
5
|
import foundationsFile from "./files/foundations.tokens.json" with { type: "json" };
|
|
4
6
|
import paletteFile from "./files/palette.tokens.json" with { type: "json" };
|
|
7
|
+
import textStylesFile from "./files/text-styles.tokens.json" with { type: "json" };
|
|
5
8
|
import agentNativeDark from "./files/themes/agent-native.dark.tokens.json" with { type: "json" };
|
|
6
9
|
import agentNativeLight from "./files/themes/agent-native.light.tokens.json" with { type: "json" };
|
|
7
10
|
import analyticsDark from "./files/themes/analytics.dark.tokens.json" with { type: "json" };
|
|
@@ -47,6 +50,8 @@ export type TokenFiles = Readonly<Record<string, unknown>>;
|
|
|
47
50
|
export const TOKEN_FILES: TokenFiles = {
|
|
48
51
|
"foundations.tokens.json": foundationsFile,
|
|
49
52
|
"palette.tokens.json": paletteFile,
|
|
53
|
+
[COMPONENTS_FILE]: componentsFile,
|
|
54
|
+
"text-styles.tokens.json": textStylesFile,
|
|
50
55
|
"themes/agent-native.light.tokens.json": agentNativeLight,
|
|
51
56
|
"themes/agent-native.dark.tokens.json": agentNativeDark,
|
|
52
57
|
"themes/analytics.light.tokens.json": analyticsLight,
|
|
@@ -89,6 +94,7 @@ export const TOKEN_FILES: TokenFiles = {
|
|
|
89
94
|
|
|
90
95
|
export const FOUNDATIONS_FILE = "foundations.tokens.json";
|
|
91
96
|
export const PALETTE_FILE = "palette.tokens.json";
|
|
97
|
+
export const TEXT_STYLES_FILE = "text-styles.tokens.json";
|
|
92
98
|
export const THEME_NAMES: readonly string[] = [
|
|
93
99
|
"agent-native",
|
|
94
100
|
"analytics",
|
|
@@ -121,11 +127,42 @@ const FONT_WEIGHT_NAMES = [
|
|
|
121
127
|
"light",
|
|
122
128
|
"regular",
|
|
123
129
|
"medium",
|
|
130
|
+
"strong",
|
|
124
131
|
"semibold",
|
|
125
132
|
"bold",
|
|
126
133
|
] as const;
|
|
127
134
|
const FONT_FAMILY_NAMES = ["sans", "heading", "mono", "wordmark"] as const;
|
|
128
135
|
|
|
136
|
+
type TextStyleGroup = (typeof textStylesFile)["text-style"];
|
|
137
|
+
|
|
138
|
+
/** A text style's name, from the keys of `text-styles.tokens.json`. */
|
|
139
|
+
export type TextStyleName = keyof TextStyleGroup;
|
|
140
|
+
|
|
141
|
+
function isTextStyleName(name: string): name is TextStyleName {
|
|
142
|
+
return Object.hasOwn(textStylesFile["text-style"], name);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Each text style's name, in the order the file lists them. */
|
|
146
|
+
export const TEXT_STYLE_NAMES: readonly TextStyleName[] = Object.keys(
|
|
147
|
+
textStylesFile["text-style"],
|
|
148
|
+
).filter(isTextStyleName);
|
|
149
|
+
|
|
150
|
+
export type FontWeightName = (typeof FONT_WEIGHT_NAMES)[number];
|
|
151
|
+
export type FontFamilyName = (typeof FONT_FAMILY_NAMES)[number];
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A named text style: one step of the type scale (its size, line height and
|
|
155
|
+
* letter spacing together), a weight and a family. It is what a Figma text
|
|
156
|
+
* style and a `type-*` utility apply.
|
|
157
|
+
*/
|
|
158
|
+
export interface TextStyle {
|
|
159
|
+
readonly name: TextStyleName;
|
|
160
|
+
readonly description: string;
|
|
161
|
+
readonly step: number;
|
|
162
|
+
readonly weight: FontWeightName;
|
|
163
|
+
readonly family: FontFamilyName;
|
|
164
|
+
}
|
|
165
|
+
|
|
129
166
|
/** The type scale starts at step 0, the 10px step below the 12px UI base. */
|
|
130
167
|
export const TYPE_FIRST_STEP = 0;
|
|
131
168
|
|
|
@@ -210,6 +247,74 @@ function readFoundations(files: TokenFiles) {
|
|
|
210
247
|
};
|
|
211
248
|
}
|
|
212
249
|
|
|
250
|
+
const TEXT_STYLE_PREFIX = "text-style.";
|
|
251
|
+
const TEXT_STYLE_PARTS = [
|
|
252
|
+
["fontSize", "size"],
|
|
253
|
+
["lineHeight", "line-height"],
|
|
254
|
+
["letterSpacing", "letter-spacing"],
|
|
255
|
+
] as const;
|
|
256
|
+
|
|
257
|
+
function isOneOf<T extends string>(
|
|
258
|
+
values: readonly T[],
|
|
259
|
+
value: string,
|
|
260
|
+
): value is T {
|
|
261
|
+
return values.some((candidate) => candidate === value);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function readTextStyles(
|
|
265
|
+
files: TokenFiles,
|
|
266
|
+
steps: ReadonlySet<number>,
|
|
267
|
+
): TextStyle[] {
|
|
268
|
+
const tokens = flattenTokens(file(files, TEXT_STYLES_FILE), TEXT_STYLES_FILE);
|
|
269
|
+
const styles: TextStyle[] = [];
|
|
270
|
+
for (const [tokenPath, token] of tokens) {
|
|
271
|
+
const fail: (problem: string) => never = (problem) => {
|
|
272
|
+
throw new TokenError(TEXT_STYLES_FILE, tokenPath, problem);
|
|
273
|
+
};
|
|
274
|
+
if (!tokenPath.startsWith(TEXT_STYLE_PREFIX)) fail("is not a text-style.*");
|
|
275
|
+
const name = tokenPath.slice(TEXT_STYLE_PREFIX.length);
|
|
276
|
+
if (!isTextStyleName(name))
|
|
277
|
+
fail("is not a style text-styles.tokens.json names");
|
|
278
|
+
if (String(token.$type) !== "typography") fail("is not a typography token");
|
|
279
|
+
const description = token.$description ?? "";
|
|
280
|
+
if (description.trim() === "") fail("has no $description");
|
|
281
|
+
const value: unknown = token.$value;
|
|
282
|
+
if (typeof value !== "object" || value === null) fail("has no value");
|
|
283
|
+
const fields = new Map(Object.entries(value));
|
|
284
|
+
const alias = (key: string, group: string): string => {
|
|
285
|
+
const raw = fields.get(key);
|
|
286
|
+
const match =
|
|
287
|
+
typeof raw === "string"
|
|
288
|
+
? new RegExp(`^\\{font\\.${group}\\.([a-z0-9-]+)\\}$`).exec(raw)
|
|
289
|
+
: null;
|
|
290
|
+
const target = match?.at(1);
|
|
291
|
+
return target ?? fail(`${key} is not an alias of a font.${group} token`);
|
|
292
|
+
};
|
|
293
|
+
const [first, ...rest] = TEXT_STYLE_PARTS.map(([key, group]) =>
|
|
294
|
+
Number(alias(key, group)),
|
|
295
|
+
);
|
|
296
|
+
if (first === undefined || !steps.has(first)) {
|
|
297
|
+
fail("fontSize is not a step of the type scale");
|
|
298
|
+
}
|
|
299
|
+
if (rest.some((step) => step !== first)) {
|
|
300
|
+
fail(
|
|
301
|
+
"sets its size, line height and letter spacing from different steps",
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
const weight = alias("fontWeight", "weight");
|
|
305
|
+
const family = alias("fontFamily", "family");
|
|
306
|
+
if (!isOneOf(FONT_WEIGHT_NAMES, weight))
|
|
307
|
+
fail(`fontWeight ${weight} is not a weight`);
|
|
308
|
+
if (!isOneOf(FONT_FAMILY_NAMES, family))
|
|
309
|
+
fail(`fontFamily ${family} is not a family`);
|
|
310
|
+
styles.push({ name, description, step: first, weight, family });
|
|
311
|
+
}
|
|
312
|
+
if (styles.length === 0) {
|
|
313
|
+
throw new TokenError(TEXT_STYLES_FILE, "text-style", "has no text styles");
|
|
314
|
+
}
|
|
315
|
+
return styles;
|
|
316
|
+
}
|
|
317
|
+
|
|
213
318
|
function readPalette(files: TokenFiles) {
|
|
214
319
|
const palette = new TokenReader(PALETTE_FILE, file(files, PALETTE_FILE));
|
|
215
320
|
return {
|
|
@@ -257,8 +362,14 @@ function readThemeMode(
|
|
|
257
362
|
* the first file that is missing a token or holds one of the wrong shape.
|
|
258
363
|
*/
|
|
259
364
|
export function readTokenFiles(files: TokenFiles) {
|
|
365
|
+
const foundations = readFoundations(files);
|
|
260
366
|
return {
|
|
261
|
-
foundations
|
|
367
|
+
foundations,
|
|
368
|
+
switchCssInputs: readSwitchComponent(file(files, COMPONENTS_FILE)).inputs,
|
|
369
|
+
textStyles: readTextStyles(
|
|
370
|
+
files,
|
|
371
|
+
new Set(foundations.typeRamp.map(({ step }) => step)),
|
|
372
|
+
),
|
|
262
373
|
palette: readPalette(files),
|
|
263
374
|
themes: Object.fromEntries(
|
|
264
375
|
THEME_NAMES.map((name) => [
|
|
@@ -275,6 +386,7 @@ export function readTokenFiles(files: TokenFiles) {
|
|
|
275
386
|
const tokens = readTokenFiles(TOKEN_FILES);
|
|
276
387
|
|
|
277
388
|
export const FOUNDATIONS = tokens.foundations;
|
|
389
|
+
export const TEXT_STYLE_DEFINITIONS = tokens.textStyles;
|
|
278
390
|
export const PALETTE_DEFAULTS = tokens.palette;
|
|
279
391
|
|
|
280
392
|
/**
|
package/css/parts/em.css
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Part: em
|
|
3
|
-
*
|
|
4
|
-
* <em class="em" [data-truncate] [data-wrap="wrap|nowrap|pretty|balance"]>
|
|
5
|
-
*
|
|
6
|
-
* Radix Themes' em: stressed text, set in italic in the surrounding text's
|
|
7
|
-
* family, size and color. Truncate and wrap are in text.css.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
@layer components {
|
|
11
|
-
.em {
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
font-style: italic;
|
|
14
|
-
color: inherit;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/css/parts/quote.css
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Part: quote
|
|
3
|
-
*
|
|
4
|
-
* <q class="quote" [data-truncate] [data-wrap="wrap|nowrap|pretty|balance"]>
|
|
5
|
-
*
|
|
6
|
-
* Radix Themes' quote: an inline quotation, set in italic in the
|
|
7
|
-
* surrounding text's family, size and color; the browser adds the
|
|
8
|
-
* quotation marks for the document's language. Truncate and wrap are in
|
|
9
|
-
* text.css.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
@layer components {
|
|
13
|
-
.quote {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
font-style: italic;
|
|
16
|
-
color: inherit;
|
|
17
|
-
}
|
|
18
|
-
}
|
package/css/parts/strong.css
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Part: strong
|
|
3
|
-
*
|
|
4
|
-
* <strong class="strong" [data-truncate]
|
|
5
|
-
* [data-wrap="wrap|nowrap|pretty|balance"]>
|
|
6
|
-
*
|
|
7
|
-
* Radix Themes' strong: important text, set bold in the surrounding text's
|
|
8
|
-
* family, size and color. Truncate and wrap are in text.css.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
@layer components {
|
|
12
|
-
.strong {
|
|
13
|
-
font-weight: var(--font-weight-bold);
|
|
14
|
-
}
|
|
15
|
-
}
|