@behavioral-agentic-design-system/core 0.42.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +38 -8
- package/scripts/a11y-lint.cjs +101 -14
- package/scripts/bads-sync.mjs +1 -1
- package/scripts/build-tokens.cjs +122 -7
- package/scripts/check-dark-contrast.mjs +204 -0
- package/scripts/check-flush-edges.mjs +245 -0
- package/scripts/check-spec.mjs +73 -0
- package/scripts/deal-directions.mjs +186 -0
- package/scripts/design-system-advisory/README.md +239 -0
- package/scripts/design-system-advisory/check-copy-punctuation.mjs +44 -0
- package/scripts/design-system-advisory/check-even-padding.mjs +35 -0
- package/scripts/design-system-advisory/check-hand-built-button.mjs +46 -0
- package/scripts/design-system-advisory/check-html-nesting.mjs +51 -0
- package/scripts/design-system-advisory/check-icon-sizing.mjs +79 -0
- package/scripts/design-system-advisory/check-label-case.mjs +92 -0
- package/scripts/design-system-advisory/check-native-form-controls.mjs +53 -0
- package/scripts/design-system-advisory/check-radius.mjs +56 -0
- package/scripts/design-system-advisory/check-raw-values.mjs +61 -0
- package/scripts/design-system-advisory/check-small-text.mjs +72 -0
- package/scripts/design-system-advisory/check-tap-target.mjs +70 -0
- package/scripts/design-system-advisory/defaults.mjs +90 -0
- package/scripts/design-system-advisory/fixtures/clean.tsx.fixture +12 -0
- package/scripts/design-system-advisory/fixtures/violations.tsx.fixture +19 -0
- package/scripts/design-system-advisory/lib.mjs +255 -0
- package/scripts/design-system-advisory/run.mjs +189 -0
- package/scripts/design-system-advisory/workflow.yml +82 -0
- package/scripts/health-report.mjs +20 -14
- package/scripts/lib/copy-strings.mjs +146 -0
- package/scripts/lib/counted-lint.mjs +100 -0
- package/scripts/lib/dark-contrast.mjs +120 -0
- package/scripts/lib/flush-edges.mjs +294 -0
- package/scripts/lib/lab-lint.mjs +62 -0
- package/scripts/lib/marketing-library.mjs +129 -0
- package/scripts/lib/mount-page.mjs +25 -0
- package/scripts/lib/on-system.mjs +249 -0
- package/scripts/lib/random.mjs +22 -0
- package/scripts/lib/source-scan.mjs +173 -0
- package/scripts/lib/spec-parse.d.mts +25 -0
- package/scripts/lib/spec-parse.mjs +188 -0
- package/scripts/lib/tells.mjs +366 -0
- package/scripts/lint-arbitrary-tokens.mjs +47 -0
- package/scripts/lint-component-token-refs.mjs +63 -0
- package/scripts/lint-content-hierarchy.mjs +114 -0
- package/scripts/lint-control-baseline.mjs +72 -0
- package/scripts/lint-copy-punctuation.mjs +60 -0
- package/scripts/lint-css-vars.mjs +175 -0
- package/scripts/lint-even-padding.mjs +58 -0
- package/scripts/lint-html-nesting.mjs +116 -0
- package/scripts/lint-label-case.mjs +219 -0
- package/scripts/lint-live-ctas.mjs +138 -0
- package/scripts/lint-microanimation.mjs +2 -2
- package/scripts/lint-proximity.mjs +181 -0
- package/scripts/lint-slop.mjs +1 -1
- package/scripts/lint-spacing-scale.mjs +78 -0
- package/scripts/lint-target-size.cjs +132 -0
- package/scripts/lint-token-primitives.mjs +307 -0
- package/scripts/on-system-score.mjs +95 -0
- package/scripts/size-audit.cjs +2 -2
- package/scripts/slop-rules.mjs +1 -1
- package/scripts/source-images.mjs +180 -0
- package/scripts/ux-tells.mjs +80 -0
- package/scripts/wcag-audit.cjs +25 -4
- package/src/api/brand-colors.ts +3 -0
- package/src/api/brand-fonts.ts +3 -0
- package/src/api/brand-mark.ts +6 -1
- package/src/api/dev-write-guard.ts +53 -0
- package/src/api/layers/file.ts +9 -4
- package/src/api/onboarding-extract.ts +85 -30
- package/src/api/onboarding.ts +3 -0
- package/src/api/save-tokens.ts +3 -0
- package/src/api/site-auth.ts +14 -2
- package/src/app/layout.tsx +6 -0
- package/src/app/preview/canvas/page.tsx +12 -0
- package/src/app/preview/components/page.tsx +828 -14
- package/src/app/preview/sticker-sheet/page.tsx +329 -0
- package/src/app/preview/sticker-sheet/specimens.tsx +296 -0
- package/src/app/preview/studio/blank-screen.tsx +143 -0
- package/src/app/preview/studio/page.tsx +7 -0
- package/src/app/shell.tsx +164 -47
- package/src/components/Foundations/Colors.stories.tsx +119 -8
- package/src/components/canvas/canvas.tsx +458 -0
- package/src/components/canvas/layout.ts +72 -0
- package/src/components/canvas/parse-canvas.ts +32 -0
- package/src/components/canvas/sample.ts +90 -0
- package/src/components/canvas/spec-frame.tsx +43 -0
- package/src/components/canvas/types.ts +33 -0
- package/src/components/docs-tab.tsx +7 -7
- package/src/components/home-recent.tsx +73 -0
- package/src/components/home-tab.tsx +19 -14
- package/src/components/layers-tab.tsx +2 -2
- package/src/components/markdown-preview.tsx +60 -12
- package/src/components/onboarding-wizard.tsx +1 -1
- package/src/components/studio/control-panel.tsx +299 -0
- package/src/components/studio/control-row.tsx +77 -0
- package/src/components/studio/preview-frame.tsx +165 -0
- package/src/components/studio/preview-pane.tsx +247 -0
- package/src/components/studio/studio.tsx +133 -128
- package/src/components/studio/types.ts +218 -0
- package/src/components/studio/use-studio-tweaks.ts +128 -0
- package/src/components/studio/use-studio-view-state.ts +72 -0
- package/src/components/ui/autocomplete.tsx +1 -1
- package/src/components/ui/avatar.tsx +4 -0
- package/src/components/ui/chart.tsx +134 -42
- package/src/components/ui/checkbox-group.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/color-picker.tsx +20 -4
- package/src/components/ui/combobox.tsx +1 -0
- package/src/components/ui/command.tsx +1 -1
- package/src/components/ui/data-table.tsx +64 -3
- package/src/components/ui/date-field.tsx +1 -1
- package/src/components/ui/date-picker.tsx +2 -0
- package/src/components/ui/date-range-picker.tsx +4 -0
- package/src/components/ui/editable.tsx +1 -0
- package/src/components/ui/faceted-filter.tsx +187 -0
- package/src/components/ui/file-upload.tsx +21 -2
- package/src/components/ui/gauge-chart.tsx +18 -4
- package/src/components/ui/heatmap.tsx +3 -1
- package/src/components/ui/inline-edit.tsx +175 -0
- package/src/components/ui/input-group.tsx +5 -2
- package/src/components/ui/month-picker.tsx +1 -1
- package/src/components/ui/multi-select.tsx +1 -0
- package/src/components/ui/number-input.tsx +28 -5
- package/src/components/ui/otp-input.tsx +208 -0
- package/src/components/ui/phone-input.tsx +274 -0
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/search-input.tsx +1 -1
- package/src/components/ui/sparkline.tsx +33 -4
- package/src/components/ui/spinner.tsx +23 -4
- package/src/components/ui/table.tsx +9 -0
- package/src/components/ui/tags-input.tsx +1 -1
- package/src/components/ui/timer.tsx +1 -0
- package/src/components/ui/transfer-list.tsx +13 -26
- package/src/components/ui/week-picker.tsx +1 -13
- package/src/components/ui/year-picker.tsx +1 -1
- package/src/data/component-added.json +966 -0
- package/src/data/docs-index.ts +35 -2
- package/src/data/history.json +161 -161
- package/src/data/sticker-sheet.json +9244 -0
- package/src/docs-trace-globs.json +1 -0
- package/src/hooks/use-global-mono-font.ts +1 -0
- package/src/hooks/use-global-primary-color.ts +1 -0
- package/src/hooks/use-global-sans-font.ts +1 -0
- package/src/hooks/use-global-serif-font.ts +1 -0
- package/src/hooks/use-global-type-scale.ts +17 -2
- package/src/hooks/use-mobile.ts +2 -0
- package/src/hooks/use-sync-type-scale.ts +7 -11
- package/src/lib/chart-motion.ts +41 -0
- package/src/lib/get-icon-color.ts +1 -1
- package/src/lib/spec-parse.ts +4 -0
- package/src/lib/svg-sanitize.ts +19 -9
- package/src/stories/Accordion.stories.tsx +7 -0
- package/src/stories/ActionBar.stories.tsx +5 -0
- package/src/stories/Affix.stories.tsx +4 -0
- package/src/stories/AiBadge.stories.tsx +9 -7
- package/src/stories/Alert.stories.tsx +13 -0
- package/src/stories/AlertDialog.stories.tsx +4 -0
- package/src/stories/Anchor.stories.tsx +5 -0
- package/src/stories/AngleSlider.stories.tsx +6 -3
- package/src/stories/AspectRatio.stories.tsx +4 -0
- package/src/stories/Autocomplete.stories.tsx +8 -0
- package/src/stories/Avatar.stories.tsx +10 -0
- package/src/stories/Badge.stories.tsx +14 -6
- package/src/stories/Blockquote.stories.tsx +6 -0
- package/src/stories/BottomNavigation.stories.tsx +4 -0
- package/src/stories/Breadcrumb.stories.tsx +3 -0
- package/src/stories/Burger.stories.tsx +1 -0
- package/src/stories/Button.stories.tsx +24 -0
- package/src/stories/ButtonGroup.stories.tsx +9 -0
- package/src/stories/Calendar.stories.tsx +3 -0
- package/src/stories/Canvas.stories.tsx +45 -0
- package/src/stories/Card.stories.tsx +4 -0
- package/src/stories/Carousel.stories.tsx +6 -0
- package/src/stories/Cascader.stories.tsx +4 -0
- package/src/stories/Chart.stories.tsx +46 -1
- package/src/stories/ChatBubble.stories.tsx +8 -2
- package/src/stories/ChatMarker.stories.tsx +1 -0
- package/src/stories/Checkbox.stories.tsx +40 -0
- package/src/stories/CheckboxCard.stories.tsx +8 -0
- package/src/stories/CheckboxGroup.stories.tsx +19 -0
- package/src/stories/Chip.stories.tsx +10 -19
- package/src/stories/CircularProgress.stories.tsx +13 -27
- package/src/stories/Clipboard.stories.tsx +6 -0
- package/src/stories/CloseButton.stories.tsx +6 -4
- package/src/stories/Code.stories.tsx +8 -1
- package/src/stories/Collapsible.stories.tsx +2 -0
- package/src/stories/ColorPicker.stories.tsx +46 -0
- package/src/stories/ColorSwatch.stories.tsx +1 -0
- package/src/stories/Combobox.stories.tsx +9 -0
- package/src/stories/Command.stories.tsx +2 -0
- package/src/stories/Container.stories.tsx +8 -0
- package/src/stories/ContextMenu.stories.tsx +9 -0
- package/src/stories/CopyButton.stories.tsx +12 -36
- package/src/stories/DataList.stories.tsx +8 -0
- package/src/stories/DataTable.stories.tsx +39 -0
- package/src/stories/DateField.stories.tsx +28 -0
- package/src/stories/DatePicker.stories.tsx +34 -0
- package/src/stories/DateRangePicker.stories.tsx +32 -0
- package/src/stories/Dialog.stories.tsx +8 -0
- package/src/stories/Drawer.stories.tsx +6 -0
- package/src/stories/DropdownMenu.stories.tsx +2 -0
- package/src/stories/Editable.stories.tsx +12 -0
- package/src/stories/EmptyState.stories.tsx +9 -0
- package/src/stories/FacetedFilter.stories.tsx +197 -0
- package/src/stories/Field.stories.tsx +7 -0
- package/src/stories/Fieldset.stories.tsx +8 -0
- package/src/stories/FileButton.stories.tsx +4 -0
- package/src/stories/FileUpload.stories.tsx +16 -17
- package/src/stories/FloatLabel.stories.tsx +3 -8
- package/src/stories/FloatingActionButton.stories.tsx +10 -0
- package/src/stories/FloatingIndicator.stories.tsx +4 -0
- package/src/stories/FloatingPanel.stories.tsx +6 -0
- package/src/stories/FocusTrap.stories.tsx +5 -0
- package/src/stories/FormatByte.stories.tsx +6 -0
- package/src/stories/FormatDate.stories.tsx +8 -0
- package/src/stories/FormatNumber.stories.tsx +9 -0
- package/src/stories/GaugeChart.stories.tsx +9 -3
- package/src/stories/Heatmap.stories.tsx +11 -0
- package/src/stories/Highlight.stories.tsx +6 -0
- package/src/stories/HoverCard.stories.tsx +4 -0
- package/src/stories/Image.stories.tsx +9 -0
- package/src/stories/Indicator.stories.tsx +19 -0
- package/src/stories/InlineEdit.stories.tsx +106 -0
- package/src/stories/Input.stories.tsx +7 -0
- package/src/stories/InputClearButton.stories.tsx +3 -0
- package/src/stories/InputGroup.stories.tsx +40 -0
- package/src/stories/Kbd.stories.tsx +7 -1
- package/src/stories/KeyboardShortcut.stories.tsx +2 -0
- package/src/stories/Label.stories.tsx +2 -0
- package/src/stories/Link.stories.tsx +9 -0
- package/src/stories/List.stories.tsx +8 -0
- package/src/stories/Listbox.stories.tsx +1 -0
- package/src/stories/LoadingDots.stories.tsx +5 -3
- package/src/stories/LoadingOverlay.stories.tsx +5 -1
- package/src/stories/Mark.stories.tsx +5 -0
- package/src/stories/MarkdownPreview.stories.tsx +53 -0
- package/src/stories/Marquee.stories.tsx +4 -0
- package/src/stories/Masonry.stories.tsx +5 -0
- package/src/stories/Menubar.stories.tsx +3 -0
- package/src/stories/Meter.stories.tsx +11 -17
- package/src/stories/MonthPicker.stories.tsx +26 -1
- package/src/stories/MotionToggle.stories.tsx +1 -0
- package/src/stories/MultiSelect.stories.tsx +9 -0
- package/src/stories/NativeSelect.stories.tsx +1 -0
- package/src/stories/NavLink.stories.tsx +7 -0
- package/src/stories/NavigationMenu.stories.tsx +5 -0
- package/src/stories/NavigationRail.stories.tsx +10 -0
- package/src/stories/Notification.stories.tsx +13 -34
- package/src/stories/NumberInput.stories.tsx +33 -1
- package/src/stories/OtpInput.stories.tsx +110 -0
- package/src/stories/Overlay.stories.tsx +5 -1
- package/src/stories/Pagination.stories.tsx +8 -0
- package/src/stories/PasswordInput.stories.tsx +2 -0
- package/src/stories/PhoneInput.stories.tsx +127 -0
- package/src/stories/PinInput.stories.tsx +9 -2
- package/src/stories/Popover.stories.tsx +2 -0
- package/src/stories/Progress.stories.tsx +6 -1
- package/src/stories/Prose.stories.tsx +8 -0
- package/src/stories/QrCode.stories.tsx +2 -0
- package/src/stories/Questionnaire.stories.tsx +7 -0
- package/src/stories/RadioGroup.stories.tsx +40 -0
- package/src/stories/RatingGroup.stories.tsx +8 -4
- package/src/stories/Resizable.stories.tsx +4 -2
- package/src/stories/Result.stories.tsx +3 -0
- package/src/stories/Reveal.stories.tsx +2 -0
- package/src/stories/RollingNumber.stories.tsx +5 -0
- package/src/stories/ScrollArea.stories.tsx +3 -1
- package/src/stories/SearchInput.stories.tsx +10 -6
- package/src/stories/SegmentedControl.stories.tsx +11 -0
- package/src/stories/Select.stories.tsx +7 -0
- package/src/stories/Separator.stories.tsx +6 -0
- package/src/stories/Sheet.stories.tsx +5 -0
- package/src/stories/Sidebar.stories.tsx +40 -1
- package/src/stories/SimpleGrid.stories.tsx +5 -0
- package/src/stories/Skeleton.stories.tsx +8 -0
- package/src/stories/SkeletonTable.stories.tsx +6 -5
- package/src/stories/SkipLink.stories.tsx +3 -0
- package/src/stories/Slider.stories.tsx +2 -1
- package/src/stories/Sonner.stories.tsx +7 -0
- package/src/stories/Sparkline.stories.tsx +14 -1
- package/src/stories/Spinner.stories.tsx +20 -10
- package/src/stories/Spoiler.stories.tsx +5 -0
- package/src/stories/Squircle.stories.tsx +7 -0
- package/src/stories/Stack.stories.tsx +7 -0
- package/src/stories/StatusBadge.stories.tsx +12 -6
- package/src/stories/Stepper.stories.tsx +5 -0
- package/src/stories/Switch.stories.tsx +4 -0
- package/src/stories/Table.stories.tsx +10 -1
- package/src/stories/Tabs.stories.tsx +8 -0
- package/src/stories/Tag.stories.tsx +13 -5
- package/src/stories/TagsInput.stories.tsx +15 -0
- package/src/stories/Text.stories.tsx +12 -0
- package/src/stories/Textarea.stories.tsx +9 -0
- package/src/stories/ThemeIcon.stories.tsx +6 -3
- package/src/stories/TimePicker.stories.tsx +2 -0
- package/src/stories/Timeline.stories.tsx +12 -0
- package/src/stories/Timer.stories.tsx +30 -0
- package/src/stories/Toggle.stories.tsx +7 -5
- package/src/stories/ToggleGroup.stories.tsx +5 -0
- package/src/stories/ToggleTip.stories.tsx +4 -0
- package/src/stories/Toolbar.stories.tsx +6 -0
- package/src/stories/Tooltip.stories.tsx +3 -0
- package/src/stories/Tour.stories.tsx +3 -0
- package/src/stories/TransferList.stories.tsx +7 -0
- package/src/stories/TreeSelect.stories.tsx +4 -0
- package/src/stories/TreeView.stories.tsx +5 -0
- package/src/stories/TypingIndicator.stories.tsx +4 -0
- package/src/stories/VisuallyHidden.stories.tsx +3 -0
- package/src/stories/Watermark.stories.tsx +6 -0
- package/src/stories/WeekPicker.stories.tsx +25 -1
- package/src/stories/WordRotate.stories.tsx +5 -0
- package/src/stories/YearPicker.stories.tsx +26 -11
- package/src/stories/story-groups.json +22 -16
- package/src/styles.css +50 -2
- package/src/tokens.json +86 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behavioral-agentic-design-system/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "BADS core — tokens, shadcn/ui components, and the BADS template shell (app routes, customize tab, theme hooks). Forks consume this and re-export, keeping client repos to ~30 lines of glue.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Matthew Stephens <work@matthewstephens.com> (https://github.com/matthewlarn)",
|
|
@@ -41,24 +41,45 @@
|
|
|
41
41
|
"bads-a11y-ratchet": "scripts/a11y-ratchet.mjs",
|
|
42
42
|
"bads-build-fonts": "scripts/build-fonts.cjs",
|
|
43
43
|
"bads-build-tokens": "scripts/build-tokens.cjs",
|
|
44
|
+
"bads-check-dark-contrast": "scripts/check-dark-contrast.mjs",
|
|
45
|
+
"bads-check-flush-edges": "scripts/check-flush-edges.mjs",
|
|
46
|
+
"bads-check-spec": "scripts/check-spec.mjs",
|
|
44
47
|
"bads-check-stories": "scripts/check-stories.mjs",
|
|
45
48
|
"bads-check-sync": "scripts/check-sync.mjs",
|
|
46
49
|
"bads-components": "scripts/bads-components.mjs",
|
|
50
|
+
"bads-deal-directions": "scripts/deal-directions.mjs",
|
|
47
51
|
"bads-doctor": "scripts/bads-doctor.mjs",
|
|
52
|
+
"bads-ds-advisory": "scripts/design-system-advisory/run.mjs",
|
|
48
53
|
"bads-fix-stories": "scripts/fix-stories.mjs",
|
|
49
54
|
"bads-generate-stories": "scripts/generate-stories.cjs",
|
|
50
55
|
"bads-health-report": "scripts/health-report.mjs",
|
|
51
56
|
"bads-lint-accent-text": "scripts/accent-as-text.mjs",
|
|
52
57
|
"bads-lint-component-source": "scripts/lint-component-source.mjs",
|
|
58
|
+
"bads-lint-css-vars": "scripts/lint-css-vars.mjs",
|
|
53
59
|
"bads-lint-ethics": "scripts/lint-ethics-contract.mjs",
|
|
60
|
+
"bads-lint-html-nesting": "scripts/lint-html-nesting.mjs",
|
|
61
|
+
"bads-lint-live-ctas": "scripts/lint-live-ctas.mjs",
|
|
62
|
+
"bads-lint-arbitrary-tokens": "scripts/lint-arbitrary-tokens.mjs",
|
|
63
|
+
"bads-lint-content-hierarchy": "scripts/lint-content-hierarchy.mjs",
|
|
64
|
+
"bads-lint-control-baseline": "scripts/lint-control-baseline.mjs",
|
|
65
|
+
"bads-lint-copy-punctuation": "scripts/lint-copy-punctuation.mjs",
|
|
66
|
+
"bads-lint-even-padding": "scripts/lint-even-padding.mjs",
|
|
67
|
+
"bads-lint-label-case": "scripts/lint-label-case.mjs",
|
|
68
|
+
"bads-lint-proximity": "scripts/lint-proximity.mjs",
|
|
69
|
+
"bads-lint-spacing-scale": "scripts/lint-spacing-scale.mjs",
|
|
54
70
|
"bads-lint-microanimation": "./scripts/lint-microanimation.mjs",
|
|
55
71
|
"bads-lint-slop": "scripts/lint-slop.mjs",
|
|
72
|
+
"bads-lint-target-size": "scripts/lint-target-size.cjs",
|
|
56
73
|
"bads-lint-token-intent": "scripts/lint-token-intent.mjs",
|
|
74
|
+
"bads-lint-token-primitives": "scripts/lint-token-primitives.mjs",
|
|
57
75
|
"bads-oklch-to-hex": "scripts/oklch-to-hex.cjs",
|
|
76
|
+
"bads-on-system": "scripts/on-system-score.mjs",
|
|
58
77
|
"bads-size-audit": "scripts/size-audit.cjs",
|
|
78
|
+
"bads-source-images": "scripts/source-images.mjs",
|
|
59
79
|
"bads-sync": "scripts/bads-sync.mjs",
|
|
60
80
|
"bads-token-nearest": "scripts/token-nearest.mjs",
|
|
61
81
|
"bads-ux-smoke": "./scripts/ux-smoke.mjs",
|
|
82
|
+
"bads-ux-tells": "scripts/ux-tells.mjs",
|
|
62
83
|
"bads-wcag-audit": "scripts/wcag-audit.cjs"
|
|
63
84
|
},
|
|
64
85
|
"exports": {
|
|
@@ -88,6 +109,10 @@
|
|
|
88
109
|
"./components/dev-identity-badge": "./src/components/dev-identity-badge.tsx",
|
|
89
110
|
"./components/onboarding-wizard": "./src/components/onboarding-wizard.tsx",
|
|
90
111
|
"./components/customize/*": "./src/components/customize/*.tsx",
|
|
112
|
+
"./components/canvas/*": "./src/components/canvas/*.tsx",
|
|
113
|
+
"./components/canvas/parse-canvas": "./src/components/canvas/parse-canvas.ts",
|
|
114
|
+
"./components/canvas/types": "./src/components/canvas/types.ts",
|
|
115
|
+
"./components/canvas/sample": "./src/components/canvas/sample.ts",
|
|
91
116
|
"./components/motion/*": "./src/components/motion/*.tsx",
|
|
92
117
|
"./components/Foundations/*": "./src/components/Foundations/*.tsx",
|
|
93
118
|
"./app/page": "./src/app/page.tsx",
|
|
@@ -100,9 +125,11 @@
|
|
|
100
125
|
"./app/preview/global-font-client": "./src/app/preview/global-font-client.tsx",
|
|
101
126
|
"./app/preview/cards/page": "./src/app/preview/cards/page.tsx",
|
|
102
127
|
"./app/preview/components/page": "./src/app/preview/components/page.tsx",
|
|
128
|
+
"./app/preview/sticker-sheet/page": "./src/app/preview/sticker-sheet/page.tsx",
|
|
103
129
|
"./app/preview/dashboard/page": "./src/app/preview/dashboard/page.tsx",
|
|
104
130
|
"./app/preview/mail/page": "./src/app/preview/mail/page.tsx",
|
|
105
131
|
"./app/preview/pricing/page": "./src/app/preview/pricing/page.tsx",
|
|
132
|
+
"./app/preview/studio/page": "./src/app/preview/studio/page.tsx",
|
|
106
133
|
"./app/preview/typography/page": "./src/app/preview/typography/page.tsx",
|
|
107
134
|
"./api/bads-update-check": "./src/api/bads-update-check.ts",
|
|
108
135
|
"./api/layers": "./src/api/layers.ts",
|
|
@@ -121,11 +148,13 @@
|
|
|
121
148
|
"access": "public"
|
|
122
149
|
},
|
|
123
150
|
"dependencies": {
|
|
124
|
-
"@radix-ui/react-alert-dialog": "^1.1
|
|
151
|
+
"@radix-ui/react-alert-dialog": "^1.2.1",
|
|
125
152
|
"@xmldom/xmldom": "^0.9.12",
|
|
153
|
+
"@xyflow/react": "12.12.0",
|
|
126
154
|
"cheerio": "^1.0.0",
|
|
127
155
|
"class-variance-authority": "^0.7.0",
|
|
128
156
|
"clsx": "^2.1.0",
|
|
157
|
+
"react-colorful": "^5.8.1",
|
|
129
158
|
"react-markdown": "^10.1.0",
|
|
130
159
|
"remark-gfm": "^4.0.1",
|
|
131
160
|
"tailwind-merge": "^3.7.0",
|
|
@@ -163,6 +192,7 @@
|
|
|
163
192
|
"@tanstack/react-table": "^8",
|
|
164
193
|
"cmdk": "*",
|
|
165
194
|
"lucide-react": "*",
|
|
195
|
+
"next": ">=15",
|
|
166
196
|
"next-themes": "*",
|
|
167
197
|
"react": ">=18",
|
|
168
198
|
"react-day-picker": "^10.0.1",
|
|
@@ -202,9 +232,6 @@
|
|
|
202
232
|
"@radix-ui/react-dialog": {
|
|
203
233
|
"optional": true
|
|
204
234
|
},
|
|
205
|
-
"@radix-ui/react-navigation-menu": {
|
|
206
|
-
"optional": true
|
|
207
|
-
},
|
|
208
235
|
"@radix-ui/react-dropdown-menu": {
|
|
209
236
|
"optional": true
|
|
210
237
|
},
|
|
@@ -217,6 +244,9 @@
|
|
|
217
244
|
"@radix-ui/react-menubar": {
|
|
218
245
|
"optional": true
|
|
219
246
|
},
|
|
247
|
+
"@radix-ui/react-navigation-menu": {
|
|
248
|
+
"optional": true
|
|
249
|
+
},
|
|
220
250
|
"@radix-ui/react-popover": {
|
|
221
251
|
"optional": true
|
|
222
252
|
},
|
|
@@ -265,13 +295,13 @@
|
|
|
265
295
|
"lucide-react": {
|
|
266
296
|
"optional": true
|
|
267
297
|
},
|
|
268
|
-
"next
|
|
298
|
+
"next": {
|
|
269
299
|
"optional": true
|
|
270
300
|
},
|
|
271
|
-
"
|
|
301
|
+
"next-themes": {
|
|
272
302
|
"optional": true
|
|
273
303
|
},
|
|
274
|
-
"react-
|
|
304
|
+
"react-day-picker": {
|
|
275
305
|
"optional": true
|
|
276
306
|
},
|
|
277
307
|
"recharts": {
|
package/scripts/a11y-lint.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Scans .tsx and .stories.tsx files under app/, components/, and packages/core/,
|
|
6
6
|
* and flags common AAA-blocking patterns. Complements:
|
|
7
7
|
* - scripts/wcag-audit.js (token contrast)
|
|
8
|
-
* -
|
|
8
|
+
* - lint-target-size.cjs (touch-target sizes, `bads-lint-target-size`)
|
|
9
9
|
* - scripts/lint-tokens.js (token usage)
|
|
10
10
|
*
|
|
11
11
|
* Checks (each tied to a WCAG SC):
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* 3.3.2 Labels or Instructions — <input> without associated <Label> or aria-label
|
|
19
19
|
* 4.1.2 Name, Role, Value — <button> with no text and no aria-label
|
|
20
20
|
* BADS-WEIGHT Font weight floor — text-xs/text-sm must be font-medium (500) or heavier
|
|
21
|
+
* BADS-LIVE Conditional aria-live — aria-live/role="status|alert|log" inside a JSX conditional
|
|
21
22
|
*
|
|
22
23
|
* Run:
|
|
23
24
|
* bads-a11y-lint # report violations, exit 1 on fail
|
|
@@ -61,7 +62,7 @@ const advisory = process.argv.includes('--warn');
|
|
|
61
62
|
// "client") downgrades the AAA and house-opinion rules below to warnings —
|
|
62
63
|
// still reported, never silently dropped — while every Level A rule keeps
|
|
63
64
|
// blocking. See docs/superpowers/specs/2026-09-10-client-owned-components-design.md
|
|
64
|
-
// → "Accessibility floor: flag, do not enforce" and
|
|
65
|
+
// → "Accessibility floor: flag, do not enforce" and AGENTS.md → Accessibility
|
|
65
66
|
// Floor. readSourceOfTruth() never throws and defaults to "bads" when there's
|
|
66
67
|
// no identity file, so upstream BADS and every fork that hasn't opted in see
|
|
67
68
|
// zero behaviour change.
|
|
@@ -73,7 +74,7 @@ const CLIENT_OWNED = readSourceOfTruth(ROOT).components === 'client';
|
|
|
73
74
|
// weight floor) and BADS-CHART (hand-rolled chart) all belong here. The four
|
|
74
75
|
// Level A codes (1.1.1, 2.1.1, 2.4.4, 4.1.2) are deliberately absent — those
|
|
75
76
|
// are real defects in anyone's markup and keep blocking in every mode.
|
|
76
|
-
const WARN_IN_CLIENT_MODE = new Set(['1.4.4', '1.4.6', '2.4.13', 'BADS-WEIGHT', 'BADS-CHART']);
|
|
77
|
+
const WARN_IN_CLIENT_MODE = new Set(['1.4.4', '1.4.6', '2.4.13', 'BADS-WEIGHT', 'BADS-CHART', 'BADS-LIVE']);
|
|
77
78
|
const CLIENT_OWNED_NOTE = ' (warned, not failed: components are client-owned)';
|
|
78
79
|
|
|
79
80
|
function isDowngraded(it) {
|
|
@@ -89,6 +90,64 @@ function flag(file, line, sc, rule, message) {
|
|
|
89
90
|
issues.push({ file: path.relative(ROOT, file), line, sc, rule, message });
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
// ---- comment stripping --------------------------------------------------
|
|
94
|
+
//
|
|
95
|
+
// Every rule below is a line-wise regex. Before 2026-11-09 they ran over the raw
|
|
96
|
+
// file, comments included, so a comment that NAMED a problem failed the build:
|
|
97
|
+
// a note recording a measured contrast value tripped hex-literal, and a doc
|
|
98
|
+
// comment that said "img" tripped image-no-alt. Writers then reworded true notes
|
|
99
|
+
// to get past the gate. So the rules now run on a copy of the file where each
|
|
100
|
+
// comment is replaced by spaces. Newlines stay, so line numbers do not move.
|
|
101
|
+
//
|
|
102
|
+
// The allow-* escape hatches ARE comments. They are still read from the raw
|
|
103
|
+
// line, never from the stripped one.
|
|
104
|
+
//
|
|
105
|
+
// Strings are kept as they are: a hex inside a string is a real style value.
|
|
106
|
+
// A `//` directly after `:` is a URL ("https://…" in JSX text), not a comment.
|
|
107
|
+
// Single and double quotes do not cross a newline (JS strings cannot), so an
|
|
108
|
+
// apostrophe in JSX text ("Don't") can confuse at most one line, and the
|
|
109
|
+
// mistake is always in the safe direction: a comment left in, never code
|
|
110
|
+
// removed.
|
|
111
|
+
function stripComments(src) {
|
|
112
|
+
let out = '';
|
|
113
|
+
let i = 0;
|
|
114
|
+
const n = src.length;
|
|
115
|
+
const blank = (s) => s.replace(/[^\n]/g, ' ');
|
|
116
|
+
while (i < n) {
|
|
117
|
+
const c = src[i];
|
|
118
|
+
const next = src[i + 1];
|
|
119
|
+
if (c === '"' || c === "'" || c === '`') {
|
|
120
|
+
let j = i + 1;
|
|
121
|
+
while (j < n) {
|
|
122
|
+
if (src[j] === '\\') { j += 2; continue; }
|
|
123
|
+
if (src[j] === c) { j++; break; }
|
|
124
|
+
if (src[j] === '\n' && c !== '`') break;
|
|
125
|
+
j++;
|
|
126
|
+
}
|
|
127
|
+
out += src.slice(i, j);
|
|
128
|
+
i = j;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (c === '/' && next === '*') {
|
|
132
|
+
const end = src.indexOf('*/', i + 2);
|
|
133
|
+
const j = end === -1 ? n : end + 2;
|
|
134
|
+
out += blank(src.slice(i, j));
|
|
135
|
+
i = j;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (c === '/' && next === '/' && src[i - 1] !== ':') {
|
|
139
|
+
let j = src.indexOf('\n', i);
|
|
140
|
+
if (j === -1) j = n;
|
|
141
|
+
out += blank(src.slice(i, j));
|
|
142
|
+
i = j;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
out += c;
|
|
146
|
+
i++;
|
|
147
|
+
}
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
150
|
+
|
|
92
151
|
// ---- per-line scans -----------------------------------------------------
|
|
93
152
|
|
|
94
153
|
const HARDCODED_HEX = /(?:bg-|text-|border-|fill-|stroke-|from-|to-|via-|shadow-|ring-)\[#[0-9A-Fa-f]{3,8}\]|(?<!\$value":\s")#[0-9A-Fa-f]{6}(?![A-Fa-f0-9"])/;
|
|
@@ -206,9 +265,14 @@ for (const file of files) {
|
|
|
206
265
|
|
|
207
266
|
const TS = scaleFor(file);
|
|
208
267
|
|
|
268
|
+
// `lines` is the raw file, read only for allow-* hatches. `line` is the same
|
|
269
|
+
// line with its comments blanked, and every rule tests that.
|
|
270
|
+
const code = stripComments(src);
|
|
209
271
|
const lines = src.split('\n');
|
|
272
|
+
const codeLines = code.split('\n');
|
|
210
273
|
for (let i = 0; i < lines.length; i++) {
|
|
211
|
-
const
|
|
274
|
+
const raw = lines[i];
|
|
275
|
+
const line = codeLines[i];
|
|
212
276
|
const lineNum = i + 1;
|
|
213
277
|
|
|
214
278
|
// Escape hatch, same convention as allow-small-text below: same line or
|
|
@@ -218,9 +282,9 @@ for (const file of files) {
|
|
|
218
282
|
// literal TEXT CONTENT describing a color (e.g. the Customize tab's own
|
|
219
283
|
// "#171717 · selected" picker label) is data, not an uncontrolled style
|
|
220
284
|
// decision — the thing SC 1.4.6 actually cares about.
|
|
221
|
-
const allowHex = /\/\/\s*allow-hex-literal/.test(
|
|
285
|
+
const allowHex = /\/\/\s*allow-hex-literal/.test(raw)
|
|
222
286
|
|| (i > 0 && /allow-hex-literal/.test(lines[i - 1]));
|
|
223
|
-
const allowInlinePx = /\/\/\s*allow-inline-px-font/.test(
|
|
287
|
+
const allowInlinePx = /\/\/\s*allow-inline-px-font/.test(raw)
|
|
224
288
|
|| (i > 0 && /allow-inline-px-font/.test(lines[i - 1]));
|
|
225
289
|
|
|
226
290
|
if (HARDCODED_HEX.test(line) && !skipTokenRules && !allowHex) {
|
|
@@ -237,7 +301,7 @@ for (const file of files) {
|
|
|
237
301
|
// text-[11px] is in exactly the position the named-step comment describes, and before
|
|
238
302
|
// this the two paths disagreed: `text-xs` could be excused and `text-[11px]` could not,
|
|
239
303
|
// so a fork mirroring a client's real UI had no way to record the deviation.
|
|
240
|
-
const allowSmallText = /\/\/\s*allow-small-text/.test(
|
|
304
|
+
const allowSmallText = /\/\/\s*allow-small-text/.test(raw)
|
|
241
305
|
|| (i > 0 && /allow-small-text/.test(lines[i - 1]));
|
|
242
306
|
let match;
|
|
243
307
|
ARBITRARY_TEXT_PX.lastIndex = 0;
|
|
@@ -253,7 +317,7 @@ for (const file of files) {
|
|
|
253
317
|
// weight-floor one: some vendored components legitimately ship a smaller step, and that
|
|
254
318
|
// belongs in an upstream finding rather than a local edit.
|
|
255
319
|
if (TS.namedBelowFloor && TS.namedBelowFloor.test(line)
|
|
256
|
-
&& !/\/\/\s*allow-small-text/.test(
|
|
320
|
+
&& !/\/\/\s*allow-small-text/.test(raw)
|
|
257
321
|
&& !(i > 0 && /allow-small-text/.test(lines[i - 1]))) {
|
|
258
322
|
const step = TS.namedBelowFloor.exec(line)[1];
|
|
259
323
|
flag(file, lineNum, '1.4.4', 'tiny-text',
|
|
@@ -262,12 +326,35 @@ for (const file of files) {
|
|
|
262
326
|
|
|
263
327
|
// BADS-WEIGHT — small text (text-xs/text-sm, <18px) must be font-medium (500) or heavier.
|
|
264
328
|
if (TS.smallTextLightWeight && TS.smallTextLightWeight.test(line)
|
|
265
|
-
&& !/\/\/\s*allow-font-normal-small/.test(
|
|
329
|
+
&& !/\/\/\s*allow-font-normal-small/.test(raw)
|
|
266
330
|
&& !(i > 0 && /allow-font-normal-small/.test(lines[i - 1]))) {
|
|
267
331
|
flag(file, lineNum, 'BADS-WEIGHT', 'small-text-light-weight',
|
|
268
332
|
`font-normal (or lighter) on a step below ${WEIGHT_FLOOR_PX}px (${TS.smallStepsDesc}). Weight floor: font-medium (500) minimum. Add "// allow-font-normal-small" above to intentionally bypass.`);
|
|
269
333
|
}
|
|
270
334
|
|
|
335
|
+
// BADS-LIVE — aria-live region inside a JSX conditional.
|
|
336
|
+
// A <div aria-live> (or role="status/alert/log") that is conditionally
|
|
337
|
+
// rendered gets unmounted and remounted when the condition toggles. Screen
|
|
338
|
+
// readers don't re-announce a newly mounted live region — the live region
|
|
339
|
+
// silently breaks. Fix: persistently-mounted/empty-content pattern (keep
|
|
340
|
+
// the element in the DOM, set children based on state).
|
|
341
|
+
// Escape hatch: `// allow-conditional-aria-live <one-sentence reason>`
|
|
342
|
+
// on the flagged line or the line above.
|
|
343
|
+
if (!isStory) {
|
|
344
|
+
const ARIA_LIVE_ATTR = /\baria-live\s*=|\brole\s*=\s*["'](?:status|alert|log)["']/;
|
|
345
|
+
const JSX_CONDITIONAL = /\{[^}]*&&|\?[^:]*<[A-Z]/;
|
|
346
|
+
if (ARIA_LIVE_ATTR.test(line)) {
|
|
347
|
+
const prevLine = i > 0 ? codeLines[i - 1] : '';
|
|
348
|
+
const inConditional = JSX_CONDITIONAL.test(line) || JSX_CONDITIONAL.test(prevLine);
|
|
349
|
+
const allowed = /\/\/\s*allow-conditional-aria-live/.test(raw)
|
|
350
|
+
|| (i > 0 && /allow-conditional-aria-live/.test(lines[i - 1]));
|
|
351
|
+
if (inConditional && !allowed) {
|
|
352
|
+
flag(file, lineNum, 'BADS-LIVE', 'conditional-aria-live',
|
|
353
|
+
'aria-live region (or role="status/alert/log") inside a JSX conditional. Conditionally unmounting a live region breaks screen reader announcements on remount. Use the persistently-mounted/empty-content pattern: keep the element in the DOM and set its children based on state. Add "// allow-conditional-aria-live" with a reason to bypass.');
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
271
358
|
if (FOCUS_OUTLINE_NONE.test(line) && !/ring-|outline-|focus-visible:/.test(line)) {
|
|
272
359
|
flag(file, lineNum, '2.4.13', 'focus-removed',
|
|
273
360
|
'outline-none without a replacement focus indicator. AAA 2.4.13 requires a visible focus marker.');
|
|
@@ -329,12 +416,12 @@ for (const file of files) {
|
|
|
329
416
|
// Escape hatch: `// allow-handrolled-chart` anywhere in the file, with a
|
|
330
417
|
// reason (e.g. a bespoke draw-in hero recharts can't express).
|
|
331
418
|
if (!file.endsWith('.stories.tsx')
|
|
332
|
-
&& /<svg[\s>]/.test(
|
|
333
|
-
&& (
|
|
334
|
-
&& /<(?:path|polyline|line)[\s>]/.test(
|
|
335
|
-
&& !/components\/ui\/chart|ChartContainer|from\s+['"]recharts['"]/.test(
|
|
419
|
+
&& /<svg[\s>]/.test(code)
|
|
420
|
+
&& (code.match(/<text[\s>]/g) || []).length >= 2
|
|
421
|
+
&& /<(?:path|polyline|line)[\s>]/.test(code)
|
|
422
|
+
&& !/components\/ui\/chart|ChartContainer|from\s+['"]recharts['"]/.test(code)
|
|
336
423
|
&& !/allow-handrolled-chart/.test(src)) {
|
|
337
|
-
const svgLine =
|
|
424
|
+
const svgLine = codeLines.findIndex((l) => /<svg[\s>]/.test(l)) + 1;
|
|
338
425
|
flag(file, svgLine || 1, 'BADS-CHART', 'handrolled-chart',
|
|
339
426
|
'Hand-rolled chart SVG (data series + 2+ hand-placed <text> labels). Use the BADS Chart primitive — ChartContainer from "@<slug>/core/components/ui/chart". Recharts handles axis tick spacing and label collision/thinning that hand-placed <text> labels get wrong. Escape hatch: add "// allow-handrolled-chart" in the file with a reason.');
|
|
340
427
|
}
|
package/scripts/bads-sync.mjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* - brand.config.ts, brand-colors.json, packages/core/src/tokens.json
|
|
20
20
|
* - styles/client-extras.css (your local CSS additions)
|
|
21
21
|
* - layer-1-foundation/, layer-2-ethics-responsibility/, layer-6-patterns-and-rules/
|
|
22
|
-
* - public/logos/, CLAUDE.md
|
|
22
|
+
* - public/logos/, CLAUDE.md (AGENTS.md and docs/agent-rules/ are not pulled either: they ship by git merge or the plugin)
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { execSync } from 'node:child_process';
|
package/scripts/build-tokens.cjs
CHANGED
|
@@ -120,6 +120,41 @@ const darkVars = emitVars(tokens.theme.dark);
|
|
|
120
120
|
const fontSans = tokens.fontFamily.sans.$value;
|
|
121
121
|
const fontMono = tokens.fontFamily.mono.$value;
|
|
122
122
|
const fontSerif = tokens.fontFamily.serif.$value;
|
|
123
|
+
|
|
124
|
+
// One font stack from several pieces, each family once, in the order it first
|
|
125
|
+
// appears. The token value is joined to a fixed fallback tail below, so a fork
|
|
126
|
+
// whose token already ends in "ui-sans-serif, system-ui, sans-serif" got every
|
|
127
|
+
// family twice: ten entries, four repeats (FF-BADS UPSTREAM-FINDINGS 80). The
|
|
128
|
+
// browser stops at the first family it can use, so this changes nothing on
|
|
129
|
+
// screen; it makes the stack readable, which is how a fallback gets reviewed.
|
|
130
|
+
// Names compare without quotes and without case. A var(--x, 'Name') entry is
|
|
131
|
+
// never merged with a plain 'Name': the var resolves to a different face
|
|
132
|
+
// (next/font's self-hosted copy), so the two are not the same family.
|
|
133
|
+
function fontStack(...parts) {
|
|
134
|
+
const out = [];
|
|
135
|
+
const seen = new Set();
|
|
136
|
+
for (const part of parts) {
|
|
137
|
+
let depth = 0;
|
|
138
|
+
let cur = '';
|
|
139
|
+
const entries = [];
|
|
140
|
+
for (const ch of String(part)) {
|
|
141
|
+
if (ch === '(') depth++;
|
|
142
|
+
if (ch === ')') depth--;
|
|
143
|
+
if (ch === ',' && depth === 0) { entries.push(cur); cur = ''; continue; }
|
|
144
|
+
cur += ch;
|
|
145
|
+
}
|
|
146
|
+
entries.push(cur);
|
|
147
|
+
for (const raw of entries) {
|
|
148
|
+
const entry = raw.trim();
|
|
149
|
+
if (!entry) continue;
|
|
150
|
+
const key = entry.replace(/\s+/g, ' ').replace(/^['"]|['"]$/g, '').toLowerCase();
|
|
151
|
+
if (seen.has(key)) continue;
|
|
152
|
+
seen.add(key);
|
|
153
|
+
out.push(entry);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return out.join(', ');
|
|
157
|
+
}
|
|
123
158
|
// Variable-font axis settings, applied to html so the whole tree inherits
|
|
124
159
|
// them. Only meaningful when the active sans is a variable font (Inter
|
|
125
160
|
// Variable ships as the default). Forks tune type here without code change.
|
|
@@ -684,6 +719,22 @@ const baseLayer = `@layer base {
|
|
|
684
719
|
[aria-disabled="true"] {
|
|
685
720
|
cursor: not-allowed;
|
|
686
721
|
}
|
|
722
|
+
/* text-wrap: balance distributes line length evenly across all lines of
|
|
723
|
+
a heading, preventing the awkward single-word last line (widow) that
|
|
724
|
+
most headings produce at responsive widths. Supported Chrome 114+,
|
|
725
|
+
Firefox 121+, Safari 17.5+ (Baseline 2024). Falls back to normal wrap
|
|
726
|
+
with no visual regression in older engines. */
|
|
727
|
+
h1, h2, h3, h4, h5, h6 {
|
|
728
|
+
text-wrap: balance;
|
|
729
|
+
}
|
|
730
|
+
/* text-wrap: pretty prevents orphaned last words on paragraphs by
|
|
731
|
+
considering the last four lines when breaking. Supported Chrome 117+,
|
|
732
|
+
Firefox 130+ (Baseline 2025). Falls back to normal wrap — no adverse
|
|
733
|
+
effect. Performance overhead is negligible on typical paragraph lengths
|
|
734
|
+
(the engine short-circuits for < 4 lines). */
|
|
735
|
+
p {
|
|
736
|
+
text-wrap: pretty;
|
|
737
|
+
}
|
|
687
738
|
}
|
|
688
739
|
|
|
689
740
|
/* Global tracking offset — the Letter Spacing slider in the Customize
|
|
@@ -722,7 +773,7 @@ html, body {
|
|
|
722
773
|
hard edge at full opacity.
|
|
723
774
|
|
|
724
775
|
Forks with sticky chrome (a sidebar / top bar that stays put while the page
|
|
725
|
-
scrolls): see
|
|
776
|
+
scrolls): see docs/agent-rules/theme-transition-and-sticky-chrome.md -> "Theme transition and sticky chrome" before
|
|
726
777
|
naming any chrome. NEVER give a backdrop-filter element a view-transition-
|
|
727
778
|
name (its snapshot has no backdrop to sample and rasterizes as an opaque
|
|
728
779
|
white flash). */
|
|
@@ -1301,15 +1352,47 @@ const pkgCss = `${banner}
|
|
|
1301
1352
|
|
|
1302
1353
|
@custom-variant dark (&:is(.dark *));
|
|
1303
1354
|
|
|
1355
|
+
/* Sticker-sheet state pinning. Each variant keeps Tailwind's real behavior
|
|
1356
|
+
(hover stays behind the (hover: hover) media guard) and ALSO matches a
|
|
1357
|
+
data-pin attribute, so the sticker sheet can freeze hover, focus and
|
|
1358
|
+
pressed on a specimen without touching the component. Live interaction is
|
|
1359
|
+
unchanged because the real selectors are still there. */
|
|
1360
|
+
@custom-variant hover {
|
|
1361
|
+
&:is([data-pin~="hover"]) {
|
|
1362
|
+
@slot;
|
|
1363
|
+
}
|
|
1364
|
+
@media (hover: hover) {
|
|
1365
|
+
&:hover {
|
|
1366
|
+
@slot;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
@custom-variant focus-visible {
|
|
1371
|
+
&:is([data-pin~="focus"]) {
|
|
1372
|
+
@slot;
|
|
1373
|
+
}
|
|
1374
|
+
&:focus-visible {
|
|
1375
|
+
@slot;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
@custom-variant active {
|
|
1379
|
+
&:is([data-pin~="pressed"]) {
|
|
1380
|
+
@slot;
|
|
1381
|
+
}
|
|
1382
|
+
&:active {
|
|
1383
|
+
@slot;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1304
1387
|
:root {
|
|
1305
1388
|
color-scheme: light dark;
|
|
1306
1389
|
|
|
1307
1390
|
/* Brand sans from tokens.json leads. Atkinson Hyperlegible (loaded via the
|
|
1308
1391
|
Google Fonts @import above) is the canonical fallback so unbranded
|
|
1309
1392
|
consumers still get a high-legibility face out of the box. */
|
|
1310
|
-
--font-sans: ${fontSans
|
|
1311
|
-
--font-mono: ${fontMono};
|
|
1312
|
-
--font-serif: ${fontSerif};
|
|
1393
|
+
--font-sans: ${fontStack(fontSans, "'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui")};
|
|
1394
|
+
--font-mono: ${fontStack(fontMono)};
|
|
1395
|
+
--font-serif: ${fontStack(fontSerif)};
|
|
1313
1396
|
--font-variation-settings: ${fontVariationSettings};
|
|
1314
1397
|
--font-size-scale: 1;
|
|
1315
1398
|
|
|
@@ -1411,6 +1494,38 @@ const appCss = `${banner}
|
|
|
1411
1494
|
|
|
1412
1495
|
@custom-variant dark (&:is(.dark *));
|
|
1413
1496
|
|
|
1497
|
+
/* Sticker-sheet state pinning. Each variant keeps Tailwind's real behavior
|
|
1498
|
+
(hover stays behind the (hover: hover) media guard) and ALSO matches a
|
|
1499
|
+
data-pin attribute, so the sticker sheet can freeze hover, focus and
|
|
1500
|
+
pressed on a specimen without touching the component. Live interaction is
|
|
1501
|
+
unchanged because the real selectors are still there. */
|
|
1502
|
+
@custom-variant hover {
|
|
1503
|
+
&:is([data-pin~="hover"]) {
|
|
1504
|
+
@slot;
|
|
1505
|
+
}
|
|
1506
|
+
@media (hover: hover) {
|
|
1507
|
+
&:hover {
|
|
1508
|
+
@slot;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
@custom-variant focus-visible {
|
|
1513
|
+
&:is([data-pin~="focus"]) {
|
|
1514
|
+
@slot;
|
|
1515
|
+
}
|
|
1516
|
+
&:focus-visible {
|
|
1517
|
+
@slot;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
@custom-variant active {
|
|
1521
|
+
&:is([data-pin~="pressed"]) {
|
|
1522
|
+
@slot;
|
|
1523
|
+
}
|
|
1524
|
+
&:active {
|
|
1525
|
+
@slot;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1414
1529
|
:root {
|
|
1415
1530
|
/* Brand fonts from tokens.json lead so the picker selection actually
|
|
1416
1531
|
* shows up. next/font's preloaded vars come second as a self-hosted
|
|
@@ -1421,9 +1536,9 @@ const appCss = `${banner}
|
|
|
1421
1536
|
undefined, and a bare var() reference invalidates the entire
|
|
1422
1537
|
custom-property value at computed-value time, leaving --font-sans
|
|
1423
1538
|
empty and text falling through to browser default ("Times"). */
|
|
1424
|
-
--font-sans: ${fontSans
|
|
1425
|
-
--font-serif: ${fontSerif
|
|
1426
|
-
--font-mono: ${fontMono
|
|
1539
|
+
--font-sans: ${fontStack(fontSans, "var(--font-inter, 'Inter'), var(--font-atkinson, 'Atkinson Hyperlegible'), 'Atkinson Hyperlegible', ui-sans-serif, sans-serif, system-ui")};
|
|
1540
|
+
--font-serif: ${fontStack(fontSerif, "var(--font-source-serif, 'Source Serif 4'), 'Source Serif 4', Georgia, ui-serif, serif")};
|
|
1541
|
+
--font-mono: ${fontStack(fontMono, "var(--font-jetbrains, 'JetBrains Mono'), 'JetBrains Mono', ui-monospace, monospace")};
|
|
1427
1542
|
--font-variation-settings: ${fontVariationSettings};
|
|
1428
1543
|
--font-size-scale: 1;
|
|
1429
1544
|
|