@reqvire-org/ads 0.5.0 → 0.5.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 +9 -6
- package/dist/ads-errors.mjs +275 -12
- package/dist/ads-views.mjs +4 -4
- package/dist/analysis/design-usage.mjs +20 -4
- package/dist/analysis/mock-check.mjs +5 -4
- package/dist/analysis/owner-analysis-key.mjs +1 -1
- package/dist/analysis/owner-choices.mjs +172 -39
- package/dist/analysis/owner-composition.mjs +37 -13
- package/dist/analysis/owner-controls.mjs +27 -0
- package/dist/analysis/owner-source.mjs +67 -18
- package/dist/analysis/prose-owners.mjs +57 -0
- package/dist/analysis/styling-ownership.mjs +22 -0
- package/dist/check.mjs +7 -1
- package/dist/cli-arguments.mjs +2 -2
- package/dist/cli.mjs +3 -3
- package/dist/composed-contrast.mjs +28 -8
- package/dist/composed-keyline.mjs +107 -0
- package/dist/construction-output.mjs +146 -18
- package/dist/construction-spec.d.mts +212 -9
- package/dist/construction-spec.mjs +297 -56
- package/dist/corner-overpaint.mjs +53 -0
- package/dist/design-foundation.mjs +6 -1
- package/dist/design-usage.mjs +8 -2
- package/dist/emit/emission.mjs +11 -4
- package/dist/emit/font-emission.mjs +21 -1
- package/dist/emit/foundation-sheet.mjs +6 -5
- package/dist/emit/preview-tree.mjs +1 -1
- package/dist/finding-rules.mjs +7 -0
- package/dist/font-checks.mjs +42 -0
- package/dist/font-declaration.d.mts +10 -0
- package/dist/font-declaration.mjs +25 -3
- package/dist/font-fallback.d.mts +37 -0
- package/dist/font-fallback.mjs +25 -0
- package/dist/font-macro.d.mts +10 -0
- package/dist/font-metrics.d.mts +34 -0
- package/dist/font-metrics.mjs +314 -0
- package/dist/font-model.mjs +28 -2
- package/dist/foundation-macro.d.mts +1 -1
- package/dist/frame-regions.mjs +66 -3
- package/dist/grid-facts.mjs +72 -16
- package/dist/grid-lowering.mjs +11 -5
- package/dist/init.mjs +14 -23
- package/dist/lowering-enter.mjs +31 -0
- package/dist/lowering-properties.mjs +22 -1
- package/dist/lowering-region-layout.mjs +42 -8
- package/dist/lowering-sequence.mjs +89 -0
- package/dist/lowering-session.mjs +7 -0
- package/dist/lowering-transitions.mjs +22 -8
- package/dist/mcp/preview-http.bundle.js +2 -2
- package/dist/mcp/preview-widget.bundle.js +5 -5
- package/dist/motion-model.mjs +2 -0
- package/dist/owner-analysis-check.mjs +67 -7
- package/dist/owner-errors.mjs +16 -0
- package/dist/owner-lowering.mjs +36 -16
- package/dist/owner-scenarios.mjs +25 -3
- package/dist/ownership-model.mjs +23 -4
- package/dist/paint-contrast.mjs +5 -0
- package/dist/placeholder-contrast.mjs +1 -0
- package/dist/platform-features.mjs +26 -2
- package/dist/preview-bun.mjs +17 -16
- package/dist/preview-controls.mjs +35 -0
- package/dist/preview-incremental.mjs +1 -1
- package/dist/preview-source.mjs +2 -2
- package/dist/profile-macro.d.mts +15 -0
- package/dist/profile-model.mjs +3 -3
- package/dist/profile-view-facts.mjs +55 -4
- package/dist/prose-model.d.mts +81 -0
- package/dist/prose-model.mjs +101 -0
- package/dist/recipe-macro.d.mts +105 -3
- package/dist/recipe-model.mjs +31 -7
- package/dist/region-lowering.mjs +241 -41
- package/dist/render-audit/corner-overpaint.page.mjs +54 -0
- package/dist/render-audit/worker.mjs +6 -1
- package/dist/render-audit.mjs +25 -0
- package/dist/role-vocabulary.d.mts +38 -2
- package/dist/role-vocabulary.mjs +39 -4
- package/dist/scenario-kit.d.mts +6 -0
- package/dist/scenario-registry.mjs +1 -1
- package/dist/scheme-switch.d.mts +8 -0
- package/dist/scheme-switch.mjs +1 -0
- package/dist/showcase/ads-views.mjs +116 -53
- package/dist/showcase/assets-view.mjs +117 -86
- package/dist/showcase/client.bundle.js +65 -65
- package/dist/showcase/http-client.bundle.js +17 -17
- package/dist/showcase/preview-frame.css +2 -0
- package/dist/showcase/profiles-view.mjs +163 -122
- package/dist/showcase/scenario-page.d.mts +11 -1
- package/dist/showcase/scenario-page.mjs +18 -3
- package/dist/showcase/token-sample.mjs +47 -4
- package/dist/showcase/tokens-view.mjs +82 -34
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +5 -5
- package/dist/skills/README.md +5 -5
- package/dist/skills/ads-designer/README.md +1 -1
- package/dist/skills/ads-designer/SKILL.md +13 -12
- package/dist/skills/ads-designer/references/accessibility.md +2 -2
- package/dist/skills/ads-designer/references/atomic-styles.md +8 -1
- package/dist/skills/ads-designer/references/branding.md +7 -2
- package/dist/skills/ads-designer/references/cli.md +4 -4
- package/dist/skills/ads-designer/references/contracts.md +9 -2
- package/dist/skills/ads-designer/references/design-craft.md +1 -1
- package/dist/skills/ads-designer/references/design-data.md +3 -3
- package/dist/skills/ads-designer/references/forms.md +6 -6
- package/dist/skills/ads-designer/references/layout.md +42 -3
- package/dist/skills/ads-designer/references/motion.md +37 -1
- package/dist/skills/ads-designer/references/performance.md +7 -1
- package/dist/skills/ads-designer/references/recipes.md +67 -6
- package/dist/skills/ads-designer/references/runtimes.md +1 -1
- package/dist/skills/ads-designer/references/scenarios.md +1 -0
- package/dist/skills/ads-import/references/atomic-styles.md +8 -1
- package/dist/skills/ads-import/references/cli.md +4 -4
- package/dist/skills/ads-import/references/contracts.md +9 -2
- package/dist/skills/ads-import/references/design-data.md +3 -3
- package/dist/skills/ads-import/references/forms.md +6 -6
- package/dist/skills/ads-import/references/layout.md +42 -3
- package/dist/skills/ads-import/references/recipes.md +67 -6
- package/dist/skills/ads-import/references/runtimes.md +1 -1
- package/dist/skills/ads-import/references/scenarios.md +1 -0
- package/dist/skills/ads-migrate/SKILL.md +2 -1
- package/dist/skills/ads-migrate/references/0.5.0-to-0.5.1.md +239 -0
- package/dist/skills/ads-port/references/atomic-styles.md +8 -1
- package/dist/skills/ads-port/references/cli.md +4 -4
- package/dist/skills/ads-port/references/contracts.md +9 -2
- package/dist/skills/ads-port/references/design-data.md +3 -3
- package/dist/skills/ads-port/references/forms.md +6 -6
- package/dist/skills/ads-port/references/layout.md +42 -3
- package/dist/skills/ads-port/references/recipes.md +67 -6
- package/dist/skills/ads-port/references/runtimes.md +1 -1
- package/dist/skills/ads-port/references/scenarios.md +1 -0
- package/dist/spatial-model.mjs +20 -4
- package/dist/state-conditions.d.mts +29 -0
- package/dist/state-conditions.mjs +42 -2
- package/dist/surface-contrast.mjs +68 -10
- package/dist/surface-effects.mjs +98 -0
- package/dist/target-size.mjs +1 -1
- package/dist/task-cache.mjs +1 -1
- package/dist/token-dtcg.mjs +1 -0
- package/dist/token-view-facts.mjs +54 -5
- package/dist/unreached-sources.mjs +5 -0
- package/dist/validation.mjs +1 -1
- package/docs/ADS.md +36 -13
- package/docs/ARCHITECTURE.md +160 -16
- package/docs/ASSETS.md +81 -10
- package/docs/CACHING.md +1 -1
- package/docs/CHANGELOG.md +346 -21
- package/docs/DESIGN-REFERENCES.md +5 -5
- package/docs/GUIDE.md +241 -72
- package/docs/LANGUAGE.md +287 -21
- package/docs/LOWERING.md +13 -1
- package/docs/MOTION.md +233 -7
- package/docs/PROFILE-KINDS.md +167 -13
- package/docs/PROFILES.md +2 -2
- package/docs/RULES.md +49 -18
- package/docs/TOKEN-ROLES.md +9 -7
- package/package.json +1 -1
- package/dist/starter-files.mjs +0 -155
- package/dist/starter-overlay.mjs +0 -189
- package/dist/starters/preact/design-system/assets/avatars/avatar.ads.ts +0 -10
- package/dist/starters/preact/design-system/assets/avatars/member.svg +0 -1
- package/dist/starters/preact/design-system/assets/brand/emblem.ads.ts +0 -18
- package/dist/starters/preact/design-system/assets/brand/emblem.svg +0 -4
- package/dist/starters/preact/design-system/assets/brand/iris-emblem.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/brand/iris-emblem.svg +0 -4
- package/dist/starters/preact/design-system/assets/brand/mark.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/brand/mark.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/arrow.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/glyphs/arrow.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/chevron-20.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/chevron-24.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/chevron.ads.ts +0 -20
- package/dist/starters/preact/design-system/assets/glyphs/close.ads.ts +0 -13
- package/dist/starters/preact/design-system/assets/glyphs/close.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/favorite.ads.ts +0 -23
- package/dist/starters/preact/design-system/assets/glyphs/favorite.normal.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/favorite.selected.svg +0 -1
- package/dist/starters/preact/design-system/assets/glyphs/search.ads.ts +0 -10
- package/dist/starters/preact/design-system/assets/glyphs/search.svg +0 -1
- package/dist/starters/preact/design-system/assets/illustrations/journey.ads.ts +0 -32
- package/dist/starters/preact/design-system/assets/illustrations/journey.contrast.svg +0 -6
- package/dist/starters/preact/design-system/assets/illustrations/journey.dark.svg +0 -13
- package/dist/starters/preact/design-system/assets/illustrations/journey.light.svg +0 -13
- package/dist/starters/preact/design-system/assets/logos/harbor-pay.ads.ts +0 -17
- package/dist/starters/preact/design-system/assets/logos/harbor-pay.dark.svg +0 -10
- package/dist/starters/preact/design-system/assets/logos/harbor-pay.light.svg +0 -10
- package/dist/starters/preact/design-system/assets/logos/lumen-cloud.ads.ts +0 -15
- package/dist/starters/preact/design-system/assets/logos/lumen-cloud.dark.svg +0 -9
- package/dist/starters/preact/design-system/assets/logos/lumen-cloud.light.svg +0 -9
- package/dist/starters/preact/design-system/assets/status/error.svg +0 -1
- package/dist/starters/preact/design-system/assets/status/outcomes.ads.ts +0 -31
- package/dist/starters/preact/design-system/assets/status/status.ads.ts +0 -16
- package/dist/starters/preact/design-system/assets/status/success.svg +0 -1
- package/dist/starters/preact/design-system/assets/status/sync-status.ads.ts +0 -14
- package/dist/starters/preact/design-system/assets/status/sync-status.svg +0 -7
- package/dist/starters/preact/design-system/assets/status/warning.svg +0 -1
- package/dist/starters/preact/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -12
- package/dist/starters/preact/design-system/components/Actions/Button/Button.tsx +0 -198
- package/dist/starters/preact/design-system/components/Actions/IconButton/IconButton.tsx +0 -95
- package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +0 -22
- package/dist/starters/preact/design-system/components/Actions/ToggleTile/ToggleTile.tsx +0 -60
- package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/components/Containers/Disclosure/Disclosure.tsx +0 -50
- package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +0 -8
- package/dist/starters/preact/design-system/components/Content/Artwork/Artwork.tsx +0 -110
- package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +0 -25
- package/dist/starters/preact/design-system/components/Content/BarChart/BarChart.tsx +0 -72
- package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +0 -8
- package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.tsx +0 -43
- package/dist/starters/preact/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -21
- package/dist/starters/preact/design-system/components/Content/Icon/Icon.tsx +0 -41
- package/dist/starters/preact/design-system/components/Content/Icon/glyphs/arrow.tsx +0 -10
- package/dist/starters/preact/design-system/components/Content/Icon/glyphs/close.tsx +0 -10
- package/dist/starters/preact/design-system/components/Content/Icon/glyphs/search.tsx +0 -10
- package/dist/starters/preact/design-system/components/Content/Image/Image.ads.fixture.ts +0 -9
- package/dist/starters/preact/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -12
- package/dist/starters/preact/design-system/components/Content/Image/Image.tsx +0 -83
- package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +0 -27
- package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +0 -46
- package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +0 -17
- package/dist/starters/preact/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +0 -41
- package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +0 -20
- package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.tsx +0 -37
- package/dist/starters/preact/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/components/Forms/TextField/TextField.tsx +0 -173
- package/dist/starters/preact/design-system/components/Identity/Identity.ads.scenario.tsx +0 -13
- package/dist/starters/preact/design-system/components/Identity/Identity.tsx +0 -146
- package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +0 -27
- package/dist/starters/preact/design-system/components/Overlays/Menu/Menu.tsx +0 -194
- package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +0 -19
- package/dist/starters/preact/design-system/components/Overlays/Popover/Popover.tsx +0 -37
- package/dist/starters/preact/design-system/controllers/FormField/FormField.ads.behavior.ts +0 -70
- package/dist/starters/preact/design-system/controllers/FormField/FormField.behavior.spec.ts +0 -237
- package/dist/starters/preact/design-system/controllers/FormField/FormField.ts +0 -343
- package/dist/starters/preact/design-system/controllers/FormField/useFormField.ts +0 -70
- package/dist/starters/preact/design-system/controllers/Palette/Palette.ts +0 -165
- package/dist/starters/preact/design-system/foundation.ads.ts +0 -22
- package/dist/starters/preact/design-system/index.ts +0 -51
- package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +0 -5
- package/dist/starters/preact/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +0 -22
- package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.fixture.ts +0 -12
- package/dist/starters/preact/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +0 -21
- package/dist/starters/preact/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/mocks/Workspace/Media.ads.scenario.tsx +0 -24
- package/dist/starters/preact/design-system/mocks/Workspace/Stress.ads.scenario.tsx +0 -36
- package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.fixture.ts +0 -13
- package/dist/starters/preact/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +0 -27
- package/dist/starters/preact/design-system/mocks/Workspace/media/ads.svg +0 -1
- package/dist/starters/preact/design-system/palette.generated.ts +0 -188
- package/dist/starters/preact/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +0 -73
- package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +0 -23
- package/dist/starters/preact/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +0 -94
- package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +0 -21
- package/dist/starters/preact/design-system/patterns/Forms/InviteMember/InviteMember.tsx +0 -137
- package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +0 -22
- package/dist/starters/preact/design-system/patterns/Inspector/Inspector/Inspector.tsx +0 -248
- package/dist/starters/preact/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -26
- package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +0 -268
- package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +0 -28
- package/dist/starters/preact/design-system/patterns/Workspace/Workspace/Workspace.tsx +0 -105
- package/dist/starters/preact/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +0 -179
- package/dist/starters/preact/design-system/profiles/Containers/containers.ads.ts +0 -67
- package/dist/starters/preact/design-system/profiles/Containers/frames.ads.ts +0 -32
- package/dist/starters/preact/design-system/profiles/Containers/geometry.ads.ts +0 -30
- package/dist/starters/preact/design-system/profiles/Containers/spacing.ads.ts +0 -26
- package/dist/starters/preact/design-system/profiles/Controls/controls.ads.ts +0 -157
- package/dist/starters/preact/design-system/profiles/Controls/frames.ads.ts +0 -50
- package/dist/starters/preact/design-system/profiles/Controls/spacing.ads.ts +0 -29
- package/dist/starters/preact/design-system/profiles/Focus/keyboard.ads.ts +0 -13
- package/dist/starters/preact/design-system/profiles/Identity/identity.ads.ts +0 -25
- package/dist/starters/preact/design-system/profiles/Identity/spacing.ads.ts +0 -22
- package/dist/starters/preact/design-system/profiles/Layout/grid.ads.ts +0 -69
- package/dist/starters/preact/design-system/profiles/Layout/inspector.ads.ts +0 -146
- package/dist/starters/preact/design-system/profiles/Layout/overlays.ads.ts +0 -94
- package/dist/starters/preact/design-system/profiles/Layout/regions.ads.ts +0 -296
- package/dist/starters/preact/design-system/profiles/Motion/feedback.ads.ts +0 -92
- package/dist/starters/preact/design-system/profiles/Surfaces/controls.ads.ts +0 -142
- package/dist/starters/preact/design-system/profiles/Surfaces/document.ads.ts +0 -2
- package/dist/starters/preact/design-system/profiles/Surfaces/materials.ads.ts +0 -18
- package/dist/starters/preact/design-system/profiles/Surfaces/surfaces.ads.ts +0 -48
- package/dist/starters/preact/design-system/profiles/Typography/details.ads.ts +0 -19
- package/dist/starters/preact/design-system/profiles/Typography/document.ads.ts +0 -2
- package/dist/starters/preact/design-system/profiles/Typography/headings.ads.ts +0 -15
- package/dist/starters/preact/design-system/profiles/Typography/text.ads.ts +0 -73
- package/dist/starters/preact/design-system/profiles/Visuals/artwork.ads.ts +0 -46
- package/dist/starters/preact/design-system/profiles/Visuals/charts.ads.ts +0 -31
- package/dist/starters/preact/design-system/profiles/Visuals/content.ads.ts +0 -52
- package/dist/starters/preact/design-system/profiles/Visuals/glyphs.ads.ts +0 -35
- package/dist/starters/preact/design-system/profiles/Visuals/identity.ads.ts +0 -24
- package/dist/starters/preact/design-system/tokens/Artwork/paint.ads.css +0 -7
- package/dist/starters/preact/design-system/tokens/Artwork/visual-size.ads.css +0 -12
- package/dist/starters/preact/design-system/tokens/Brand/paint.ads.css +0 -7
- package/dist/starters/preact/design-system/tokens/Charts/paint.ads.css +0 -19
- package/dist/starters/preact/design-system/tokens/Containers/border-width.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Containers/content-gap.ads.css +0 -5
- package/dist/starters/preact/design-system/tokens/Containers/frame-inset.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Containers/frame-size.ads.css +0 -11
- package/dist/starters/preact/design-system/tokens/Containers/radius.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Controls/border-width.ads.css +0 -4
- package/dist/starters/preact/design-system/tokens/Controls/content-gap.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Controls/control-min-size.ads.css +0 -17
- package/dist/starters/preact/design-system/tokens/Controls/frame-inset.ads.css +0 -21
- package/dist/starters/preact/design-system/tokens/Controls/radius.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Controls/target-min-size.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Controls/visual-size.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Focus/border-width.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Focus/focus-offset.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Foundation/spacing.ads.css +0 -20
- package/dist/starters/preact/design-system/tokens/Grid/grid-gutter.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Grid/layer.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Grid/layout-size.ads.css +0 -15
- package/dist/starters/preact/design-system/tokens/Grid/spacing.ads.css +0 -12
- package/dist/starters/preact/design-system/tokens/Grid/track-count.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Identity/content-gap.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Identity/visual-size.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Motion/duration.ads.css +0 -6
- package/dist/starters/preact/design-system/tokens/Motion/easing.ads.css +0 -5
- package/dist/starters/preact/design-system/tokens/Motion/motion-angle.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Motion/motion-distance.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Motion/motion-scale.ads.css +0 -9
- package/dist/starters/preact/design-system/tokens/Surfaces/blur.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Surfaces/gradient.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Surfaces/opacity.ads.css +0 -2
- package/dist/starters/preact/design-system/tokens/Surfaces/paint.ads.css +0 -58
- package/dist/starters/preact/design-system/tokens/Surfaces/shadow.ads.css +0 -20
- package/dist/starters/preact/design-system/tokens/Typography/font-family.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-features.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-size.ads.css +0 -9
- package/dist/starters/preact/design-system/tokens/Typography/font-stretch.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-variations.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/font-weight.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/letter-spacing.ads.css +0 -1
- package/dist/starters/preact/design-system/tokens/Typography/line-height.ads.css +0 -11
- package/dist/starters/preact/design-system/tokens/Typography/word-spacing.ads.css +0 -1
- package/dist/starters/preact/starter.json +0 -11
- package/dist/starters/react/design-system/assets/avatars/avatar.ads.ts +0 -10
- package/dist/starters/react/design-system/assets/avatars/member.svg +0 -1
- package/dist/starters/react/design-system/assets/brand/emblem.ads.ts +0 -18
- package/dist/starters/react/design-system/assets/brand/emblem.svg +0 -4
- package/dist/starters/react/design-system/assets/brand/iris-emblem.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/brand/iris-emblem.svg +0 -4
- package/dist/starters/react/design-system/assets/brand/mark.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/brand/mark.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/arrow.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/glyphs/arrow.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-20.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-24.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron.ads.ts +0 -20
- package/dist/starters/react/design-system/assets/glyphs/close.ads.ts +0 -13
- package/dist/starters/react/design-system/assets/glyphs/close.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/favorite.ads.ts +0 -23
- package/dist/starters/react/design-system/assets/glyphs/favorite.normal.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/favorite.selected.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/search.ads.ts +0 -10
- package/dist/starters/react/design-system/assets/glyphs/search.svg +0 -1
- package/dist/starters/react/design-system/assets/illustrations/journey.ads.ts +0 -32
- package/dist/starters/react/design-system/assets/illustrations/journey.contrast.svg +0 -6
- package/dist/starters/react/design-system/assets/illustrations/journey.dark.svg +0 -13
- package/dist/starters/react/design-system/assets/illustrations/journey.light.svg +0 -13
- package/dist/starters/react/design-system/assets/logos/harbor-pay.ads.ts +0 -17
- package/dist/starters/react/design-system/assets/logos/harbor-pay.dark.svg +0 -10
- package/dist/starters/react/design-system/assets/logos/harbor-pay.light.svg +0 -10
- package/dist/starters/react/design-system/assets/logos/lumen-cloud.ads.ts +0 -15
- package/dist/starters/react/design-system/assets/logos/lumen-cloud.dark.svg +0 -9
- package/dist/starters/react/design-system/assets/logos/lumen-cloud.light.svg +0 -9
- package/dist/starters/react/design-system/assets/status/error.svg +0 -1
- package/dist/starters/react/design-system/assets/status/outcomes.ads.ts +0 -31
- package/dist/starters/react/design-system/assets/status/status.ads.ts +0 -16
- package/dist/starters/react/design-system/assets/status/success.svg +0 -1
- package/dist/starters/react/design-system/assets/status/sync-status.ads.ts +0 -14
- package/dist/starters/react/design-system/assets/status/sync-status.svg +0 -7
- package/dist/starters/react/design-system/assets/status/warning.svg +0 -1
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -12
- package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +0 -198
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +0 -95
- package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/components/Actions/ToggleTile/ToggleTile.tsx +0 -60
- package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/components/Containers/Disclosure/Disclosure.tsx +0 -50
- package/dist/starters/react/design-system/components/Content/Artwork/Artwork.ads.scenario.tsx +0 -8
- package/dist/starters/react/design-system/components/Content/Artwork/Artwork.tsx +0 -110
- package/dist/starters/react/design-system/components/Content/BarChart/BarChart.ads.scenario.tsx +0 -25
- package/dist/starters/react/design-system/components/Content/BarChart/BarChart.tsx +0 -72
- package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx +0 -8
- package/dist/starters/react/design-system/components/Content/GuideGrid/GuideGrid.tsx +0 -43
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +0 -41
- package/dist/starters/react/design-system/components/Content/Icon/glyphs/arrow.tsx +0 -10
- package/dist/starters/react/design-system/components/Content/Icon/glyphs/close.tsx +0 -10
- package/dist/starters/react/design-system/components/Content/Icon/glyphs/search.tsx +0 -10
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +0 -9
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -12
- package/dist/starters/react/design-system/components/Content/Image/Image.tsx +0 -83
- package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.ads.scenario.tsx +0 -27
- package/dist/starters/react/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx +0 -46
- package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.ads.scenario.tsx +0 -17
- package/dist/starters/react/design-system/components/Content/PartnerLogo/PartnerLogo.tsx +0 -41
- package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx +0 -20
- package/dist/starters/react/design-system/components/Content/StatusIcon/StatusIcon.tsx +0 -37
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +0 -173
- package/dist/starters/react/design-system/components/Identity/Identity.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Identity/Identity.tsx +0 -146
- package/dist/starters/react/design-system/components/Overlays/Menu/Menu.ads.scenario.tsx +0 -27
- package/dist/starters/react/design-system/components/Overlays/Menu/Menu.tsx +0 -194
- package/dist/starters/react/design-system/components/Overlays/Popover/Popover.ads.scenario.tsx +0 -19
- package/dist/starters/react/design-system/components/Overlays/Popover/Popover.tsx +0 -37
- package/dist/starters/react/design-system/controllers/FormField/FormField.ads.behavior.ts +0 -70
- package/dist/starters/react/design-system/controllers/FormField/FormField.behavior.spec.ts +0 -237
- package/dist/starters/react/design-system/controllers/FormField/FormField.ts +0 -343
- package/dist/starters/react/design-system/controllers/FormField/useFormField.ts +0 -70
- package/dist/starters/react/design-system/controllers/Palette/Palette.ts +0 -165
- package/dist/starters/react/design-system/foundation.ads.ts +0 -22
- package/dist/starters/react/design-system/index.ts +0 -51
- package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.fixture.ts +0 -5
- package/dist/starters/react/design-system/mocks/ConstructionProofs/ConstructionProofs.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.fixture.ts +0 -12
- package/dist/starters/react/design-system/mocks/Inspector/Inspector.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/mocks/Workspace/Layouts.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/mocks/Workspace/Media.ads.scenario.tsx +0 -24
- package/dist/starters/react/design-system/mocks/Workspace/Stress.ads.scenario.tsx +0 -36
- package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.fixture.ts +0 -13
- package/dist/starters/react/design-system/mocks/Workspace/Workspace.ads.scenario.tsx +0 -27
- package/dist/starters/react/design-system/mocks/Workspace/media/ads.svg +0 -1
- package/dist/starters/react/design-system/palette.generated.ts +0 -188
- package/dist/starters/react/design-system/patterns/ArtworkCatalogue/ArtworkCatalogue/ArtworkCatalogue.tsx +0 -73
- package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.ads.scenario.tsx +0 -23
- package/dist/starters/react/design-system/patterns/ConstructionWorkbench/ConstructionWorkbench/ConstructionWorkbench.tsx +0 -94
- package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/patterns/Forms/InviteMember/InviteMember.tsx +0 -137
- package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/patterns/Inspector/Inspector/Inspector.tsx +0 -248
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -26
- package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +0 -268
- package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.ads.scenario.tsx +0 -28
- package/dist/starters/react/design-system/patterns/Workspace/Workspace/Workspace.tsx +0 -105
- package/dist/starters/react/design-system/patterns/Workspace/Workspace/WorkspacePanels.tsx +0 -179
- package/dist/starters/react/design-system/profiles/Containers/containers.ads.ts +0 -67
- package/dist/starters/react/design-system/profiles/Containers/frames.ads.ts +0 -32
- package/dist/starters/react/design-system/profiles/Containers/geometry.ads.ts +0 -30
- package/dist/starters/react/design-system/profiles/Containers/spacing.ads.ts +0 -26
- package/dist/starters/react/design-system/profiles/Controls/controls.ads.ts +0 -157
- package/dist/starters/react/design-system/profiles/Controls/frames.ads.ts +0 -50
- package/dist/starters/react/design-system/profiles/Controls/spacing.ads.ts +0 -29
- package/dist/starters/react/design-system/profiles/Focus/keyboard.ads.ts +0 -13
- package/dist/starters/react/design-system/profiles/Identity/identity.ads.ts +0 -25
- package/dist/starters/react/design-system/profiles/Identity/spacing.ads.ts +0 -22
- package/dist/starters/react/design-system/profiles/Layout/grid.ads.ts +0 -69
- package/dist/starters/react/design-system/profiles/Layout/inspector.ads.ts +0 -146
- package/dist/starters/react/design-system/profiles/Layout/overlays.ads.ts +0 -94
- package/dist/starters/react/design-system/profiles/Layout/regions.ads.ts +0 -296
- package/dist/starters/react/design-system/profiles/Motion/feedback.ads.ts +0 -92
- package/dist/starters/react/design-system/profiles/Surfaces/controls.ads.ts +0 -142
- package/dist/starters/react/design-system/profiles/Surfaces/document.ads.ts +0 -2
- package/dist/starters/react/design-system/profiles/Surfaces/materials.ads.ts +0 -18
- package/dist/starters/react/design-system/profiles/Surfaces/surfaces.ads.ts +0 -48
- package/dist/starters/react/design-system/profiles/Typography/details.ads.ts +0 -19
- package/dist/starters/react/design-system/profiles/Typography/document.ads.ts +0 -2
- package/dist/starters/react/design-system/profiles/Typography/headings.ads.ts +0 -15
- package/dist/starters/react/design-system/profiles/Typography/text.ads.ts +0 -73
- package/dist/starters/react/design-system/profiles/Visuals/artwork.ads.ts +0 -46
- package/dist/starters/react/design-system/profiles/Visuals/charts.ads.ts +0 -31
- package/dist/starters/react/design-system/profiles/Visuals/content.ads.ts +0 -52
- package/dist/starters/react/design-system/profiles/Visuals/glyphs.ads.ts +0 -35
- package/dist/starters/react/design-system/profiles/Visuals/identity.ads.ts +0 -24
- package/dist/starters/react/design-system/tokens/Artwork/paint.ads.css +0 -7
- package/dist/starters/react/design-system/tokens/Artwork/visual-size.ads.css +0 -12
- package/dist/starters/react/design-system/tokens/Brand/paint.ads.css +0 -7
- package/dist/starters/react/design-system/tokens/Charts/paint.ads.css +0 -19
- package/dist/starters/react/design-system/tokens/Containers/border-width.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Containers/content-gap.ads.css +0 -5
- package/dist/starters/react/design-system/tokens/Containers/frame-inset.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Containers/frame-size.ads.css +0 -11
- package/dist/starters/react/design-system/tokens/Containers/radius.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Controls/border-width.ads.css +0 -4
- package/dist/starters/react/design-system/tokens/Controls/content-gap.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Controls/control-min-size.ads.css +0 -17
- package/dist/starters/react/design-system/tokens/Controls/frame-inset.ads.css +0 -21
- package/dist/starters/react/design-system/tokens/Controls/radius.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Controls/target-min-size.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Controls/visual-size.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Focus/border-width.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Focus/focus-offset.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Foundation/spacing.ads.css +0 -20
- package/dist/starters/react/design-system/tokens/Grid/grid-gutter.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Grid/layer.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Grid/layout-size.ads.css +0 -15
- package/dist/starters/react/design-system/tokens/Grid/spacing.ads.css +0 -12
- package/dist/starters/react/design-system/tokens/Grid/track-count.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Identity/content-gap.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Identity/visual-size.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Motion/duration.ads.css +0 -6
- package/dist/starters/react/design-system/tokens/Motion/easing.ads.css +0 -5
- package/dist/starters/react/design-system/tokens/Motion/motion-angle.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Motion/motion-distance.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Motion/motion-scale.ads.css +0 -9
- package/dist/starters/react/design-system/tokens/Surfaces/blur.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Surfaces/gradient.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Surfaces/opacity.ads.css +0 -2
- package/dist/starters/react/design-system/tokens/Surfaces/paint.ads.css +0 -58
- package/dist/starters/react/design-system/tokens/Surfaces/shadow.ads.css +0 -20
- package/dist/starters/react/design-system/tokens/Typography/font-family.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-features.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-size.ads.css +0 -9
- package/dist/starters/react/design-system/tokens/Typography/font-stretch.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-variations.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/font-weight.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/letter-spacing.ads.css +0 -1
- package/dist/starters/react/design-system/tokens/Typography/line-height.ads.css +0 -11
- package/dist/starters/react/design-system/tokens/Typography/word-spacing.ads.css +0 -1
- package/dist/starters/react/starter.json +0 -11
- package/docs/STARTER.md +0 -167
package/dist/starters/preact/design-system/components/Content/GuideGrid/GuideGrid.ads.scenario.tsx
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GuideGrid } from "@ds";
|
|
2
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
3
|
-
|
|
4
|
-
export const scenario = {
|
|
5
|
-
title: "Guide grid",
|
|
6
|
-
covers: ["GuideGrid"],
|
|
7
|
-
specimens: [{ title: "Two, four and eight divisions", arrangement: "row", render: () => <>{[2, 4, 8].map(divisions => <GuideGrid key={divisions} divisions={divisions} />)}</> }],
|
|
8
|
-
} satisfies Scenario;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
|
|
3
|
-
export interface GuideGridProps {
|
|
4
|
-
/** Equal divisions per axis; the lines between them are computed, so they are owned geometry, not an asset. */
|
|
5
|
-
divisions: number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/* Owned SVG geometry: minor lines and the two centre axes, stroked from
|
|
9
|
-
colour-only surfaces and the visual profile's hairline width. A decorative
|
|
10
|
-
overlay: hidden from assistive technology and transparent to the pointer. */
|
|
11
|
-
const grid = recipe({
|
|
12
|
-
profile: "guide-grid",
|
|
13
|
-
frame: {},
|
|
14
|
-
parts: {
|
|
15
|
-
minor: {
|
|
16
|
-
selector: ".ds-guide-minor",
|
|
17
|
-
kind: "vector",
|
|
18
|
-
required: false,
|
|
19
|
-
surface: "secondary-foreground",
|
|
20
|
-
stroke: { slot: "visual", field: "strokeWidth" }
|
|
21
|
-
},
|
|
22
|
-
axis: {
|
|
23
|
-
selector: ".ds-guide-axis",
|
|
24
|
-
kind: "vector",
|
|
25
|
-
required: true,
|
|
26
|
-
surface: "primary-foreground",
|
|
27
|
-
stroke: { slot: "visual", field: "strokeWidth" }
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
normalize: {
|
|
31
|
-
pointerEvents: "none"
|
|
32
|
-
}
|
|
33
|
-
}).root;
|
|
34
|
-
|
|
35
|
-
export function GuideGrid({ divisions }: GuideGridProps) {
|
|
36
|
-
const steps = Array.from({ length: Math.max(0, divisions - 1) }, (_, index) => ((index + 1) * 100) / divisions).filter((at) => at !== 50);
|
|
37
|
-
return <svg className={`ds-artwork-grid ${grid}`} viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
|
38
|
-
{steps.map((at) => <line key={`column-${at}`} className="ds-guide-minor" x1={at} y1={0} x2={at} y2={100} />)}
|
|
39
|
-
{steps.map((at) => <line key={`row-${at}`} className="ds-guide-minor" x1={0} y1={at} x2={100} y2={at} />)}
|
|
40
|
-
<line className="ds-guide-axis" x1={50} y1={0} x2={50} y2={100} />
|
|
41
|
-
<line className="ds-guide-axis" x1={0} y1={50} x2={100} y2={50} />
|
|
42
|
-
</svg>;
|
|
43
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ArrowIcon, CloseIcon, Icon, IconButton, SearchIcon, closeGlyph, searchGlyph } from "@ds";
|
|
2
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
3
|
-
|
|
4
|
-
export const scenario = {
|
|
5
|
-
title: "Icon",
|
|
6
|
-
description: "Glyph references: ready icons, sizes and icon-only controls.",
|
|
7
|
-
covers: ["Icon", "IconButton"],
|
|
8
|
-
specimens: [
|
|
9
|
-
{ title: "Ready icons", note: "Beside text an icon is decorative; alone it carries a label.", arrangement: "row", render: () => <><SearchIcon />Search<ArrowIcon size="sm" />Next<CloseIcon size="lg" label="Close" /></> },
|
|
10
|
-
{ title: "Sizes", arrangement: "row", render: () => <>{(["sm", "md", "lg"] as const).map((size) => <Icon key={size} glyph={searchGlyph} size={size} />)}</> },
|
|
11
|
-
{
|
|
12
|
-
title: "Icon-only controls",
|
|
13
|
-
arrangement: "row",
|
|
14
|
-
render: () => <>
|
|
15
|
-
<IconButton icon={closeGlyph} label="Close" />
|
|
16
|
-
<IconButton icon={searchGlyph} label="Search" size="lg" />
|
|
17
|
-
<IconButton icon={closeGlyph} label="Close (unavailable)" disabled />
|
|
18
|
-
</>,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
} satisfies Scenario;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
import type { Glyph } from "@reqvire-org/ads/asset";
|
|
3
|
-
|
|
4
|
-
/** The glyphs an Icon (and IconButton) can draw: the references the design system exports, on one 20 × 20 grid. */
|
|
5
|
-
export type IconGlyph = "arrow" | "close" | "search";
|
|
6
|
-
export type IconSize = "sm" | "md" | "lg";
|
|
7
|
-
export interface IconProps {
|
|
8
|
-
/** A glyph reference from the public barrel (`closeGlyph`); never a name string. */
|
|
9
|
-
glyph: Glyph<IconGlyph>;
|
|
10
|
-
size?: IconSize;
|
|
11
|
-
/** Omit when surrounding text supplies the meaning. */
|
|
12
|
-
label?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const anatomy = recipe({
|
|
16
|
-
layout: "inline",
|
|
17
|
-
align: "center",
|
|
18
|
-
parts: {
|
|
19
|
-
visual: {
|
|
20
|
-
selector: ".ds-icon-visual",
|
|
21
|
-
required: true,
|
|
22
|
-
kind: "visual"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}).root;
|
|
26
|
-
// One construction per size, whichever glyph is drawn: the reference carries
|
|
27
|
-
// the drawing; the size chooses the visual profile.
|
|
28
|
-
const sizes = {
|
|
29
|
-
sm: recipe({ parts: { visual: { kind: "visual", glyph: "reference", visual: "glyph-sm" } } }),
|
|
30
|
-
md: recipe({ parts: { visual: { kind: "visual", glyph: "reference", visual: "glyph-md" } } }),
|
|
31
|
-
lg: recipe({ parts: { visual: { kind: "visual", glyph: "reference", visual: "glyph-lg" } } }),
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/** A standalone glyph: decorative beside text, or an image with its label. */
|
|
35
|
-
export function Icon({ glyph, size = "md", label }: IconProps) {
|
|
36
|
-
const drawn = sizes[size];
|
|
37
|
-
return <span className={anatomy} role={label ? "img" : undefined} aria-label={label} aria-hidden={label ? undefined : true}>
|
|
38
|
-
{/* The reference's drawing is trusted, compiled design-system artwork. */}
|
|
39
|
-
<span className={`ds-icon-visual ${drawn.parts.visual}`} dangerouslySetInnerHTML={{ __html: glyph.source }} />
|
|
40
|
-
</span>;
|
|
41
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { glyph } from "@reqvire-org/ads/asset" with { type: "macro" };
|
|
2
|
-
import { Icon, type IconProps } from "../Icon";
|
|
3
|
-
|
|
4
|
-
/** The arrow glyph as a reference, for owners that take an icon. */
|
|
5
|
-
export const arrowGlyph = glyph("arrow");
|
|
6
|
-
|
|
7
|
-
/** The arrow glyph, ready to render. */
|
|
8
|
-
export function ArrowIcon(props: Omit<IconProps, "glyph">) {
|
|
9
|
-
return <Icon glyph={arrowGlyph} {...props} />;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { glyph } from "@reqvire-org/ads/asset" with { type: "macro" };
|
|
2
|
-
import { Icon, type IconProps } from "../Icon";
|
|
3
|
-
|
|
4
|
-
/** The close glyph as a reference, for owners that take an icon (`<IconButton icon={closeGlyph} … />`). */
|
|
5
|
-
export const closeGlyph = glyph("close");
|
|
6
|
-
|
|
7
|
-
/** The close glyph, ready to render. */
|
|
8
|
-
export function CloseIcon(props: Omit<IconProps, "glyph">) {
|
|
9
|
-
return <Icon glyph={closeGlyph} {...props} />;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { glyph } from "@reqvire-org/ads/asset" with { type: "macro" };
|
|
2
|
-
import { Icon, type IconProps } from "../Icon";
|
|
3
|
-
|
|
4
|
-
/** The search glyph as a reference, for owners that take an icon. */
|
|
5
|
-
export const searchGlyph = glyph("search");
|
|
6
|
-
|
|
7
|
-
/** The search glyph, ready to render. */
|
|
8
|
-
export function SearchIcon(props: Omit<IconProps, "glyph">) {
|
|
9
|
-
return <Icon glyph={searchGlyph} {...props} />;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// A 100 × 200 portrait drawn as data: a dark band across its top quarter, so a crop's focal point is visible.
|
|
2
|
-
const portrait = "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='200' viewBox='0 0 100 200'%3E%3Crect width='100' height='200' fill='%23c8d0cd'/%3E%3Crect width='100' height='50' fill='%23183c35'/%3E%3C/svg%3E";
|
|
3
|
-
export const fixture = {
|
|
4
|
-
title: "Image: contained, and cropped to a ratio around its focal point",
|
|
5
|
-
alt: "A portrait placeholder with a dark band across its top",
|
|
6
|
-
source: { src: portrait, width: 100, height: 200 },
|
|
7
|
-
// The top of the image: half its height above the centre.
|
|
8
|
-
top: [0, -0.5],
|
|
9
|
-
} as const;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Image } from "@ds";
|
|
2
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
3
|
-
import { fixture } from "./Image.ads.fixture";
|
|
4
|
-
export const scenario = {
|
|
5
|
-
title: fixture.title,
|
|
6
|
-
covers: ["Image"],
|
|
7
|
-
specimens: [
|
|
8
|
-
{ title: "The file's own ratio", width: "medium", render: () => <Image source={fixture.source} alt={fixture.alt} /> },
|
|
9
|
-
{ title: "Cropped to 16 by 9", note: "The crop keeps the image's centre.", width: "medium", render: () => <Image source={fixture.source} alt={fixture.alt} aspectRatio="16 / 9" /> },
|
|
10
|
-
{ title: "Cropped around a focal point", note: "The source names the point the crop keeps.", width: "medium", render: () => <Image source={{ ...fixture.source, focus: fixture.top }} alt={fixture.alt} aspectRatio="16 / 9" /> },
|
|
11
|
-
],
|
|
12
|
-
} satisfies Scenario;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
|
|
3
|
-
/** File metadata, not authored display dimensions. CMS/user content can change
|
|
4
|
-
* the source and intrinsic ratio; profiles still own its displayed extent. */
|
|
5
|
-
export interface ContentImage {
|
|
6
|
-
src: string;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
/** Where a crop keeps the image: fractions of its width and height from the centre (right and down positive, within ±0.5). The image's own, like an asset's optical centre. */
|
|
10
|
-
focus?: readonly [x: number, y: number];
|
|
11
|
-
}
|
|
12
|
-
export interface ImageProps {
|
|
13
|
-
source: ContentImage;
|
|
14
|
-
alt: string;
|
|
15
|
-
priority?: boolean;
|
|
16
|
-
/** Crops the image to this shape, filling its frame; without it the image keeps its own ratio. */
|
|
17
|
-
aspectRatio?: "1 / 1" | "3 / 2" | "16 / 9";
|
|
18
|
-
/** Resource-selection hints supplied with application media, not CSS styles. */
|
|
19
|
-
responsive?: { srcSet: string; sizes: string };
|
|
20
|
-
}
|
|
21
|
-
const image = recipe({
|
|
22
|
-
layout: "inline",
|
|
23
|
-
profile: "content-media",
|
|
24
|
-
frame: {},
|
|
25
|
-
parts: {
|
|
26
|
-
visual: {
|
|
27
|
-
selector: ".ds-content-image",
|
|
28
|
-
kind: "visual",
|
|
29
|
-
required: true,
|
|
30
|
-
// The file's own pixel size reserves the image's box before it loads.
|
|
31
|
-
measured: {
|
|
32
|
-
intrinsic: {
|
|
33
|
-
type: "intrinsic-size",
|
|
34
|
-
property: "inline-size"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// The cropped form: the frame's ratio is the shape and the image fills it around
|
|
42
|
-
// its focal point, a measured position the image data supplies at render time.
|
|
43
|
-
const cover = recipe({
|
|
44
|
-
layout: "stack",
|
|
45
|
-
profile: "cover-media",
|
|
46
|
-
parts: {
|
|
47
|
-
visual: {
|
|
48
|
-
selector: ".ds-content-image",
|
|
49
|
-
kind: "visual",
|
|
50
|
-
required: true,
|
|
51
|
-
measured: {
|
|
52
|
-
focus: {
|
|
53
|
-
type: "position",
|
|
54
|
-
property: "object-position"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const ratios = {
|
|
61
|
-
"1 / 1": recipe({ frame: { ratio: "1 / 1" } }).root,
|
|
62
|
-
"3 / 2": recipe({ frame: { ratio: "3 / 2" } }).root,
|
|
63
|
-
"16 / 9": recipe({ frame: { ratio: "16 / 9" } }).root,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
/** Ordinary content media is not a registered icon or brand drawing. The visual
|
|
67
|
-
* profile contains it without stretching, or crops it to a declared ratio around
|
|
68
|
-
* the image's own focal point; no inline styling escape. */
|
|
69
|
-
export function Image({ source, alt, priority = false, aspectRatio, responsive }: ImageProps) {
|
|
70
|
-
if (aspectRatio !== undefined)
|
|
71
|
-
return <span className={`${cover.root} ${ratios[aspectRatio]}`}>
|
|
72
|
-
<img className="ds-content-image" {...cover.measured.props({ focus: source.focus })} loading={priority ? "eager" : "lazy"}
|
|
73
|
-
decoding="async" fetchPriority={priority ? "high" : undefined}
|
|
74
|
-
width={source.width} height={source.height} sizes={responsive?.sizes} srcSet={responsive?.srcSet}
|
|
75
|
-
src={source.src} alt={alt} />
|
|
76
|
-
</span>;
|
|
77
|
-
return <span className={image.root}>
|
|
78
|
-
<img className="ds-content-image" {...image.measured.props({ intrinsic: [source.width, source.height] })} loading={priority ? "eager" : "lazy"}
|
|
79
|
-
decoding="async" fetchPriority={priority ? "high" : undefined}
|
|
80
|
-
width={source.width} height={source.height} sizes={responsive?.sizes} srcSet={responsive?.srcSet}
|
|
81
|
-
src={source.src} alt={alt} />
|
|
82
|
-
</span>;
|
|
83
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "preact/hooks";
|
|
2
|
-
import { InspectedGlyph } from "@ds";
|
|
3
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
4
|
-
|
|
5
|
-
const SVG = "http://www.w3.org/2000/svg";
|
|
6
|
-
|
|
7
|
-
/** A small inert drawing, as the host's sanitizer would hand one over. */
|
|
8
|
-
function drawing(): SVGSVGElement {
|
|
9
|
-
const svg = document.createElementNS(SVG, "svg");
|
|
10
|
-
svg.setAttribute("viewBox", "0 0 24 24");
|
|
11
|
-
const path = document.createElementNS(SVG, "path");
|
|
12
|
-
path.setAttribute("d", "M12 3 21 12 12 21 3 12Z");
|
|
13
|
-
path.setAttribute("fill", "currentColor");
|
|
14
|
-
svg.append(path);
|
|
15
|
-
return svg;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Each glyph owns its drawing (an element has one parent).
|
|
19
|
-
export const scenario = {
|
|
20
|
-
title: "Inspected glyph",
|
|
21
|
-
description: "A drawing the host hands over, shown as it is.",
|
|
22
|
-
covers: ["InspectedGlyph"],
|
|
23
|
-
specimens: [
|
|
24
|
-
{ title: "A drawing alone", render: () => <InspectedGlyph drawing={useMemo(drawing, [])} label="Diamond" /> },
|
|
25
|
-
{ title: "With guides", render: () => <InspectedGlyph drawing={useMemo(drawing, [])} label="Diamond with guides" guides /> },
|
|
26
|
-
],
|
|
27
|
-
} satisfies Scenario;
|
package/dist/starters/preact/design-system/components/Content/InspectedGlyph/InspectedGlyph.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
import { useLayoutEffect, useRef } from "preact/hooks";
|
|
3
|
-
import { GuideGrid } from "@ds";
|
|
4
|
-
|
|
5
|
-
export interface InspectedGlyphProps {
|
|
6
|
-
/** The inspected project's glyph, made inert and sized by ADS's inspected-SVG sanitizer (`sanitizeInspectedSvg`) in the host. */
|
|
7
|
-
drawing: SVGSVGElement;
|
|
8
|
-
label: string;
|
|
9
|
-
/** Guide lines over the drawing (a layer above it). */
|
|
10
|
-
guides?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* Two layers in one area, painted in DOM order: the drawing (centred by its
|
|
14
|
-
visual part), then the guides, which stretch over the whole stage. */
|
|
15
|
-
const stage = recipe({
|
|
16
|
-
layout: "layered",
|
|
17
|
-
profile: "inspected-glyph",
|
|
18
|
-
frame: {},
|
|
19
|
-
parts: {
|
|
20
|
-
media: {
|
|
21
|
-
selector: ".ds-inspected-media",
|
|
22
|
-
kind: "visual",
|
|
23
|
-
media: "inspected-svg",
|
|
24
|
-
required: true
|
|
25
|
-
},
|
|
26
|
-
guides: {
|
|
27
|
-
selector: ".ds-inspected-guides",
|
|
28
|
-
required: false
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}).root;
|
|
32
|
-
|
|
33
|
-
/** Shows another project's glyph: the element arrives sanitized and is inserted, never parsed here. */
|
|
34
|
-
export function InspectedGlyph({ drawing, label, guides = false }: InspectedGlyphProps) {
|
|
35
|
-
const media = useRef<HTMLSpanElement>(null);
|
|
36
|
-
useLayoutEffect(() => {
|
|
37
|
-
const host = media.current;
|
|
38
|
-
if (host === null) return undefined;
|
|
39
|
-
host.replaceChildren(drawing);
|
|
40
|
-
return () => host.replaceChildren();
|
|
41
|
-
}, [drawing]);
|
|
42
|
-
return <span className={stage} role="img" aria-label={label}>
|
|
43
|
-
<span ref={media} className="ds-inspected-media" />
|
|
44
|
-
{guides && <span className="ds-inspected-guides"><GuideGrid divisions={4} /></span>}
|
|
45
|
-
</span>;
|
|
46
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PartnerLogo } from "@ds";
|
|
2
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
3
|
-
export const scenario = {
|
|
4
|
-
title: "Partner logos",
|
|
5
|
-
description: "Other products' marks keep their own colours, with a drawing per theme.",
|
|
6
|
-
covers: ["PartnerLogo"],
|
|
7
|
-
specimens: [
|
|
8
|
-
{
|
|
9
|
-
title: "In the light theme",
|
|
10
|
-
arrangement: "row",
|
|
11
|
-
render: () => <>
|
|
12
|
-
<PartnerLogo partner="harbor-pay" label="Harbor Pay" theme="light" />
|
|
13
|
-
<PartnerLogo partner="lumen-cloud" label="Lumen Cloud" theme="light" />
|
|
14
|
-
</>,
|
|
15
|
-
},
|
|
16
|
-
],
|
|
17
|
-
} satisfies Scenario;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
|
|
3
|
-
export type Partner = "harbor-pay" | "lumen-cloud";
|
|
4
|
-
export type PartnerLogoTheme = "light" | "dark" | "high-contrast";
|
|
5
|
-
export interface PartnerLogoProps {
|
|
6
|
-
partner: Partner;
|
|
7
|
-
/** The partner's name, read by assistive technology. */
|
|
8
|
-
label: string;
|
|
9
|
-
/** The theme the logo sits in: it selects the logo's light or dark artwork. */
|
|
10
|
-
theme: PartnerLogoTheme;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const anatomy = recipe({
|
|
14
|
-
layout: "inline",
|
|
15
|
-
align: "center",
|
|
16
|
-
parts: { visual: { selector: ".ds-partner-logo-visual", required: true, kind: "visual" } },
|
|
17
|
-
}).root;
|
|
18
|
-
// One drawing per partner and theme: the asset declares its light and dark artwork, the recipe's
|
|
19
|
-
// theme selects between them. No source import and no lookup by file name.
|
|
20
|
-
const drawings = {
|
|
21
|
-
"harbor-pay": {
|
|
22
|
-
light: recipe({ theme: "light", parts: { visual: { kind: "visual", asset: "harbor-pay", visual: "partner-logo" } } }),
|
|
23
|
-
dark: recipe({ theme: "dark", parts: { visual: { kind: "visual", asset: "harbor-pay", visual: "partner-logo" } } }),
|
|
24
|
-
"high-contrast": recipe({ theme: "high-contrast", parts: { visual: { kind: "visual", asset: "harbor-pay", visual: "partner-logo" } } }),
|
|
25
|
-
},
|
|
26
|
-
"lumen-cloud": {
|
|
27
|
-
light: recipe({ theme: "light", parts: { visual: { kind: "visual", asset: "lumen-cloud", visual: "partner-logo" } } }),
|
|
28
|
-
dark: recipe({ theme: "dark", parts: { visual: { kind: "visual", asset: "lumen-cloud", visual: "partner-logo" } } }),
|
|
29
|
-
"high-contrast": recipe({ theme: "high-contrast", parts: { visual: { kind: "visual", asset: "lumen-cloud", visual: "partner-logo" } } }),
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/** Another product's logo, unaltered: its own colours and proportions, in the artwork for the theme it sits in. */
|
|
34
|
-
export function PartnerLogo({ partner, label, theme }: PartnerLogoProps) {
|
|
35
|
-
const drawn = drawings[partner][theme];
|
|
36
|
-
return (
|
|
37
|
-
<span className={anatomy} data-theme={theme}>
|
|
38
|
-
<span className={`ds-partner-logo-visual ${drawn.parts.visual}`}><img src={drawn.assets.visual.source} alt={label} /></span>
|
|
39
|
-
</span>
|
|
40
|
-
);
|
|
41
|
-
}
|
package/dist/starters/preact/design-system/components/Content/StatusIcon/StatusIcon.ads.scenario.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { StatusIcon, type StatusName } from "@ds";
|
|
2
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
3
|
-
|
|
4
|
-
// Data, as an application would receive it: each status selects its drawing from the status glyph set.
|
|
5
|
-
const checks: readonly { readonly name: string; readonly status: StatusName }[] = [
|
|
6
|
-
{ name: "Build", status: "success" },
|
|
7
|
-
{ name: "Accessibility audit", status: "warning" },
|
|
8
|
-
{ name: "Visual comparison", status: "error" },
|
|
9
|
-
{ name: "Release notes", status: "ok" },
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
export const scenario = {
|
|
13
|
-
title: "Status icon",
|
|
14
|
-
description: "Status glyphs drawn by name from data.",
|
|
15
|
-
covers: ["StatusIcon"],
|
|
16
|
-
specimens: [
|
|
17
|
-
{ title: "One per check", note: "Build, accessibility audit, visual comparison and release notes.", arrangement: "row", render: () => <>{checks.map((check) => <StatusIcon key={check.name} status={check.status} label={check.name} />)}</> },
|
|
18
|
-
{ title: "Large", render: () => <StatusIcon status="warning" size="large" label="Needs attention" /> },
|
|
19
|
-
],
|
|
20
|
-
} satisfies Scenario;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
import type statusGlyphs from "../../../assets/status/status.ads";
|
|
3
|
-
|
|
4
|
-
/** A status from data: one of the status glyph set's names (members and aliases). */
|
|
5
|
-
export type StatusName = (typeof statusGlyphs.names)[number];
|
|
6
|
-
export interface StatusIconProps {
|
|
7
|
-
status: StatusName;
|
|
8
|
-
size?: "standard" | "large";
|
|
9
|
-
/** Omit when adjacent text states the status. */
|
|
10
|
-
label?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const anatomy = recipe({
|
|
14
|
-
layout: "inline",
|
|
15
|
-
align: "center",
|
|
16
|
-
parts: {
|
|
17
|
-
visual: {
|
|
18
|
-
selector: ".ds-status-icon-visual",
|
|
19
|
-
required: true,
|
|
20
|
-
kind: "visual"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}).root;
|
|
24
|
-
// One construction per size: the set's members share one grid, and the status
|
|
25
|
-
// selects only the drawing text from the set's lookup.
|
|
26
|
-
const drawings = {
|
|
27
|
-
standard: recipe({ parts: { visual: { kind: "visual", set: "status", visual: "artwork-icon-standard" } } }),
|
|
28
|
-
large: recipe({ parts: { visual: { kind: "visual", set: "status", visual: "artwork-icon-large" } } }),
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
/** The glyph of a status chosen at runtime, from the status glyph set. */
|
|
32
|
-
export function StatusIcon({ status, size = "standard", label }: StatusIconProps) {
|
|
33
|
-
const drawn = drawings[size];
|
|
34
|
-
return <span className={anatomy} role={label ? "img" : undefined} aria-label={label} aria-hidden={label ? undefined : true}>
|
|
35
|
-
<span className={`ds-status-icon-visual ${drawn.parts.visual}`} dangerouslySetInnerHTML={{ __html: drawn.assets.visual.source[status] }} />
|
|
36
|
-
</span>;
|
|
37
|
-
}
|
package/dist/starters/preact/design-system/components/Forms/TextField/TextField.ads.scenario.tsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TextField } from "@ds";
|
|
2
|
-
import type { Scenario } from "@reqvire-org/ads/showcase";
|
|
3
|
-
export const scenario = {
|
|
4
|
-
title: "Text field",
|
|
5
|
-
description: "Field anatomy, public alignment rows and validation states.",
|
|
6
|
-
covers: ["TextField"],
|
|
7
|
-
specimens: [
|
|
8
|
-
{
|
|
9
|
-
title: "Sizes",
|
|
10
|
-
width: "medium",
|
|
11
|
-
render: () => <>{(["sm", "md", "lg"] as const).map(size => <TextField key={size} id={`field-${size}`} size={size}
|
|
12
|
-
label="Email address" type="email" autoComplete="email" help="Use your work email." />)}</>,
|
|
13
|
-
},
|
|
14
|
-
{ title: "With an error", width: "medium", render: () => <TextField id="field-error" label="Email address" type="email" autoComplete="email" error="Enter a work email address." /> },
|
|
15
|
-
{
|
|
16
|
-
title: "Validated when you leave it",
|
|
17
|
-
note: "Type fewer than six digits, then leave the field.",
|
|
18
|
-
width: "medium",
|
|
19
|
-
render: () => <TextField id="field-code" label="One-time code" autoComplete="one-time-code" inputMode="numeric" enterKeyHint="done"
|
|
20
|
-
pattern="[0-9]{6}" required validationMessage="Enter the 6-digit code from your phone." help="Shown after you leave the field." />,
|
|
21
|
-
},
|
|
22
|
-
{ title: "Unavailable", width: "medium", render: () => <TextField id="field-disabled" label="Email address" type="email" autoComplete="email" disabled /> },
|
|
23
|
-
],
|
|
24
|
-
} satisfies Scenario;
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { recipe } from "@reqvire-org/ads/recipe" with { type: "macro" };
|
|
2
|
-
import { useFormField } from "@ds";
|
|
3
|
-
|
|
4
|
-
/** Native text-entry types; each one's keyboard, autofill and constraint differ. */
|
|
5
|
-
export type TextFieldType = "text" | "email" | "tel" | "url" | "password" | "search";
|
|
6
|
-
|
|
7
|
-
export interface TextFieldProps {
|
|
8
|
-
id: string;
|
|
9
|
-
label: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
value?: string;
|
|
12
|
-
/** Text entry type (default "text"); it also sets the native constraint (`email`, `url`). */
|
|
13
|
-
type?: TextFieldType;
|
|
14
|
-
/** The HTML autofill token (`email`, `tel`, `name`, `current-password`, `one-time-code`, …), or "off". */
|
|
15
|
-
autoComplete?: string;
|
|
16
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
|
|
17
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
|
18
|
-
/** Spelling and correction of identifiers (emails, usernames, codes) are off by default for those types. */
|
|
19
|
-
spellCheck?: boolean;
|
|
20
|
-
autoCorrect?: "on" | "off";
|
|
21
|
-
autoCapitalize?: "none" | "sentences" | "words" | "characters";
|
|
22
|
-
/** An example of the expected value; never a replacement for the label. */
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
help?: string;
|
|
25
|
-
/** The application's error (a server's verdict): shown at once, whatever the interaction. */
|
|
26
|
-
error?: string;
|
|
27
|
-
/** The message for a failed constraint (required, type, pattern, length); default: the browser's message. Shown after interaction. */
|
|
28
|
-
validationMessage?: string;
|
|
29
|
-
pattern?: string;
|
|
30
|
-
minLength?: number;
|
|
31
|
-
maxLength?: number;
|
|
32
|
-
/** Keep the browser's own validation bubble on submit instead of the field's message. */
|
|
33
|
-
nativeValidation?: boolean;
|
|
34
|
-
size?: "sm" | "md" | "lg";
|
|
35
|
-
textSize?: "sm" | "md" | "lg";
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
required?: boolean;
|
|
38
|
-
className?: string;
|
|
39
|
-
onValueChange?: (value: string) => void;
|
|
40
|
-
}
|
|
41
|
-
/* Validation and autofill states are mirrored onto the root by the form-field
|
|
42
|
-
bridge (controllers/FormField): `[data-user-invalid]` after interaction or
|
|
43
|
-
with an application error, `[data-autofill]` while the browser has filled it.
|
|
44
|
-
The invalid control adds a ring (non-colour); autofill draws a ring that takes
|
|
45
|
-
no space, and the error state wins where both hold.
|
|
46
|
-
The field is soft: a quiet fill and one rule under the text (the frame's
|
|
47
|
-
border width on the block-end side only, in the control outline colour, which
|
|
48
|
-
reaches 3:1 against the page in every theme and brand), so its boundary is
|
|
49
|
-
identified without a heavy four-sided border (WCAG 1.4.11). */
|
|
50
|
-
const anatomy = recipe({
|
|
51
|
-
layout: "stack",
|
|
52
|
-
profile: "control",
|
|
53
|
-
surface: "primary-foreground",
|
|
54
|
-
gap: {
|
|
55
|
-
slot: "spacing",
|
|
56
|
-
field: "labelGap"
|
|
57
|
-
},
|
|
58
|
-
exposeRows: [
|
|
59
|
-
"label",
|
|
60
|
-
"control",
|
|
61
|
-
"help"
|
|
62
|
-
],
|
|
63
|
-
parts: {
|
|
64
|
-
label: {
|
|
65
|
-
selector: ".ds-field-label",
|
|
66
|
-
required: true,
|
|
67
|
-
kind: "text"
|
|
68
|
-
},
|
|
69
|
-
control: {
|
|
70
|
-
selector: ".ds-field-control",
|
|
71
|
-
required: true,
|
|
72
|
-
kind: "text",
|
|
73
|
-
surface: "control-surface",
|
|
74
|
-
frame: {
|
|
75
|
-
kind: "control",
|
|
76
|
-
rules: [
|
|
77
|
-
"block-end"
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
when: {
|
|
81
|
-
"&[data-user-invalid]": {
|
|
82
|
-
surface: "invalid-control-surface"
|
|
83
|
-
},
|
|
84
|
-
"&[data-autofill]:not([data-user-invalid])": {
|
|
85
|
-
surface: "autofill-control-surface"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
pseudo: {
|
|
89
|
-
placeholder: {
|
|
90
|
-
surface: "placeholder-foreground",
|
|
91
|
-
when: {
|
|
92
|
-
"&[data-user-invalid]": {
|
|
93
|
-
surface: "error-foreground"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
help: {
|
|
100
|
-
selector: ".ds-field-help",
|
|
101
|
-
required: false,
|
|
102
|
-
kind: "text",
|
|
103
|
-
text: "identity-detail",
|
|
104
|
-
surface: "secondary-foreground",
|
|
105
|
-
when: {
|
|
106
|
-
"&[data-user-invalid]": {
|
|
107
|
-
surface: "error-foreground"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}).root;
|
|
113
|
-
// Finite named options for the compiler. Both fragments refine the ONE profile
|
|
114
|
-
// chosen by anatomy; a repeated parameter or raw field override is an error.
|
|
115
|
-
const frameChoices = {
|
|
116
|
-
sm: recipe({
|
|
117
|
-
select: {
|
|
118
|
-
size: "sm"
|
|
119
|
-
}
|
|
120
|
-
}).root,
|
|
121
|
-
md: undefined, // The shared profile already defaults to md.
|
|
122
|
-
lg: recipe({
|
|
123
|
-
select: {
|
|
124
|
-
size: "lg"
|
|
125
|
-
}
|
|
126
|
-
}).root,
|
|
127
|
-
};
|
|
128
|
-
const typographyChoices = {
|
|
129
|
-
sm: recipe({
|
|
130
|
-
select: {
|
|
131
|
-
typography: "sm"
|
|
132
|
-
}
|
|
133
|
-
}).root,
|
|
134
|
-
md: undefined, // No redundant default-selection class.
|
|
135
|
-
lg: recipe({
|
|
136
|
-
select: {
|
|
137
|
-
typography: "lg"
|
|
138
|
-
}
|
|
139
|
-
}).root,
|
|
140
|
-
};
|
|
141
|
-
/** Types whose values are identifiers: no spelling, correction or capitals unless asked. */
|
|
142
|
-
const IDENTIFIERS: ReadonlySet<TextFieldType> = new Set(["email", "tel", "url", "password"]);
|
|
143
|
-
|
|
144
|
-
/** A text field. Constraint errors show after interaction, an application error at once; the
|
|
145
|
-
* message replaces the help text and is linked by `aria-describedby` only while it is shown. */
|
|
146
|
-
export function TextField({ id, label, name, value, type = "text", autoComplete, inputMode, enterKeyHint, spellCheck,
|
|
147
|
-
autoCorrect, autoCapitalize, placeholder, help, error, validationMessage, pattern, minLength, maxLength,
|
|
148
|
-
nativeValidation = false, size = "md", textSize, disabled, required, className, onValueChange }: TextFieldProps) {
|
|
149
|
-
const helpId = help ? `${id}-help` : null;
|
|
150
|
-
const errorId = `${id}-error`;
|
|
151
|
-
const field = useFormField<HTMLInputElement, HTMLDivElement>({ label, helpId, errorId, error: error ?? null,
|
|
152
|
-
message: validationMessage ?? null, native: nativeValidation });
|
|
153
|
-
const { view } = field;
|
|
154
|
-
// Whether an error is shown; its message replaces the help text.
|
|
155
|
-
const invalid: boolean = view.kind === "invalid";
|
|
156
|
-
const message = view.kind === "invalid" ? view.message : "";
|
|
157
|
-
const identifier = IDENTIFIERS.has(type);
|
|
158
|
-
return <div ref={field.root} className={`${anatomy} ${frameChoices[size] ?? ""} ${typographyChoices[textSize ?? size] ?? ""} ${className ?? ""}`}
|
|
159
|
-
data-user-invalid={invalid ? "" : undefined} data-user-valid={view.kind === "valid" ? "" : undefined}
|
|
160
|
-
data-autofill={view.autofill ? "" : undefined}>
|
|
161
|
-
<label className="ds-field-label" htmlFor={id}>{label}</label>
|
|
162
|
-
<input ref={field.control} className="ds-field-control" id={id} name={name} value={value} placeholder={placeholder} type={type as "text"}
|
|
163
|
-
autoComplete={autoComplete} inputMode={inputMode} enterkeyhint={enterKeyHint}
|
|
164
|
-
spellcheck={spellCheck ?? (identifier ? false : undefined)} autoCorrect={autoCorrect ?? (identifier ? "off" : undefined)}
|
|
165
|
-
autoCapitalize={autoCapitalize ?? (identifier ? "none" : undefined)} pattern={pattern} minLength={minLength} maxLength={maxLength}
|
|
166
|
-
required={required} disabled={disabled} aria-invalid={invalid ? "true" : "false"}
|
|
167
|
-
aria-describedby={invalid ? errorId : (helpId ?? undefined)}
|
|
168
|
-
onInput={event => onValueChange?.(event.currentTarget.value)} />
|
|
169
|
-
{invalid
|
|
170
|
-
? <span className="ds-field-help" id={errorId}>{message}</span>
|
|
171
|
-
: help && <span className="ds-field-help" id={helpId ?? undefined}>{help}</span>}
|
|
172
|
-
</div>;
|
|
173
|
-
}
|