@buffercreations/levelsui 0.1.1 → 0.1.3
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/01. Elements/actions/controls/button/button.definition.json +38 -4
- package/01. Elements/actions/controls/button/docs/README.md +67 -0
- package/01. Elements/actions/controls/button/{api.json → docs/api.json } +14 -5
- package/01. Elements/actions/controls/button/examples/contexts/code.html +1 -3
- package/01. Elements/actions/controls/button/examples/contexts/preview.html +8 -2
- package/01. Elements/actions/controls/button/examples/icon-only/code.html +3 -0
- package/01. Elements/actions/controls/button/examples/icon-only/preview.html +17 -0
- package/01. Elements/actions/controls/button/examples/icons/code.html +2 -4
- package/01. Elements/actions/controls/button/examples/icons/preview.html +12 -3
- package/01. Elements/actions/controls/button/examples/index.json +9 -2
- package/01. Elements/actions/controls/button/examples/native-default/code.html +0 -8
- package/01. Elements/actions/controls/button/examples/native-default/preview.html +0 -4
- package/01. Elements/actions/controls/button/examples/states/code.html +1 -1
- package/01. Elements/actions/controls/button/examples/states/preview.html +2 -2
- package/01. Elements/actions/controls/button/src/button.scss +215 -0
- package/01. Elements/actions/controls/button-lumen-shift/button-lumen-shift.definition.json +95 -0
- package/01. Elements/actions/controls/button-lumen-shift/docs/README.md +85 -0
- package/01. Elements/actions/controls/button-lumen-shift/docs/api.json +134 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/basic/code.html +3 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/basic/preview.html +3 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/contexts/code.html +1 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/contexts/preview.html +9 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/icon-only/code.html +3 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/icon-only/preview.html +14 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/icons/code.html +4 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/icons/preview.html +14 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/index.json +66 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/links/code.html +3 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/links/preview.html +3 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/sizes/code.html +1 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/sizes/preview.html +6 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/states/code.html +1 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/states/preview.html +4 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/treatments/code.html +1 -0
- package/01. Elements/actions/controls/button-lumen-shift/examples/treatments/preview.html +5 -0
- package/01. Elements/actions/controls/button-lumen-shift/src/button-lumen-shift.scss +543 -0
- package/01. Elements/feedback/tooltip/docs/README.md +49 -0
- package/01. Elements/feedback/tooltip/docs/api.json +78 -0
- package/01. Elements/feedback/tooltip/examples/arrow/code.html +4 -0
- package/01. Elements/feedback/tooltip/examples/arrow/preview.html +4 -0
- package/01. Elements/feedback/tooltip/examples/comfortable/code.html +4 -0
- package/01. Elements/feedback/tooltip/examples/comfortable/preview.html +4 -0
- package/01. Elements/feedback/tooltip/examples/default/code.html +4 -0
- package/01. Elements/feedback/tooltip/examples/default/preview.html +4 -0
- package/01. Elements/feedback/tooltip/examples/delays/code.html +4 -0
- package/01. Elements/feedback/tooltip/examples/delays/preview.html +4 -0
- package/01. Elements/feedback/tooltip/examples/disabled/code.html +6 -0
- package/01. Elements/feedback/tooltip/examples/disabled/preview.html +6 -0
- package/01. Elements/feedback/tooltip/examples/index.json +66 -0
- package/01. Elements/feedback/tooltip/examples/multiple/code.html +8 -0
- package/01. Elements/feedback/tooltip/examples/multiple/preview.html +8 -0
- package/01. Elements/feedback/tooltip/examples/shortcut/code.html +4 -0
- package/01. Elements/feedback/tooltip/examples/shortcut/preview.html +4 -0
- package/01. Elements/feedback/tooltip/examples/sides/code.html +4 -0
- package/01. Elements/feedback/tooltip/examples/sides/preview.html +16 -0
- package/01. Elements/feedback/tooltip/src/tooltip.js +233 -0
- package/01. Elements/feedback/tooltip/src/tooltip.scss +117 -0
- package/01. Elements/feedback/tooltip/tooltip.definition.json +42 -0
- package/01. Elements/forms/selection/checkbox/checkbox.definition.json +65 -0
- package/01. Elements/forms/selection/checkbox/docs/README.md +46 -0
- package/01. Elements/forms/selection/checkbox/docs/api.json +102 -0
- package/01. Elements/forms/selection/checkbox/examples/basic/code.html +7 -0
- package/01. Elements/forms/selection/checkbox/examples/basic/preview.html +4 -0
- package/01. Elements/forms/selection/checkbox/examples/description/code.html +7 -0
- package/01. Elements/forms/selection/checkbox/examples/description/preview.html +7 -0
- package/01. Elements/forms/selection/checkbox/examples/group/code.html +9 -0
- package/01. Elements/forms/selection/checkbox/examples/group/preview.html +6 -0
- package/01. Elements/forms/selection/checkbox/examples/index.json +44 -0
- package/01. Elements/forms/selection/checkbox/examples/sizes/code.html +6 -0
- package/01. Elements/forms/selection/checkbox/examples/sizes/preview.html +5 -0
- package/01. Elements/forms/selection/checkbox/examples/states/code.html +6 -0
- package/01. Elements/forms/selection/checkbox/examples/states/preview.html +7 -0
- package/01. Elements/forms/selection/checkbox/examples/table/code.html +1 -0
- package/01. Elements/forms/selection/checkbox/examples/table/preview.html +8 -0
- package/01. Elements/forms/selection/checkbox/src/checkbox.scss +157 -0
- package/01. Elements/forms/selection/select/docs/README.md +37 -0
- package/01. Elements/forms/selection/select/docs/api.json +105 -0
- package/01. Elements/forms/selection/select/examples/default/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/default/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/disabled/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/disabled/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/index.json +74 -0
- package/01. Elements/forms/selection/select/examples/invalid/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/invalid/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/leading-avatar/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/leading-avatar/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/leading-icon/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/leading-icon/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/native/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/native/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/search/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/search/preview.html +12 -0
- package/01. Elements/forms/selection/select/examples/sizes/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/sizes/preview.html +36 -0
- package/01. Elements/forms/selection/select/examples/status-dot/code.html +12 -0
- package/01. Elements/forms/selection/select/examples/status-dot/preview.html +12 -0
- package/01. Elements/forms/selection/select/select.definition.json +69 -0
- package/01. Elements/forms/selection/select/src/select.js +477 -0
- package/01. Elements/forms/selection/select/src/select.scss +312 -0
- package/01. Elements/media/identity/avatar/avatar.definition.json +48 -5
- package/01. Elements/media/identity/avatar/docs/README.md +61 -0
- package/01. Elements/media/identity/avatar/docs/api.json +96 -0
- package/01. Elements/media/identity/avatar/examples/badge/code.html +7 -0
- package/01. Elements/media/identity/avatar/examples/badge/preview.html +7 -0
- package/01. Elements/media/identity/avatar/examples/badge-icon/code.html +7 -0
- package/01. Elements/media/identity/avatar/examples/badge-icon/preview.html +7 -0
- package/01. Elements/media/identity/avatar/examples/basic/code.html +6 -0
- package/01. Elements/media/identity/avatar/examples/basic/preview.html +6 -0
- package/01. Elements/media/identity/avatar/examples/dropdown/code.html +8 -0
- package/01. Elements/media/identity/avatar/examples/dropdown/preview.html +6 -0
- package/01. Elements/media/identity/avatar/examples/fallback/code.html +5 -0
- package/01. Elements/media/identity/avatar/examples/fallback/preview.html +5 -0
- package/01. Elements/media/identity/avatar/examples/index.json +68 -23
- package/01. Elements/media/identity/avatar/examples/notification-count/code.html +6 -0
- package/01. Elements/media/identity/avatar/examples/notification-count/preview.html +7 -0
- package/01. Elements/media/identity/avatar/examples/notification-dot/code.html +6 -0
- package/01. Elements/media/identity/avatar/examples/notification-dot/preview.html +7 -0
- package/01. Elements/media/identity/avatar/examples/sizes/code.html +2 -2
- package/01. Elements/media/identity/avatar/examples/sizes/preview.html +19 -26
- package/01. Elements/media/identity/avatar/examples/square/code.html +5 -0
- package/01. Elements/media/identity/avatar/examples/square/preview.html +5 -0
- package/01. Elements/media/identity/avatar/examples/status-contexts/code.html +6 -0
- package/01. Elements/media/identity/avatar/examples/status-contexts/preview.html +13 -0
- package/01. Elements/media/identity/avatar/src/avatar.js +42 -0
- package/01. Elements/media/identity/avatar/src/avatar.scss +172 -0
- package/01. Elements/navigation/items/navigation-item/docs/README.md +52 -0
- package/01. Elements/navigation/items/navigation-item/docs/api.json +84 -0
- package/01. Elements/navigation/items/navigation-item/examples/animated-collapse/code.html +9 -0
- package/01. Elements/navigation/items/navigation-item/examples/animated-collapse/preview.html +18 -0
- package/01. Elements/navigation/items/navigation-item/examples/collapsible/code.html +9 -0
- package/01. Elements/navigation/items/navigation-item/examples/collapsible/preview.html +18 -0
- package/01. Elements/navigation/items/navigation-item/examples/icon-label/code.html +6 -0
- package/01. Elements/navigation/items/navigation-item/examples/icon-label/preview.html +1 -0
- package/01. Elements/navigation/items/navigation-item/examples/icon-only/code.html +7 -0
- package/01. Elements/navigation/items/navigation-item/examples/icon-only/preview.html +1 -0
- package/01. Elements/navigation/items/navigation-item/examples/index.json +45 -0
- package/01. Elements/navigation/items/navigation-item/examples/label-only/code.html +3 -0
- package/01. Elements/navigation/items/navigation-item/examples/label-only/preview.html +1 -0
- package/01. Elements/navigation/items/navigation-item/examples/states/code.html +9 -0
- package/01. Elements/navigation/items/navigation-item/examples/states/preview.html +17 -0
- package/01. Elements/navigation/items/navigation-item/navigation-item.definition.json +40 -0
- package/01. Elements/navigation/items/navigation-item/src/navigation-item.scss +185 -0
- package/01. Elements/status/indicators/badge/badge.definition.json +55 -0
- package/01. Elements/status/indicators/badge/docs/README.md +40 -0
- package/01. Elements/status/indicators/badge/docs/api.json +112 -0
- package/01. Elements/status/indicators/badge/examples/content/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/content/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/contexts/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/contexts/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/icons/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/icons/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/index.json +58 -0
- package/01. Elements/status/indicators/badge/examples/links/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/links/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/loading/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/loading/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/sizes/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/sizes/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/status/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/status/preview.html +3 -0
- package/01. Elements/status/indicators/badge/examples/treatments/code.html +1 -0
- package/01. Elements/status/indicators/badge/examples/treatments/preview.html +3 -0
- package/01. Elements/status/indicators/badge/src/badge.scss +109 -0
- package/02. Layouts/REFINEMENT-REVIEW.md +82 -0
- package/02. Layouts/UTILITY-RECIPES.md +97 -9
- package/02. Layouts/application/app-shell/app-shell.definition.json +7 -6
- package/02. Layouts/application/app-shell/docs/README.md +64 -0
- package/02. Layouts/application/app-shell/docs/api.json +125 -0
- package/02. Layouts/application/app-shell/examples/complete/code.html +19 -0
- package/02. Layouts/application/app-shell/examples/complete/preview.html +28 -0
- package/02. Layouts/application/app-shell/examples/dual/code.html +13 -0
- package/02. Layouts/application/app-shell/examples/dual/preview.html +26 -0
- package/02. Layouts/application/app-shell/examples/header-main/code.html +10 -0
- package/02. Layouts/application/app-shell/examples/header-main/preview.html +19 -0
- package/02. Layouts/application/app-shell/examples/index.json +51 -15
- package/02. Layouts/application/app-shell/examples/main-only/code.html +7 -0
- package/02. Layouts/application/app-shell/examples/main-only/preview.html +18 -0
- package/02. Layouts/application/app-shell/examples/right/code.html +16 -0
- package/02. Layouts/application/app-shell/examples/right/preview.html +25 -0
- package/02. Layouts/application/app-shell/examples/sizes/code.html +16 -0
- package/02. Layouts/application/app-shell/examples/sizes/preview.html +27 -0
- package/02. Layouts/application/app-shell/examples/standard/code.html +13 -0
- package/02. Layouts/application/app-shell/examples/standard/preview.html +22 -0
- package/02. Layouts/application/app-shell/examples/sticky/code.html +16 -0
- package/02. Layouts/application/app-shell/examples/sticky/preview.html +23 -0
- package/02. Layouts/application/app-shell/src/app-shell.scss +119 -0
- package/02. Layouts/application/page-frame/docs/README.md +13 -0
- package/02. Layouts/application/page-frame/docs/api.json +33 -0
- package/02. Layouts/application/page-frame/examples/footer/code.html +8 -0
- package/02. Layouts/application/page-frame/examples/footer/preview.html +11 -0
- package/02. Layouts/application/page-frame/examples/header/code.html +8 -0
- package/02. Layouts/application/page-frame/examples/header/preview.html +11 -0
- package/02. Layouts/application/page-frame/examples/index.json +30 -0
- package/02. Layouts/application/page-frame/examples/main/code.html +5 -0
- package/02. Layouts/application/page-frame/examples/main/preview.html +10 -0
- package/02. Layouts/application/page-frame/examples/standard/code.html +11 -0
- package/02. Layouts/application/page-frame/examples/standard/preview.html +12 -0
- package/02. Layouts/application/page-frame/page-frame.definition.json +24 -0
- package/02. Layouts/application/page-frame/src/page-frame.html +11 -0
- package/02. Layouts/composition/cluster/cluster.definition.json +24 -0
- package/02. Layouts/composition/cluster/docs/README.md +45 -0
- package/02. Layouts/composition/cluster/docs/api.json +29 -0
- package/02. Layouts/composition/cluster/examples/basic/code.html +3 -0
- package/02. Layouts/composition/cluster/examples/basic/preview.html +6 -0
- package/02. Layouts/composition/cluster/examples/index.json +9 -0
- package/02. Layouts/composition/cluster/src/cluster.html +3 -0
- package/02. Layouts/composition/inline/docs/README.md +45 -0
- package/02. Layouts/composition/inline/docs/api.json +28 -0
- package/02. Layouts/composition/inline/examples/basic/code.html +3 -0
- package/02. Layouts/composition/inline/examples/basic/preview.html +4 -0
- package/02. Layouts/composition/inline/examples/index.json +16 -0
- package/02. Layouts/composition/inline/examples/scrolling/code.html +3 -0
- package/02. Layouts/composition/inline/examples/scrolling/preview.html +14 -0
- package/02. Layouts/composition/inline/inline.definition.json +24 -0
- package/02. Layouts/composition/inline/src/inline.html +3 -0
- package/02. Layouts/composition/overlap/docs/README.md +47 -0
- package/02. Layouts/composition/overlap/docs/api.json +59 -0
- package/02. Layouts/composition/overlap/examples/basic/code.html +8 -0
- package/02. Layouts/composition/overlap/examples/basic/preview.html +9 -0
- package/02. Layouts/composition/overlap/examples/index.json +44 -0
- package/02. Layouts/composition/overlap/examples/size-2xs/code.html +8 -0
- package/02. Layouts/composition/overlap/examples/size-2xs/preview.html +9 -0
- package/02. Layouts/composition/overlap/examples/size-lg/code.html +8 -0
- package/02. Layouts/composition/overlap/examples/size-lg/preview.html +9 -0
- package/02. Layouts/composition/overlap/examples/size-sm/code.html +8 -0
- package/02. Layouts/composition/overlap/examples/size-sm/preview.html +9 -0
- package/02. Layouts/composition/overlap/examples/size-xl/code.html +8 -0
- package/02. Layouts/composition/overlap/examples/size-xl/preview.html +9 -0
- package/02. Layouts/composition/overlap/examples/size-xs/code.html +8 -0
- package/02. Layouts/composition/overlap/examples/size-xs/preview.html +9 -0
- package/02. Layouts/composition/overlap/overlap.definition.json +26 -0
- package/02. Layouts/composition/overlap/src/overlap.scss +51 -0
- package/02. Layouts/composition/sidebar/docs/README.md +84 -0
- package/02. Layouts/composition/sidebar/docs/api.json +70 -0
- package/02. Layouts/composition/sidebar/examples/basic/code.html +8 -0
- package/02. Layouts/composition/sidebar/examples/basic/preview.html +14 -0
- package/02. Layouts/composition/sidebar/examples/index.json +37 -0
- package/02. Layouts/composition/sidebar/examples/large/code.html +8 -0
- package/02. Layouts/composition/sidebar/examples/large/preview.html +14 -0
- package/02. Layouts/composition/sidebar/examples/size-2xs/code.html +8 -0
- package/02. Layouts/composition/sidebar/examples/size-2xs/preview.html +14 -0
- package/02. Layouts/composition/sidebar/examples/size-xs/code.html +8 -0
- package/02. Layouts/composition/sidebar/examples/size-xs/preview.html +14 -0
- package/02. Layouts/composition/sidebar/examples/small/code.html +8 -0
- package/02. Layouts/composition/sidebar/examples/small/preview.html +14 -0
- package/02. Layouts/{sections → composition}/sidebar/sidebar.definition.json +6 -5
- package/02. Layouts/composition/sidebar/src/sidebar.scss +38 -0
- package/02. Layouts/composition/split/docs/README.md +56 -0
- package/02. Layouts/composition/split/docs/api.json +51 -0
- package/02. Layouts/composition/split/examples/basic/code.html +8 -0
- package/02. Layouts/composition/split/examples/basic/preview.html +10 -0
- package/02. Layouts/composition/split/examples/index.json +23 -0
- package/02. Layouts/composition/split/examples/wide-end/code.html +8 -0
- package/02. Layouts/composition/split/examples/wide-end/preview.html +10 -0
- package/02. Layouts/composition/split/examples/wide-start/code.html +8 -0
- package/02. Layouts/composition/split/examples/wide-start/preview.html +10 -0
- package/02. Layouts/{content → composition}/split/split.definition.json +6 -5
- package/02. Layouts/composition/split/src/split.scss +29 -0
- package/02. Layouts/composition/stack/docs/README.md +48 -0
- package/02. Layouts/composition/stack/docs/api.json +61 -0
- package/02. Layouts/composition/stack/examples/basic/code.html +1 -2
- package/02. Layouts/composition/stack/examples/basic/preview.html +12 -2
- package/02. Layouts/composition/stack/examples/compact/code.html +3 -0
- package/02. Layouts/composition/stack/examples/compact/preview.html +14 -0
- package/02. Layouts/composition/stack/examples/index.json +44 -1
- package/02. Layouts/composition/stack/examples/size-2xs/code.html +3 -0
- package/02. Layouts/composition/stack/examples/size-2xs/preview.html +14 -0
- package/02. Layouts/composition/stack/examples/size-lg/code.html +3 -0
- package/02. Layouts/composition/stack/examples/size-lg/preview.html +14 -0
- package/02. Layouts/composition/stack/examples/size-xl/code.html +3 -0
- package/02. Layouts/composition/stack/examples/size-xl/preview.html +14 -0
- package/02. Layouts/composition/stack/examples/size-xs/code.html +3 -0
- package/02. Layouts/composition/stack/examples/size-xs/preview.html +14 -0
- package/02. Layouts/composition/stack/{stack.html → src/stack.html } +1 -2
- package/02. Layouts/composition/stack/stack.definition.json +22 -5
- package/02. Layouts/composition/switcher/docs/README.md +51 -0
- package/02. Layouts/composition/switcher/docs/api.json +37 -0
- package/02. Layouts/composition/switcher/examples/basic/code.html +3 -0
- package/02. Layouts/composition/switcher/examples/basic/preview.html +14 -0
- package/02. Layouts/composition/switcher/examples/index.json +9 -0
- package/02. Layouts/composition/switcher/src/switcher.scss +24 -0
- package/02. Layouts/composition/switcher/switcher.definition.json +26 -0
- package/02. Layouts/content/grid/docs/README.md +77 -0
- package/02. Layouts/content/grid/docs/api.json +67 -0
- package/02. Layouts/content/grid/examples/basic/code.html +2 -4
- package/02. Layouts/content/grid/examples/basic/preview.html +13 -4
- package/02. Layouts/content/grid/examples/dense/code.html +3 -0
- package/02. Layouts/content/grid/examples/dense/preview.html +18 -0
- package/02. Layouts/content/grid/examples/index.json +30 -2
- package/02. Layouts/content/grid/examples/large/code.html +3 -0
- package/02. Layouts/content/grid/examples/large/preview.html +14 -0
- package/02. Layouts/content/grid/examples/size-2xs/code.html +3 -0
- package/02. Layouts/content/grid/examples/size-2xs/preview.html +14 -0
- package/02. Layouts/content/grid/examples/size-xs/code.html +3 -0
- package/02. Layouts/content/grid/examples/size-xs/preview.html +14 -0
- package/02. Layouts/content/grid/grid.definition.json +5 -4
- package/02. Layouts/content/grid/src/grid.scss +32 -0
- package/02. Layouts/content/reel/docs/README.md +81 -0
- package/02. Layouts/content/reel/docs/api.json +67 -0
- package/02. Layouts/content/reel/examples/basic/code.html +3 -0
- package/02. Layouts/content/reel/examples/basic/preview.html +14 -0
- package/02. Layouts/content/reel/examples/index.json +30 -0
- package/02. Layouts/content/reel/examples/size-2xs/code.html +3 -0
- package/02. Layouts/content/reel/examples/size-2xs/preview.html +14 -0
- package/02. Layouts/content/reel/examples/size-xs/code.html +3 -0
- package/02. Layouts/content/reel/examples/size-xs/preview.html +14 -0
- package/02. Layouts/content/reel/examples/small/code.html +3 -0
- package/02. Layouts/content/reel/examples/small/preview.html +14 -0
- package/02. Layouts/content/reel/reel.definition.json +26 -0
- package/02. Layouts/content/reel/src/reel.scss +40 -0
- package/02. Layouts/primitives/center/center.definition.json +24 -0
- package/02. Layouts/primitives/center/docs/README.md +44 -0
- package/02. Layouts/primitives/center/docs/api.json +28 -0
- package/02. Layouts/primitives/center/examples/basic/code.html +3 -0
- package/02. Layouts/primitives/center/examples/basic/preview.html +4 -0
- package/02. Layouts/primitives/center/examples/index.json +16 -0
- package/02. Layouts/primitives/center/examples/minimum-height/code.html +3 -0
- package/02. Layouts/primitives/center/examples/minimum-height/preview.html +4 -0
- package/02. Layouts/primitives/center/src/center.html +3 -0
- package/02. Layouts/primitives/container/container.definition.json +24 -0
- package/02. Layouts/primitives/container/docs/README.md +44 -0
- package/02. Layouts/primitives/container/docs/api.json +28 -0
- package/02. Layouts/primitives/container/examples/basic/code.html +3 -0
- package/02. Layouts/primitives/container/examples/basic/preview.html +6 -0
- package/02. Layouts/primitives/container/examples/index.json +16 -0
- package/02. Layouts/primitives/container/examples/reading/code.html +3 -0
- package/02. Layouts/primitives/container/examples/reading/preview.html +4 -0
- package/02. Layouts/primitives/container/src/container.html +3 -0
- package/02. Layouts/primitives/frame/docs/README.md +45 -0
- package/02. Layouts/primitives/frame/docs/api.json +29 -0
- package/02. Layouts/primitives/frame/examples/basic/code.html +3 -0
- package/02. Layouts/primitives/frame/examples/basic/preview.html +6 -0
- package/02. Layouts/primitives/frame/examples/index.json +16 -0
- package/02. Layouts/primitives/frame/examples/square/code.html +3 -0
- package/02. Layouts/primitives/frame/examples/square/preview.html +6 -0
- package/02. Layouts/primitives/frame/frame.definition.json +24 -0
- package/02. Layouts/primitives/frame/src/frame.html +3 -0
- package/02. Layouts/sections/bleed/bleed.definition.json +24 -0
- package/02. Layouts/sections/bleed/docs/README.md +45 -0
- package/02. Layouts/sections/bleed/docs/api.json +33 -0
- package/02. Layouts/sections/bleed/examples/basic/code.html +11 -0
- package/02. Layouts/sections/bleed/examples/basic/preview.html +14 -0
- package/02. Layouts/sections/bleed/examples/index.json +16 -0
- package/02. Layouts/sections/bleed/examples/reading/code.html +11 -0
- package/02. Layouts/sections/bleed/examples/reading/preview.html +14 -0
- package/02. Layouts/sections/bleed/src/bleed.html +11 -0
- package/02. Layouts/sections/content-grid/content-grid.definition.json +26 -0
- package/02. Layouts/sections/content-grid/docs/README.md +59 -0
- package/02. Layouts/sections/content-grid/docs/api.json +38 -0
- package/02. Layouts/sections/content-grid/examples/basic/code.html +11 -0
- package/02. Layouts/sections/content-grid/examples/basic/preview.html +10 -0
- package/02. Layouts/sections/content-grid/examples/index.json +9 -0
- package/02. Layouts/sections/content-grid/src/content-grid.scss +16 -0
- package/02. Layouts/sections/cover/cover.definition.json +26 -0
- package/02. Layouts/sections/cover/docs/README.md +60 -0
- package/02. Layouts/sections/cover/docs/api.json +50 -0
- package/02. Layouts/sections/cover/examples/basic/code.html +11 -0
- package/02. Layouts/sections/cover/examples/basic/preview.html +8 -0
- package/02. Layouts/sections/cover/examples/compact/code.html +11 -0
- package/02. Layouts/sections/cover/examples/compact/preview.html +8 -0
- package/02. Layouts/sections/cover/examples/index.json +16 -0
- package/02. Layouts/sections/cover/src/cover.scss +41 -0
- package/02. Layouts/sections/section/docs/README.md +52 -0
- package/02. Layouts/sections/section/docs/api.json +63 -0
- package/02. Layouts/sections/section/examples/basic/code.html +2 -2
- package/02. Layouts/sections/section/examples/basic/preview.html +5 -2
- package/02. Layouts/sections/section/examples/index.json +37 -2
- package/02. Layouts/sections/section/examples/size-2xs/code.html +5 -0
- package/02. Layouts/sections/section/examples/size-2xs/preview.html +8 -0
- package/02. Layouts/sections/section/examples/size-md/code.html +5 -0
- package/02. Layouts/sections/section/examples/size-md/preview.html +8 -0
- package/02. Layouts/sections/section/examples/size-sm/code.html +5 -0
- package/02. Layouts/sections/section/examples/size-sm/preview.html +8 -0
- package/02. Layouts/sections/section/examples/size-xl/code.html +5 -0
- package/02. Layouts/sections/section/examples/size-xl/preview.html +8 -0
- package/02. Layouts/sections/section/examples/size-xs/code.html +5 -0
- package/02. Layouts/sections/section/examples/size-xs/preview.html +8 -0
- package/02. Layouts/sections/section/section.definition.json +8 -6
- package/02. Layouts/sections/section/src/section.html +5 -0
- package/03. Components/cards/card/card.definition.json +36 -0
- package/03. Components/cards/card/docs/README.md +27 -0
- package/03. Components/cards/card/docs/api.json +64 -0
- package/03. Components/cards/card/examples/badge-status/code.html +9 -0
- package/03. Components/cards/card/examples/badge-status/preview.html +9 -0
- package/03. Components/cards/card/examples/basic/code.html +6 -0
- package/03. Components/cards/card/examples/basic/preview.html +6 -0
- package/03. Components/cards/card/examples/button-action/code.html +11 -0
- package/03. Components/cards/card/examples/button-action/preview.html +11 -0
- package/03. Components/cards/card/examples/header-footer/code.html +13 -0
- package/03. Components/cards/card/examples/header-footer/preview.html +13 -0
- package/03. Components/cards/card/examples/index.json +48 -0
- package/03. Components/cards/card/examples/media/code.html +9 -0
- package/03. Components/cards/card/examples/media/preview.html +9 -0
- package/03. Components/cards/card/src/card.scss +56 -0
- package/03. Components/cards/card-disclosure/card-disclosure.definition.json +27 -0
- package/03. Components/cards/card-disclosure/docs/README.md +24 -0
- package/03. Components/cards/card-disclosure/docs/api.json +58 -0
- package/03. Components/cards/card-disclosure/examples/basic/code.html +16 -0
- package/03. Components/cards/card-disclosure/examples/basic/preview.html +16 -0
- package/03. Components/cards/card-disclosure/examples/expanded/code.html +16 -0
- package/03. Components/cards/card-disclosure/examples/expanded/preview.html +16 -0
- package/03. Components/cards/card-disclosure/examples/index.json +17 -0
- package/03. Components/cards/card-disclosure/src/card-disclosure.html +16 -0
- package/03. Components/cards/card-utility-summary/card-utility-summary.definition.json +24 -0
- package/03. Components/cards/card-utility-summary/docs/README.md +23 -0
- package/03. Components/cards/card-utility-summary/docs/api.json +33 -0
- package/03. Components/cards/card-utility-summary/examples/basic/code.html +13 -0
- package/03. Components/cards/card-utility-summary/examples/basic/preview.html +13 -0
- package/03. Components/cards/card-utility-summary/examples/compact/code.html +8 -0
- package/03. Components/cards/card-utility-summary/examples/compact/preview.html +8 -0
- package/03. Components/cards/card-utility-summary/examples/index.json +17 -0
- package/03. Components/cards/card-utility-summary/src/card-utility-summary.html +13 -0
- package/03. Components/data-display/statistics/stat-card/docs/README.md +104 -0
- package/03. Components/data-display/statistics/stat-card/docs/api.json +153 -0
- package/03. Components/data-display/statistics/stat-card/examples/action/code.html +8 -0
- package/03. Components/data-display/statistics/stat-card/examples/action/preview.html +21 -0
- package/03. Components/data-display/statistics/stat-card/examples/coloured-values/code.html +4 -0
- package/03. Components/data-display/statistics/stat-card/examples/coloured-values/preview.html +14 -0
- package/03. Components/data-display/statistics/stat-card/examples/icon-led/code.html +13 -0
- package/03. Components/data-display/statistics/stat-card/examples/icon-led/preview.html +27 -0
- package/03. Components/data-display/statistics/stat-card/examples/icons/code.html +8 -0
- package/03. Components/data-display/statistics/stat-card/examples/icons/preview.html +27 -0
- package/03. Components/data-display/statistics/stat-card/examples/index.json +117 -0
- package/03. Components/data-display/statistics/stat-card/examples/inline-comparison/code.html +8 -0
- package/03. Components/data-display/statistics/stat-card/examples/inline-comparison/preview.html +18 -0
- package/03. Components/data-display/statistics/stat-card/examples/long-value/code.html +5 -0
- package/03. Components/data-display/statistics/stat-card/examples/long-value/preview.html +7 -0
- package/03. Components/data-display/statistics/stat-card/examples/minimal/code.html +4 -0
- package/03. Components/data-display/statistics/stat-card/examples/minimal/preview.html +14 -0
- package/03. Components/data-display/statistics/stat-card/examples/sentiments/code.html +11 -0
- package/03. Components/data-display/statistics/stat-card/examples/sentiments/preview.html +26 -0
- package/03. Components/data-display/statistics/stat-card/examples/sizes/code.html +4 -0
- package/03. Components/data-display/statistics/stat-card/examples/sizes/preview.html +14 -0
- package/03. Components/data-display/statistics/stat-card/examples/standard/code.html +8 -0
- package/03. Components/data-display/statistics/stat-card/examples/standard/preview.html +23 -0
- package/03. Components/data-display/statistics/stat-card/examples/states/code.html +5 -0
- package/03. Components/data-display/statistics/stat-card/examples/states/preview.html +17 -0
- package/03. Components/data-display/statistics/stat-card/examples/trailing-trend/code.html +8 -0
- package/03. Components/data-display/statistics/stat-card/examples/trailing-trend/preview.html +18 -0
- package/03. Components/data-display/statistics/stat-card/src/stat-card.scss +253 -0
- package/03. Components/data-display/statistics/stat-card/stat-card.definition.json +49 -0
- package/03. Components/media/identity/avatar-group/avatar-group.definition.json +39 -0
- package/03. Components/media/identity/avatar-group/docs/README.md +37 -0
- package/03. Components/media/identity/avatar-group/docs/api.json +99 -0
- package/03. Components/media/identity/avatar-group/examples/count/code.html +19 -0
- package/03. Components/media/identity/avatar-group/examples/count/preview.html +19 -0
- package/03. Components/media/identity/avatar-group/examples/count-icon/code.html +19 -0
- package/03. Components/media/identity/avatar-group/examples/count-icon/preview.html +19 -0
- package/03. Components/media/identity/avatar-group/examples/group/code.html +18 -0
- package/03. Components/media/identity/avatar-group/examples/group/preview.html +18 -0
- package/03. Components/media/identity/avatar-group/examples/index.json +38 -0
- package/03. Components/media/identity/avatar-group/examples/rtl/code.html +19 -0
- package/03. Components/media/identity/avatar-group/examples/rtl/preview.html +19 -0
- package/03. Components/media/identity/avatar-group/examples/sizes/code.html +14 -0
- package/03. Components/media/identity/avatar-group/examples/sizes/preview.html +27 -0
- package/03. Components/media/identity/avatar-group/src/avatar-group.scss +72 -0
- package/03. Components/navigation/menus/navigation-menu/docs/README.md +34 -0
- package/03. Components/navigation/menus/navigation-menu/docs/api.json +70 -0
- package/03. Components/navigation/menus/navigation-menu/examples/groups/code.html +27 -0
- package/03. Components/navigation/menus/navigation-menu/examples/groups/preview.html +27 -0
- package/03. Components/navigation/menus/navigation-menu/examples/horizontal/code.html +19 -0
- package/03. Components/navigation/menus/navigation-menu/examples/horizontal/preview.html +19 -0
- package/03. Components/navigation/menus/navigation-menu/examples/icon-links/code.html +36 -0
- package/03. Components/navigation/menus/navigation-menu/examples/icon-links/preview.html +36 -0
- package/03. Components/navigation/menus/navigation-menu/examples/index.json +45 -0
- package/03. Components/navigation/menus/navigation-menu/examples/nested/code.html +21 -0
- package/03. Components/navigation/menus/navigation-menu/examples/nested/preview.html +21 -0
- package/03. Components/navigation/menus/navigation-menu/examples/separators/code.html +22 -0
- package/03. Components/navigation/menus/navigation-menu/examples/separators/preview.html +22 -0
- package/03. Components/navigation/menus/navigation-menu/examples/vertical/code.html +19 -0
- package/03. Components/navigation/menus/navigation-menu/examples/vertical/preview.html +19 -0
- package/03. Components/navigation/menus/navigation-menu/navigation-menu.definition.json +38 -0
- package/03. Components/navigation/menus/navigation-menu/src/navigation-menu.scss +78 -0
- package/03. Components/navigation/sidebars/floating-sidebar/docs/README.md +34 -0
- package/03. Components/navigation/sidebars/floating-sidebar/docs/api.json +58 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/animated/code.html +42 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/animated/preview.html +42 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/branded/code.html +43 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/branded/preview.html +43 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/grouped/code.html +50 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/grouped/preview.html +50 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/index.json +50 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/long/code.html +66 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/long/preview.html +66 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/profile/code.html +51 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/profile/preview.html +51 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/standard/code.html +42 -0
- package/03. Components/navigation/sidebars/floating-sidebar/examples/standard/preview.html +42 -0
- package/03. Components/navigation/sidebars/floating-sidebar/floating-sidebar.definition.json +52 -0
- package/03. Components/navigation/sidebars/floating-sidebar/src/floating-sidebar.js +73 -0
- package/03. Components/navigation/sidebars/floating-sidebar/src/floating-sidebar.scss +138 -0
- package/README.md +60 -11
- package/dist/catalogue.json +442 -0
- package/dist/components/app-shell.css +76 -64
- package/dist/components/avatar-group.css +69 -0
- package/dist/components/avatar.css +98 -176
- package/dist/components/badge.css +118 -0
- package/dist/components/button-lumen-shift.css +388 -0
- package/dist/components/button.css +58 -28
- package/dist/components/card.css +47 -0
- package/dist/components/checkbox.css +129 -0
- package/dist/components/content-grid.css +16 -0
- package/dist/components/cover.css +41 -0
- package/dist/components/floating-sidebar.css +136 -0
- package/dist/components/grid.css +23 -13
- package/dist/components/navigation-item.css +169 -0
- package/dist/components/navigation-menu.css +74 -0
- package/dist/components/overlap.css +51 -0
- package/dist/components/reel.css +40 -0
- package/dist/components/select.css +288 -0
- package/dist/components/sidebar.css +33 -17
- package/dist/components/split.css +23 -16
- package/dist/components/stat-card.css +219 -0
- package/dist/components/switcher.css +24 -0
- package/dist/components/tooltip.css +101 -0
- package/package.json +7 -4
- package/schemas/reusable-ui.schema.json +145 -2
- package/tooling/cli/asset-organisation.mjs +126 -0
- package/tooling/cli/build.mjs +14 -7
- package/tooling/cli/cli.mjs +46 -19
- package/tooling/cli/commands.mjs +10 -0
- package/tooling/cli/configuration.mjs +60 -0
- package/tooling/cli/migrate.mjs +7 -4
- package/tooling/cli/project.mjs +188 -20
- package/tooling/registry/catalogue-index.mjs +54 -0
- package/tooling/registry/categories.mjs +3 -0
- package/tooling/registry/definitions.mjs +86 -9
- package/tooling/registry/native.mjs +32 -0
- package/tools/build-css.mjs +84 -30
- package/01. Elements/actions/controls/button/button.scss +0 -80
- package/01. Elements/actions/controls/button/docs.md +0 -41
- package/01. Elements/media/identity/avatar/api.json +0 -126
- package/01. Elements/media/identity/avatar/avatar.scss +0 -80
- package/01. Elements/media/identity/avatar/docs.md +0 -64
- package/01. Elements/media/identity/avatar/examples/badges/code.html +0 -10
- package/01. Elements/media/identity/avatar/examples/badges/preview.html +0 -29
- package/01. Elements/media/identity/avatar/examples/fallbacks/code.html +0 -5
- package/01. Elements/media/identity/avatar/examples/fallbacks/preview.html +0 -23
- package/01. Elements/media/identity/avatar/examples/presence/code.html +0 -6
- package/01. Elements/media/identity/avatar/examples/presence/preview.html +0 -26
- package/01. Elements/media/identity/avatar/examples/shapes/code.html +0 -5
- package/01. Elements/media/identity/avatar/examples/shapes/preview.html +0 -17
- package/02. Layouts/application/app-shell/api.json +0 -46
- package/02. Layouts/application/app-shell/app-shell.scss +0 -68
- package/02. Layouts/application/app-shell/docs.md +0 -31
- package/02. Layouts/application/app-shell/examples/basic/code.html +0 -17
- package/02. Layouts/application/app-shell/examples/basic/preview.html +0 -17
- package/02. Layouts/application/app-shell/examples/collapsed/code.html +0 -17
- package/02. Layouts/application/app-shell/examples/collapsed/preview.html +0 -17
- package/02. Layouts/application/app-shell/examples/hidden/code.html +0 -17
- package/02. Layouts/application/app-shell/examples/hidden/preview.html +0 -17
- package/02. Layouts/composition/stack/api.json +0 -1
- package/02. Layouts/composition/stack/docs.md +0 -5
- package/02. Layouts/content/grid/api.json +0 -23
- package/02. Layouts/content/grid/docs.md +0 -19
- package/02. Layouts/content/grid/grid.scss +0 -5
- package/02. Layouts/content/split/api.json +0 -23
- package/02. Layouts/content/split/docs.md +0 -18
- package/02. Layouts/content/split/examples/basic/code.html +0 -4
- package/02. Layouts/content/split/examples/basic/preview.html +0 -4
- package/02. Layouts/content/split/examples/index.json +0 -9
- package/02. Layouts/content/split/split.scss +0 -7
- package/02. Layouts/primitives/overlay/api.json +0 -23
- package/02. Layouts/primitives/overlay/docs.md +0 -19
- package/02. Layouts/primitives/overlay/examples/basic/code.html +0 -5
- package/02. Layouts/primitives/overlay/examples/basic/preview.html +0 -5
- package/02. Layouts/primitives/overlay/examples/index.json +0 -9
- package/02. Layouts/primitives/overlay/overlay.definition.json +0 -25
- package/02. Layouts/primitives/overlay/overlay.scss +0 -4
- package/02. Layouts/sections/section/api.json +0 -23
- package/02. Layouts/sections/section/docs.md +0 -19
- package/02. Layouts/sections/section/section.scss +0 -4
- package/02. Layouts/sections/sidebar/api.json +0 -23
- package/02. Layouts/sections/sidebar/docs.md +0 -18
- package/02. Layouts/sections/sidebar/examples/basic/code.html +0 -4
- package/02. Layouts/sections/sidebar/examples/basic/preview.html +0 -4
- package/02. Layouts/sections/sidebar/examples/index.json +0 -9
- package/02. Layouts/sections/sidebar/sidebar.scss +0 -7
- package/dist/components/overlay.css +0 -17
- package/dist/components/section.css +0 -14
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Restricted native targets make overlap decidable. Add future native tags here
|
|
2
|
+
// only with an explicit platform contract; arbitrary CSS is not a family ID.
|
|
3
|
+
export const nativeTargets = Object.freeze({
|
|
4
|
+
button: ['button'],
|
|
5
|
+
'text-input': ['input:not([type])', ...['text', 'search', 'email', 'url', 'tel', 'password', 'number'].map(type => `input[type="${type}"]`)],
|
|
6
|
+
checkbox: ['input[type="checkbox"]'], radio: ['input[type="radio"]'],
|
|
7
|
+
select: ['select'], textarea: ['textarea'], table: ['table'],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export function nativeDefinitionErrors(definition) {
|
|
11
|
+
const native = definition.native;
|
|
12
|
+
if (!native) return [];
|
|
13
|
+
const errors = [];
|
|
14
|
+
const targets=Object.hasOwn(nativeTargets,native.family)?nativeTargets[native.family]:null;
|
|
15
|
+
if (definition.level !== 'elements' || definition.kind === 'recipe') errors.push('native requires an authored Element');
|
|
16
|
+
if (!targets || !Array.isArray(native.selectors) ||
|
|
17
|
+
native.selectors.some(selector => !targets?.includes(selector))) errors.push('native selectors must belong to their non-overlapping native family');
|
|
18
|
+
if (native.eligible && (definition.source?.js || definition.mount || definition.dependencies?.behaviours?.length)) errors.push('native eligibility requires CSS-only native anatomy');
|
|
19
|
+
return errors;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function designSelector(asset, installed, selected) {
|
|
23
|
+
const explicit = '.' + asset.className;
|
|
24
|
+
if (!asset.native?.eligible || selected[asset.native.family] !== asset.id) return `:where(${explicit})`;
|
|
25
|
+
// Exclude every installed peer, including inactive designs, so a selected
|
|
26
|
+
// native default never supplies part of an explicit alternative's contract.
|
|
27
|
+
const exclusions = installed.filter(peer => peer.id !== asset.id && peer.native?.family === asset.native.family).flatMap(peer => [
|
|
28
|
+
'.' + peer.className, `[class^="${peer.className}--"]`, `[class*=" ${peer.className}--"]`,
|
|
29
|
+
]);
|
|
30
|
+
const native = asset.native.selectors.map(selector => `${selector}:not([data-levelsui-native="off"])${exclusions.length ? `:not(${exclusions.join(', ')})` : ''}`);
|
|
31
|
+
return `:where(${[explicit, ...native].join(', ')})`;
|
|
32
|
+
}
|
package/tools/build-css.mjs
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import {createHash} from 'node:crypto';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import {createRequire} from 'node:module';
|
|
4
6
|
|
|
5
|
-
import {assertWithin} from '../tooling/registry/paths.mjs';
|
|
7
|
+
import {assertWithin,safeRelative} from '../tooling/registry/paths.mjs';
|
|
6
8
|
import {discoverReusableUiDefinitions} from '../tooling/registry/definitions.mjs';
|
|
9
|
+
import {buildCatalogueIndex} from '../tooling/registry/catalogue-index.mjs';
|
|
7
10
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
// Match Node's dependency lookup in both hoisted workspaces and standalone installs.
|
|
12
|
+
const dependencyPaths = [
|
|
13
|
+
...(process.env.SASS_PATH || '').split(path.delimiter).filter(Boolean),
|
|
14
|
+
...createRequire(import.meta.url).resolve.paths('@buffercreations/buffercore'),
|
|
15
|
+
];
|
|
10
16
|
let sass;
|
|
11
17
|
try {
|
|
12
18
|
sass = await import('sass');
|
|
@@ -17,29 +23,21 @@ try {
|
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
const assets = [];
|
|
20
|
-
|
|
21
|
-
if (!fs.existsSync(folder)) return;
|
|
22
|
-
for (const item of fs.readdirSync(folder, { withFileTypes: true })) {
|
|
23
|
-
const location = path.join(folder, item.name);
|
|
24
|
-
if (item.isDirectory()) walk(location);
|
|
25
|
-
else if (item.isFile() && item.name.endsWith('.definition.json')) {
|
|
26
|
-
let definition;
|
|
27
|
-
try {
|
|
28
|
-
definition = JSON.parse(fs.readFileSync(location, 'utf8'));
|
|
29
|
-
} catch (error) {
|
|
30
|
-
throw new Error(`Invalid definition ${path.relative(root, location)}: ${error.message}`);
|
|
31
|
-
}
|
|
32
|
-
assets.push({ definition, location });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
for (const definition of discoverReusableUiDefinitions(root,{hydrate:false})) assets.push({definition,location:definition.definitionFile});
|
|
26
|
+
for (const definition of discoverReusableUiDefinitions(root,{hydrate:false,requireBuiltCss:false})) assets.push({definition,location:definition.definitionFile});
|
|
38
27
|
assets.sort((a, b) => a.location.localeCompare(b.location));
|
|
39
28
|
|
|
40
29
|
const outputRoot = path.join(root, 'dist', 'components');
|
|
41
30
|
assertWithin(root,outputRoot);
|
|
42
31
|
fs.mkdirSync(outputRoot, { recursive: true });
|
|
32
|
+
const stateFile=assertWithin(root,path.join(root,'.cache/stylesheets.json'));
|
|
33
|
+
const previous=fs.existsSync(stateFile)?JSON.parse(fs.readFileSync(stateFile,'utf8')):{};
|
|
34
|
+
const inputCacheFile=assertWithin(root,path.join(root,'.cache/build-inputs.json'));
|
|
35
|
+
const previousInputs=fs.existsSync(inputCacheFile)?JSON.parse(fs.readFileSync(inputCacheFile,'utf8')):{};
|
|
36
|
+
const nextInputs={};
|
|
37
|
+
let cached=0;
|
|
38
|
+
let compiled=0;
|
|
39
|
+
const owned={};
|
|
40
|
+
const digest=file=>createHash('sha256').update(fs.readFileSync(file)).digest('hex');
|
|
43
41
|
const known = new Set();
|
|
44
42
|
const outputs=new Set();
|
|
45
43
|
let count = 0;
|
|
@@ -59,17 +57,73 @@ for (const { definition, location } of assets) {
|
|
|
59
57
|
}
|
|
60
58
|
const output = assertWithin(root,path.resolve(root,definition.source.css));
|
|
61
59
|
if(outputs.has(output))throw Error("Duplicate CSS output: "+definition.source.css);outputs.add(output);fs.mkdirSync(path.dirname(output),{recursive:true});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
const cachedEntry=previousInputs[id];
|
|
61
|
+
const cacheMatches=cachedEntry?.source===path.relative(root,input).replaceAll(path.sep,'/') &&
|
|
62
|
+
cachedEntry.output===path.relative(root,output).replaceAll(path.sep,'/') &&
|
|
63
|
+
cachedEntry.sassVersion===sass.info &&
|
|
64
|
+
Array.isArray(cachedEntry.inputs) && cachedEntry.inputs.length>0 &&
|
|
65
|
+
cachedEntry.inputs.every(item=>item.path && /^[a-f0-9]{64}$/.test(item.digest) &&
|
|
66
|
+
fs.existsSync(item.path) && digest(item.path)===item.digest) &&
|
|
67
|
+
fs.existsSync(output) && cachedEntry.cssDigest===digest(output);
|
|
68
|
+
if(cacheMatches){
|
|
69
|
+
nextInputs[id]=cachedEntry;
|
|
70
|
+
cached++;
|
|
71
|
+
}else{
|
|
72
|
+
try {
|
|
73
|
+
const result = sass.compile(input, { style: 'expanded', sourceMap: false, loadPaths: dependencyPaths });
|
|
74
|
+
if(!result.css)throw Error('Empty compiled CSS');
|
|
75
|
+
// Sass reports loaded files, including transitive @use dependencies.
|
|
76
|
+
// Hashing their content (not timestamps) correctly invalidates Assets
|
|
77
|
+
// when the shared Foundation or any local dependency changes.
|
|
78
|
+
const files=[...new Set([input,...result.loadedUrls.filter(url=>url.protocol==='file:').map(fileURLToPath)])].sort();
|
|
79
|
+
nextInputs[id]={
|
|
80
|
+
source:path.relative(root,input).replaceAll(path.sep,'/'),
|
|
81
|
+
output:path.relative(root,output).replaceAll(path.sep,'/'),
|
|
82
|
+
sassVersion:sass.info,
|
|
83
|
+
inputs:files.map(file=>({path:file,digest:digest(file)})),
|
|
84
|
+
cssDigest:createHash('sha256').update(result.css).digest('hex'),
|
|
85
|
+
};
|
|
86
|
+
fs.writeFileSync(output,result.css);
|
|
87
|
+
compiled++;
|
|
88
|
+
} catch (error) {
|
|
89
|
+
console.error(`Unable to compile ${id} (${path.relative(root, input)}):`);
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
68
92
|
}
|
|
69
93
|
if (!fs.statSync(output).size) throw new Error(`Empty CSS output for ${id}`);
|
|
94
|
+
owned[path.relative(root,output).replaceAll(path.sep,"/")]=digest(output);
|
|
70
95
|
count++;
|
|
71
|
-
console.log(`${id}: ${path.relative(root, output)} (${fs.statSync(output).size} bytes)`);
|
|
96
|
+
console.log(`${id}: ${path.relative(root, output)} (${fs.statSync(output).size} bytes)${cacheMatches?' [cached]':''}`);
|
|
72
97
|
}
|
|
73
|
-
console.log(`Built ${count} library
|
|
98
|
+
console.log(`Built ${count} library stylesheets (${compiled} compiled, ${cached} cached).`);
|
|
74
99
|
|
|
75
|
-
for(const
|
|
100
|
+
for(const [relative,hash] of Object.entries(previous)){
|
|
101
|
+
if(Object.hasOwn(owned,relative))continue;
|
|
102
|
+
if(!safeRelative(relative)||!relative.endsWith('.css'))throw Error('Invalid owned stylesheet cache entry: '+relative);
|
|
103
|
+
const file=assertWithin(root,path.join(root,relative));
|
|
104
|
+
if(fs.existsSync(file)){
|
|
105
|
+
if(digest(file)===hash)fs.unlinkSync(file);
|
|
106
|
+
else console.warn('Preserved modified generated stylesheet: '+relative);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
fs.mkdirSync(path.dirname(stateFile),{recursive:true});
|
|
110
|
+
const temporary=stateFile+'.'+process.pid+'.tmp';fs.writeFileSync(temporary,JSON.stringify(owned,null,2)+'\n');fs.renameSync(temporary,stateFile);
|
|
111
|
+
const inputTemporary=inputCacheFile+'.'+process.pid+'.tmp';
|
|
112
|
+
try {
|
|
113
|
+
fs.writeFileSync(inputTemporary,JSON.stringify(nextInputs,null,2)+'\n');
|
|
114
|
+
fs.renameSync(inputTemporary,inputCacheFile);
|
|
115
|
+
} finally {if(fs.existsSync(inputTemporary))fs.unlinkSync(inputTemporary);}
|
|
116
|
+
|
|
117
|
+
// Final validation remains strict: every declared generated file must now exist.
|
|
118
|
+
discoverReusableUiDefinitions(root,{hydrate:false});
|
|
119
|
+
|
|
120
|
+
// Publish a compact catalogue for fast discovery in installed npm packages.
|
|
121
|
+
// Full definitions and source validation remain the authority for installation.
|
|
122
|
+
const catalogueFile = assertWithin(root, path.join(root, 'dist', 'catalogue.json'));
|
|
123
|
+
const catalogueTemp = catalogueFile + '.' + process.pid + '.tmp';
|
|
124
|
+
try {
|
|
125
|
+
fs.writeFileSync(catalogueTemp, JSON.stringify(buildCatalogueIndex(root), null, 2) + '\n');
|
|
126
|
+
fs.renameSync(catalogueTemp, catalogueFile);
|
|
127
|
+
} finally {
|
|
128
|
+
if (fs.existsSync(catalogueTemp)) fs.unlinkSync(catalogueTemp);
|
|
129
|
+
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/* BufferCore — Level 02 / Button. CSS-compatible SCSS source.
|
|
2
|
-
Requires Foundations semantics + context utilities; no primitive tokens.
|
|
3
|
-
Native buttons are styled by default when this asset is loaded.
|
|
4
|
-
Primary is the demo/app root context, not a local Button override. */
|
|
5
|
-
:where(button, .bce-button) {
|
|
6
|
-
--bce-button-height: var(--bc-size-ui-40);
|
|
7
|
-
--bce-button-pad-y: 0;
|
|
8
|
-
--bce-button-pad-x: var(--bc-size-ui-12);
|
|
9
|
-
--bce-button-colour: var(--bc-color-text-context-inverse-strong);
|
|
10
|
-
--bce-button-background: var(--bc-color-fill-context);
|
|
11
|
-
--bce-button-outline: var(--bc-color-fill-context);
|
|
12
|
-
--bce-button-hover-background: var(--bc-color-fill-context-strong);
|
|
13
|
-
--bce-button-active-background: var(--bc-color-fill-context-bold);
|
|
14
|
-
--bce-button-hover-outline: var(--bc-color-fill-context-strong);
|
|
15
|
-
--bce-button-active-outline: var(--bc-color-fill-context-bold);
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
min-height: var(--bce-button-height);
|
|
19
|
-
max-width: 100%;
|
|
20
|
-
padding: var(--bce-button-pad-y) var(--bce-button-pad-x);
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
gap: var(--bc-size-ui-6);
|
|
24
|
-
border-radius: var(--bc-radius-sm);
|
|
25
|
-
border: var(--bc-border-width-sm) solid var(--bce-button-outline);
|
|
26
|
-
background: var(--bce-button-background);
|
|
27
|
-
color: var(--bce-button-colour);
|
|
28
|
-
font-family: var(--bc-type-label-2-font-family);
|
|
29
|
-
font-size: var(--bc-type-label-2-font-size);
|
|
30
|
-
font-weight: var(--bc-type-label-2-font-weight);
|
|
31
|
-
line-height: var(--bc-type-label-2-line-height);
|
|
32
|
-
padding-block: max(0px, calc((var(--bce-button-height) - 1lh - 2 * var(--bc-border-width-sm)) / 2));
|
|
33
|
-
letter-spacing: var(--bc-type-label-2-letter-spacing);
|
|
34
|
-
text-align: center;
|
|
35
|
-
text-decoration: none;
|
|
36
|
-
vertical-align: middle;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
user-select: none;
|
|
39
|
-
touch-action: manipulation;
|
|
40
|
-
transition: background-color var(--bc-motion-interaction), border-color var(--bc-motion-interaction), color var(--bc-motion-interaction);
|
|
41
|
-
}
|
|
42
|
-
.bce-button__icon { display: inline-flex; flex: none; align-items: center; justify-content: center; }
|
|
43
|
-
.bce-button__icon svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
44
|
-
.bce-button__label { min-width: 0; }
|
|
45
|
-
.bce-button--outline, .bce-button--ghost {
|
|
46
|
-
--bce-button-colour: var(--bc-color-text-context);
|
|
47
|
-
--bce-button-background: transparent;
|
|
48
|
-
--bce-button-hover-background: var(--bc-color-fill-context-subtle);
|
|
49
|
-
--bce-button-active-background: var(--bc-color-fill-context-soft);
|
|
50
|
-
--bce-button-hover-outline: var(--bc-color-border-context-strong);
|
|
51
|
-
--bce-button-active-outline: var(--bc-color-border-context-bold);
|
|
52
|
-
}
|
|
53
|
-
.bce-button--outline { --bce-button-outline: var(--bc-color-border-context); }
|
|
54
|
-
.bce-button--ghost { --bce-button-outline: transparent; --bce-button-hover-outline: transparent; --bce-button-active-outline: transparent; }
|
|
55
|
-
.bce-button--56 { --bce-button-height: var(--bc-size-ui-56); --bce-button-pad-y: var(--bc-size-ui-8); --bce-button-pad-x: var(--bc-size-ui-12); }
|
|
56
|
-
.bce-button--48 { --bce-button-height: var(--bc-size-ui-48); --bce-button-pad-y: var(--bc-size-ui-6); --bce-button-pad-x: var(--bc-size-ui-12); }
|
|
57
|
-
.bce-button--40 { --bce-button-height: var(--bc-size-ui-40); --bce-button-pad-y: var(--bc-size-ui-6); --bce-button-pad-x: var(--bc-size-ui-12); }
|
|
58
|
-
.bce-button--32 { font-size: var(--bc-type-label-3-font-size); --bce-button-height: var(--bc-size-ui-32); --bce-button-pad-y: var(--bc-size-ui-4); --bce-button-pad-x: var(--bc-size-ui-8); }
|
|
59
|
-
.bce-button--24 { font-size: var(--bc-type-label-4-font-size); line-height: 1; --bce-button-height: var(--bc-size-ui-24); --bce-button-pad-y: var(--bc-size-ui-2); --bce-button-pad-x: var(--bc-size-ui-6); }
|
|
60
|
-
.bce-button--icon-only { aspect-ratio: 1; min-inline-size: var(--bce-button-height); padding-inline: 0; }
|
|
61
|
-
@media (hover: hover) {
|
|
62
|
-
:where(button, .bce-button):not(:disabled):not([aria-disabled="true"]):hover {
|
|
63
|
-
background: var(--bce-button-hover-background);
|
|
64
|
-
border-color: var(--bce-button-hover-outline);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
:where(button, .bce-button):not(:disabled):not([aria-disabled="true"]):active {
|
|
68
|
-
background: var(--bce-button-active-background);
|
|
69
|
-
border-color: var(--bce-button-active-outline);
|
|
70
|
-
}
|
|
71
|
-
:where(button, .bce-button):focus-visible {
|
|
72
|
-
outline: var(--bc-border-width-sm) solid var(--bc-color-border-context-strong);
|
|
73
|
-
outline-offset: var(--bc-size-ui-2);
|
|
74
|
-
}
|
|
75
|
-
:where(button, .bce-button):disabled, :where(button, .bce-button)[aria-disabled="true"] {
|
|
76
|
-
opacity: var(--bc-interaction-disabled-opacity);
|
|
77
|
-
cursor: not-allowed;
|
|
78
|
-
}
|
|
79
|
-
@media (prefers-reduced-motion: reduce) { :where(button, .bce-button) { transition: none; } }
|
|
80
|
-
/* The Button is CSS-only; consumers own their interaction logic. */
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Button
|
|
2
|
-
|
|
3
|
-
category 01 Element. Use a Button for an action; use an `<a href>` with the same `bce-button` class for navigation. A Button Group or Segmented Control is a **separate category 03 Component**, not a Button modifier.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Install Foundations using `@buffercreations/buffercore`, then add this Button asset with the BufferCore CLI (which handles styling and dependencies). The library asset is not included in the default Foundations npm package. The exact CLI command depends on your local or published CLI installation.
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<!-- Automatically styled by the Button asset; no class required -->
|
|
13
|
-
<button type="button">Label</button>
|
|
14
|
-
|
|
15
|
-
<!-- Explicit class is still supported -->
|
|
16
|
-
<button class="bce-button" type="button">Label</button>
|
|
17
|
-
|
|
18
|
-
<!-- Modifiers may be used without the base class on native buttons -->
|
|
19
|
-
<button class="bce-button--outline" type="button">Outline</button>
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
The Button asset styles **all native `<button>` elements** in its CSS scope by default (including form submit/reset buttons). The explicit `.bce-button` class still works for links and other supported markup. Use `type="button"` for actions that should not submit a form.
|
|
24
|
-
|
|
25
|
-
Native styling is included in the normal Button CSS; it is not a separate installation mode. Loading the Button asset means accepting its native `<button>` default in that CSS scope. No per-element opt-out or alternative installation mode is provided.
|
|
26
|
-
|
|
27
|
-
Solid is the default. Add `bce-button--outline` or `bce-button--ghost` for alternate treatments. Size modifiers are `--56`, `--48`, `--40`, `--32`, and `--24`; `--40` is the default height. Avoid setting two size modifiers simultaneously.
|
|
28
|
-
|
|
29
|
-
Buttons inherit their semantic colour context (`bc-is-*`), so they should work inside themed sections without changing their own implementation.
|
|
30
|
-
|
|
31
|
-
## States
|
|
32
|
-
|
|
33
|
-
Normal, hover, pressed and keyboard focus are handled in CSS. Use the actual `disabled` attribute when an action is unavailable. A loading state is not provided by this CSS-only version; any future loading feature should use a `data-loading` semantic state and prevent repeated actions in the consuming code.
|
|
34
|
-
|
|
35
|
-
## Icons
|
|
36
|
-
|
|
37
|
-
Use the `.bce-button__icon` slot for icons from any library or inline SVG. For icon-only buttons add `bce-button--icon-only` and `aria-label`. BufferCore never requires Iconify.
|
|
38
|
-
|
|
39
|
-
## No JavaScript
|
|
40
|
-
|
|
41
|
-
This Element does not load any JavaScript. Event handlers are supplied by the application.
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"variants": [
|
|
3
|
-
{
|
|
4
|
-
"id": "circle",
|
|
5
|
-
"className": "bce-avatar",
|
|
6
|
-
"default": true
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": "rounded",
|
|
10
|
-
"className": "bce-avatar--rounded"
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
"sizes": [
|
|
14
|
-
{
|
|
15
|
-
"id": "xs",
|
|
16
|
-
"className": "bce-avatar--xs"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "sm",
|
|
20
|
-
"className": "bce-avatar--sm"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"id": "md",
|
|
24
|
-
"className": "bce-avatar--md",
|
|
25
|
-
"default": true
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "lg",
|
|
29
|
-
"className": "bce-avatar--lg"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"id": "xl",
|
|
33
|
-
"className": "bce-avatar--xl"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"id": "2xl",
|
|
37
|
-
"className": "bce-avatar--2xl"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"anatomy": [
|
|
41
|
-
"image (optional)",
|
|
42
|
-
"initials (fallback)",
|
|
43
|
-
"placeholder (fallback)",
|
|
44
|
-
"status indicator (optional)",
|
|
45
|
-
"verified indicator (optional)",
|
|
46
|
-
"notification badge (optional)",
|
|
47
|
-
"custom badge (optional)"
|
|
48
|
-
],
|
|
49
|
-
"properties": [
|
|
50
|
-
{
|
|
51
|
-
"name": "Size",
|
|
52
|
-
"type": "CSS class",
|
|
53
|
-
"default": "md",
|
|
54
|
-
"description": "Named scale xs, sm, md, lg, xl and 2xl (md is the default and requires no class)."
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"name": "Shape",
|
|
58
|
-
"type": "CSS class",
|
|
59
|
-
"default": "circle",
|
|
60
|
-
"description": "Circular by default; --rounded for a rounded square."
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"name": "Border",
|
|
64
|
-
"type": "CSS class",
|
|
65
|
-
"default": "none",
|
|
66
|
-
"description": "--bordered adds a subtle outer outline."
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "Presence",
|
|
70
|
-
"type": "data attribute",
|
|
71
|
-
"default": "not shown",
|
|
72
|
-
"description": "data-status=\"online|offline|away|busy\". Requires a .bce-avatar__status child to render."
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "Verification",
|
|
76
|
-
"type": "data attribute",
|
|
77
|
-
"default": "not shown",
|
|
78
|
-
"description": "data-verified=\"true\" with .bce-avatar__verified child."
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"name": "Notifications",
|
|
82
|
-
"type": "HTML child",
|
|
83
|
-
"default": "not shown",
|
|
84
|
-
"description": "Optional .bce-avatar__notifications child containing the actual number or formatted count. Do not use CSS generated content for meaningful counts."
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"name": "Company or custom badge",
|
|
88
|
-
"type": "HTML child",
|
|
89
|
-
"default": "not shown",
|
|
90
|
-
"description": "Optional .bce-avatar__badge containing a logo or other authorised markup."
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"name": "Fallback",
|
|
94
|
-
"type": "HTML content",
|
|
95
|
-
"default": "initials or placeholder",
|
|
96
|
-
"description": "Initials or an icon are shown when no image exists, or when the consuming application sets data-image-error=\"true\" after a failed image."
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"name": "Colour context",
|
|
100
|
-
"type": "inherited class",
|
|
101
|
-
"default": "inherited",
|
|
102
|
-
"description": "Inherits bc-is-*; CSS surfaces and neutral treatments use existing Foundations semantics."
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
"accessibility": [
|
|
106
|
-
"Provide an accessible name on a meaningful image; use alt=\"\" for decorative images when the user name is supplied elsewhere.",
|
|
107
|
-
"Supply accessible text for presence and verified state via surrounding text or screen-reader-only content; coloured dots and data attributes alone do not convey information.",
|
|
108
|
-
"Render notification values as real text; ensure assistive-technology context is available if the number has meaning.",
|
|
109
|
-
"Do not make the avatar interactive by adding tabindex or role=\"button\" to its decorative container; wrap in a native link or button where the product requires an action.",
|
|
110
|
-
"Avoid putting the meaningful alt or status label inside an aria-hidden wrapper."
|
|
111
|
-
],
|
|
112
|
-
"tags": [
|
|
113
|
-
"identity",
|
|
114
|
-
"people",
|
|
115
|
-
"media",
|
|
116
|
-
"application-ui"
|
|
117
|
-
],
|
|
118
|
-
"notes": [
|
|
119
|
-
"CSS-only Element; no mandatory JavaScript or Behaviour dependency.",
|
|
120
|
-
"Image load failure cannot be detected by CSS alone; an optional tiny onerror fallback example is documented.",
|
|
121
|
-
"A single avatar is Level 02; Avatar Group and Avatar Label Group are distinct future Level 04 compositions.",
|
|
122
|
-
"The design uses semantic Foundations tokens and keeps verification independent from presence and notifications.",
|
|
123
|
-
"All examples separate multi-variation previews from a single clean, formatted code snippet.",
|
|
124
|
-
"No inline style attributes are permitted in canonical Avatar examples; use Foundation utilities for composition and Avatar classes only for its own design responsibilities."
|
|
125
|
-
]
|
|
126
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/* BufferCore — Level 02 / Avatar. Pure CSS; no JS dependency. */
|
|
2
|
-
.bce-avatar {
|
|
3
|
-
--bce-avatar-size: var(--bc-size-ui-40);
|
|
4
|
-
--bce-avatar-radius: var(--bc-radius-full);
|
|
5
|
-
--bce-avatar-badge-size: var(--bc-size-ui-16);
|
|
6
|
-
--bce-avatar-initials-size: var(--bc-type-label-3-font-size);
|
|
7
|
-
position: relative;
|
|
8
|
-
display: inline-grid;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
flex: none;
|
|
11
|
-
width: var(--bce-avatar-size);
|
|
12
|
-
height: var(--bce-avatar-size);
|
|
13
|
-
place-items: center;
|
|
14
|
-
vertical-align: middle;
|
|
15
|
-
isolation: isolate;
|
|
16
|
-
color: var(--bc-color-text-context-strong);
|
|
17
|
-
}
|
|
18
|
-
.bce-avatar__face {
|
|
19
|
-
display: grid;
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
min-width: 0;
|
|
23
|
-
min-height: 0;
|
|
24
|
-
place-items: center;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
border-radius: var(--bce-avatar-radius);
|
|
27
|
-
background: var(--bc-color-fill-context-subtle);
|
|
28
|
-
color: var(--bc-color-text-context-strong);
|
|
29
|
-
}
|
|
30
|
-
.bce-avatar__image { display:block; width:100%; height:100%; object-fit:cover; }
|
|
31
|
-
.bce-avatar__fallback { display: none; width:100%; height:100%; place-items:center; text-align:center; font-family: var(--bc-type-label-3-font-family); font-weight: var(--bc-type-weight-600); font-size: var(--bce-avatar-initials-size); line-height: 1; }
|
|
32
|
-
.bce-avatar__fallback svg { display:block; width:52%; height:52%; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
|
|
33
|
-
/* The fallback is visible when markup has no image or the application marks a failed image. */
|
|
34
|
-
.bce-avatar:not(:has(.bce-avatar__image)) .bce-avatar__fallback,
|
|
35
|
-
.bce-avatar[data-image-error="true"] .bce-avatar__fallback { display:grid; }
|
|
36
|
-
.bce-avatar[data-image-error="true"] .bce-avatar__image { display:none; }
|
|
37
|
-
/* Named size scale. Physical dimensions remain Foundation design tokens. */
|
|
38
|
-
.bce-avatar--xs { --bce-avatar-size: var(--bc-size-ui-24); --bce-avatar-badge-size: var(--bc-size-ui-8); --bce-avatar-initials-size: var(--bc-type-label-4-font-size); }
|
|
39
|
-
.bce-avatar--sm { --bce-avatar-size: var(--bc-size-ui-32); --bce-avatar-badge-size: var(--bc-size-ui-12); --bce-avatar-initials-size: var(--bc-type-label-4-font-size); }
|
|
40
|
-
/* md is the default and needs no size modifier. */
|
|
41
|
-
.bce-avatar--md { --bce-avatar-size: var(--bc-size-ui-40); --bce-avatar-badge-size: var(--bc-size-ui-12); }
|
|
42
|
-
.bce-avatar--lg { --bce-avatar-size: var(--bc-size-ui-48); --bce-avatar-badge-size: var(--bc-size-ui-16); }
|
|
43
|
-
.bce-avatar--xl { --bce-avatar-size: var(--bc-size-ui-64); --bce-avatar-badge-size: var(--bc-size-ui-16); --bce-avatar-initials-size: var(--bc-type-label-2-font-size); }
|
|
44
|
-
.bce-avatar--2xl { --bce-avatar-size: var(--bc-size-ui-96); --bce-avatar-badge-size: var(--bc-size-ui-24); --bce-avatar-initials-size: var(--bc-type-label-1-font-size); }
|
|
45
|
-
.bce-avatar--bordered .bce-avatar__face { outline: var(--bc-border-width-sm) solid var(--bc-color-border-context-subtle); outline-offset: -1px; }
|
|
46
|
-
.bce-avatar--rounded { --bce-avatar-radius: var(--bc-radius-md); }
|
|
47
|
-
/* Overlay nodes are optional. Presence and verified states must be explicit. */
|
|
48
|
-
.bce-avatar__status, .bce-avatar__verified, .bce-avatar__badge, .bce-avatar__notifications {
|
|
49
|
-
position:absolute; box-sizing:border-box; z-index:1;
|
|
50
|
-
display:none; align-items:center; justify-content:center;
|
|
51
|
-
border: var(--bc-border-width-sm) solid var(--bc-color-surface-context);
|
|
52
|
-
background:var(--bc-color-surface-context);
|
|
53
|
-
}
|
|
54
|
-
.bce-avatar__status {
|
|
55
|
-
right:0; bottom:0; width:var(--bce-avatar-badge-size); height:var(--bce-avatar-badge-size);
|
|
56
|
-
border-radius:var(--bc-radius-full);
|
|
57
|
-
}
|
|
58
|
-
.bce-avatar[data-status="online"] .bce-avatar__status { display:flex; background:var(--bc-color-fill-success); }
|
|
59
|
-
.bce-avatar[data-status="offline"] .bce-avatar__status { display:flex; background:var(--bc-color-fill-neutral); }
|
|
60
|
-
.bce-avatar[data-status="away"] .bce-avatar__status { display:flex; background:var(--bc-color-fill-warning); }
|
|
61
|
-
.bce-avatar[data-status="busy"] .bce-avatar__status { display:flex; background:var(--bc-color-fill-error); }
|
|
62
|
-
.bce-avatar__verified, .bce-avatar__badge { top:0; right:0; width:var(--bce-avatar-badge-size); height:var(--bce-avatar-badge-size); border-radius:var(--bc-radius-full); }
|
|
63
|
-
.bce-avatar[data-verified="true"] .bce-avatar__verified { display:flex; color:var(--bc-color-text-primary-strong-inverse); background:var(--bc-color-fill-primary); }
|
|
64
|
-
.bce-avatar__verified svg { display:block; width:80%; height:80%; fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
|
|
65
|
-
.bce-avatar__badge { display:flex; overflow:hidden; }
|
|
66
|
-
.bce-avatar__badge img { width:100%; height:100%; object-fit:cover; }
|
|
67
|
-
.bce-avatar__notifications {
|
|
68
|
-
top:0; left:100%; transform:translate(-35%,-25%); display:flex;
|
|
69
|
-
min-width:var(--bc-size-ui-16); min-height:var(--bc-size-ui-16);
|
|
70
|
-
padding-inline:var(--bc-size-ui-4); border-radius:var(--bc-radius-full);
|
|
71
|
-
color:var(--bc-color-text-error-strong-inverse); background:var(--bc-color-fill-error);
|
|
72
|
-
font-family: var(--bc-type-label-4-font-family); font-weight: var(--bc-type-weight-600); font-size: var(--bc-type-label-4-font-size); line-height: 1; font-variant-numeric:tabular-nums;
|
|
73
|
-
}
|
|
74
|
-
/* Explicit no-count state, rather than silently interpreting text. */
|
|
75
|
-
.bce-avatar__notifications[hidden] { display:none; }
|
|
76
|
-
|
|
77
|
-
/* Logo/icon badge anatomy without inline SVG presentation attributes. */
|
|
78
|
-
.bce-avatar__badge svg { display:block; width:100%; height:100%; }
|
|
79
|
-
.bce-avatar__badge svg rect { fill:var(--bc-color-fill-context); }
|
|
80
|
-
.bce-avatar__badge svg path { fill:none; stroke:var(--bc-color-text-context-inverse); stroke-width:2; }
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# Avatar
|
|
2
|
-
|
|
3
|
-
category 01 identity Element. A single Avatar shows a person's or organisation's image, initials or fallback icon. It may display *independent* presence, verification, notification and company-badge overlays. Avatar Group and Avatar Label Group belong to category 03 Components, and are intentionally not part of this Element.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Install `@buffercreations/buffercore` Foundations, then install/select the `avatar` asset through LevelsUI / CLI. This asset's CSS is built to `dist/components/avatar.css`; it is **not** part of the Foundations npm package.
|
|
8
|
-
|
|
9
|
-
## Basic usage
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<span class="bce-avatar" role="img" aria-label="Alex Morgan">
|
|
13
|
-
<span class="bce-avatar__face">
|
|
14
|
-
<img class="bce-avatar__image" src="/images/alex.jpg" alt="">
|
|
15
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
16
|
-
</span>
|
|
17
|
-
</span>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Use the **named size scale** `xs`, `sm`, `md`, `lg`, `xl`, `2xl`; `md` is the default and requires no modifier. The dimensions are still mapped internally to the canonical Foundation size tokens. The default is circular. Use `bce-avatar--rounded` for rounded square, and `bce-avatar--bordered` for an outline. All dimensions and colours draw from Foundations tokens.
|
|
21
|
-
|
|
22
|
-
## State versus styling
|
|
23
|
-
|
|
24
|
-
Class modifiers control size, shape and border. Data attributes express semantic state such as `data-status="online"` or `data-verified="true"`. These states only display overlays if the matching child element exists; setting the attribute alone does not invent its markup. The optional `.bce-avatar__notifications` contains real text rather than a CSS pseudo-element's `content`. Do **not** put the notification count in an attribute and display it via CSS `attr()` alone.
|
|
25
|
-
|
|
26
|
-
Presence: `online`, `offline`, `away`, or `busy`. Do not confuse presence with verification. When status indicators appear, give the user an accessible textual equivalent outside any `aria-hidden` icon.
|
|
27
|
-
|
|
28
|
-
```html
|
|
29
|
-
<span class="bce-avatar" role="img" aria-label="Alex Morgan, online, verified" data-status="online" data-verified="true">
|
|
30
|
-
<span class="bce-avatar__face">
|
|
31
|
-
<span class="bce-avatar__fallback">AM</span>
|
|
32
|
-
</span>
|
|
33
|
-
<span class="bce-avatar__status" aria-hidden="true"></span>
|
|
34
|
-
<span class="bce-avatar__verified" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="m5 12 4 4 10-10"/></svg></span>
|
|
35
|
-
</span>
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
For counts, render `<span class="bce-avatar__notifications" aria-label="3 unread notifications">3</span>` (or keep the count in an accessible label on an enclosing control). Format larger values in the consuming application, e.g. `99+`. Hide empty counts by omitting the node or setting `hidden`; the Element doesn't fetch or calculate notification totals.
|
|
40
|
-
|
|
41
|
-
## Missing and failed images
|
|
42
|
-
|
|
43
|
-
Omit `.bce-avatar__image` to show `.bce-avatar__fallback`. If the image fails to load, set `data-image-error="true"` on the root; the default styles hide the image and reveal the fallback. This requires a consumer-side image error handler, as **CSS alone cannot reliably detect failed images**. For basic static HTML, a simple optional handler is:
|
|
44
|
-
|
|
45
|
-
```html
|
|
46
|
-
<img class="bce-avatar__image" src="/avatar.jpg" alt="Alex Morgan"
|
|
47
|
-
onerror="this.closest('.bce-avatar').dataset.imageError='true'">
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Use the framework's equivalent error callback in applications instead of inline handlers. The default fallback can be initials or an accessible person-icon SVG; avoid inaccessible blank avatars.
|
|
51
|
-
|
|
52
|
-
## Optional overlays
|
|
53
|
-
|
|
54
|
-
`__status` appears at bottom-right. `__verified` and `__badge` occupy the top-right position **and should not be used together without a customised layout**; choose which one takes that slot. `__notifications` appears above the upper-right perimeter and may require extra space. This is intentionally documented rather than adding a large set of combination-specific modifier classes.
|
|
55
|
-
|
|
56
|
-
## Accessibility and behaviour
|
|
57
|
-
|
|
58
|
-
An Avatar is display-only by default. For an avatar that opens a profile, put the Element inside a native `<a>` or `<button>` with an appropriate accessible name, and ensure the surrounding content handles keyboard focus. Avoid duplicated spoken labels: if the Avatar's image is decorative next to the person's name, use `alt=""`. State icons can be `aria-hidden="true"` only if an equivalent accessible name/text is present. All optional overlays are CSS-only; there is no mandatory JavaScript or Behaviour dependency.
|
|
59
|
-
|
|
60
|
-
## Studio examples and utility-first authoring
|
|
61
|
-
|
|
62
|
-
Each example has two intentional representations: `preview.html` may contain multiple variants for visual comparison, while `code.html` contains **one clean, properly indented, copyable usage example**. Do not place a full variant gallery in Code.
|
|
63
|
-
|
|
64
|
-
The preview wrapper uses Foundation layout utilities (`bc-flex`, `bc-flex-wrap`, `bc-items-center`, `bc-gap-md`), not inline `style` declarations or bespoke wrapper classes. The `bce-avatar` classes exist only for Avatar's own identity presentation, sizes and overlay anatomy, which cannot be produced reliably from a generic utility recipe. Avoid hard-coded SVG colours, inline styles and arbitrary numerical size modifier names.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<span class="bce-avatar bce-avatar--xl" data-verified="true" role="img" aria-label="Alex Morgan, verified">
|
|
2
|
-
<span class="bce-avatar__face">
|
|
3
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
4
|
-
</span>
|
|
5
|
-
<span class="bce-avatar__verified" aria-hidden="true">
|
|
6
|
-
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
7
|
-
<path d="m5 12 4 4 10-10" />
|
|
8
|
-
</svg>
|
|
9
|
-
</span>
|
|
10
|
-
</span>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
-
<span class="bce-avatar bce-avatar--xl" data-verified="true" role="img" aria-label="Alex Morgan, verified">
|
|
3
|
-
<span class="bce-avatar__face">
|
|
4
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
5
|
-
</span>
|
|
6
|
-
<span class="bce-avatar__verified" aria-hidden="true">
|
|
7
|
-
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
8
|
-
<path d="m5 12 4 4 10-10" />
|
|
9
|
-
</svg>
|
|
10
|
-
</span>
|
|
11
|
-
</span>
|
|
12
|
-
<span class="bce-avatar bce-avatar--xl" role="img" aria-label="Alex Morgan">
|
|
13
|
-
<span class="bce-avatar__face">
|
|
14
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
15
|
-
</span>
|
|
16
|
-
<span class="bce-avatar__notifications" aria-label="3 unread notifications">3</span>
|
|
17
|
-
</span>
|
|
18
|
-
<span class="bce-avatar bce-avatar--xl" role="img" aria-label="Alex Morgan">
|
|
19
|
-
<span class="bce-avatar__face">
|
|
20
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
21
|
-
</span>
|
|
22
|
-
<span class="bce-avatar__badge" aria-hidden="true">
|
|
23
|
-
<svg viewBox="0 0 24 24">
|
|
24
|
-
<rect x="0" y="0" width="24" height="24" rx="12" />
|
|
25
|
-
<path d="M5 18 12 5l7 13" />
|
|
26
|
-
</svg>
|
|
27
|
-
</span>
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
-
<span class="bce-avatar bce-avatar--lg" role="img" aria-label="Alex Morgan">
|
|
3
|
-
<span class="bce-avatar__face">
|
|
4
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
5
|
-
</span>
|
|
6
|
-
</span>
|
|
7
|
-
<span class="bce-avatar bce-avatar--lg" role="img" aria-label="Alex Morgan">
|
|
8
|
-
<span class="bce-avatar__face">
|
|
9
|
-
<span class="bce-avatar__fallback" aria-hidden="true">
|
|
10
|
-
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
11
|
-
<circle cx="12" cy="8" r="4" />
|
|
12
|
-
<path d="M4 22c0-5 3-8 8-8s8 3 8 8" />
|
|
13
|
-
</svg>
|
|
14
|
-
</span>
|
|
15
|
-
</span>
|
|
16
|
-
</span>
|
|
17
|
-
<span class="bce-avatar bce-avatar--lg" role="img" aria-label="Alex Morgan">
|
|
18
|
-
<span class="bce-avatar__face">
|
|
19
|
-
<img class="bce-avatar__image" src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=160&h=160&fit=crop" alt="">
|
|
20
|
-
<span class="bce-avatar__fallback" aria-hidden="true">AM</span>
|
|
21
|
-
</span>
|
|
22
|
-
</span>
|
|
23
|
-
</div>
|