@ngneers/controls-themes 0.0.1-pre2
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/LICENSE +21 -0
- package/README.md +1 -0
- package/api/index.d.ts +17 -0
- package/api/index.d.ts.map +1 -0
- package/api/index.js +16 -0
- package/api/style/apply-theme.d.ts +33 -0
- package/api/style/apply-theme.d.ts.map +1 -0
- package/api/style/apply-theme.js +260 -0
- package/api/style/get-class-name.d.ts +2 -0
- package/api/style/get-class-name.d.ts.map +1 -0
- package/api/style/get-class-name.js +8 -0
- package/api/style/style-scope.d.ts +15 -0
- package/api/style/style-scope.d.ts.map +1 -0
- package/api/style/style-scope.js +0 -0
- package/api/style/upsert-theme-style-element.d.ts +2 -0
- package/api/style/upsert-theme-style-element.d.ts.map +1 -0
- package/api/style/upsert-theme-style-element.js +23 -0
- package/api/theme/classes.d.ts +10 -0
- package/api/theme/classes.d.ts.map +1 -0
- package/api/theme/classes.js +0 -0
- package/api/theme/combine-variable-variations.d.ts +10 -0
- package/api/theme/combine-variable-variations.d.ts.map +1 -0
- package/api/theme/combine-variable-variations.js +10 -0
- package/api/theme/combine-variations.d.ts +9 -0
- package/api/theme/combine-variations.d.ts.map +1 -0
- package/api/theme/combine-variations.js +9 -0
- package/api/theme/control-template.d.ts +14 -0
- package/api/theme/control-template.d.ts.map +1 -0
- package/api/theme/control-template.js +4 -0
- package/api/theme/css.d.ts +4 -0
- package/api/theme/css.d.ts.map +1 -0
- package/api/theme/css.js +1 -0
- package/api/theme/repeat-variables.d.ts +10 -0
- package/api/theme/repeat-variables.d.ts.map +1 -0
- package/api/theme/repeat-variables.js +9 -0
- package/api/theme/scoped.d.ts +4 -0
- package/api/theme/scoped.d.ts.map +1 -0
- package/api/theme/scoped.js +0 -0
- package/api/theme/template-variable.d.ts +4 -0
- package/api/theme/template-variable.d.ts.map +1 -0
- package/api/theme/template-variable.js +0 -0
- package/api/theme/theme-part.d.ts +31 -0
- package/api/theme/theme-part.d.ts.map +1 -0
- package/api/theme/theme-part.js +17 -0
- package/api/theme/theme.d.ts +14 -0
- package/api/theme/theme.d.ts.map +1 -0
- package/api/theme/theme.js +12 -0
- package/api/theme/variable-template.d.ts +14 -0
- package/api/theme/variable-template.d.ts.map +1 -0
- package/api/theme/variable-template.js +10 -0
- package/api/theme/variable.d.ts +9 -0
- package/api/theme/variable.d.ts.map +1 -0
- package/api/theme/variable.js +2 -0
- package/api/utils/deep-keys.d.ts +6 -0
- package/api/utils/deep-keys.d.ts.map +1 -0
- package/api/utils/deep-keys.js +0 -0
- package/api/utils/deep-merge.d.ts +7 -0
- package/api/utils/deep-merge.d.ts.map +1 -0
- package/api/utils/deep-merge.js +20 -0
- package/api/utils/deep-set.d.ts +2 -0
- package/api/utils/deep-set.d.ts.map +1 -0
- package/api/utils/deep-set.js +15 -0
- package/api/utils/group-array-using.d.ts +2 -0
- package/api/utils/group-array-using.d.ts.map +1 -0
- package/api/utils/group-array-using.js +11 -0
- package/api/utils/sub-key.d.ts +3 -0
- package/api/utils/sub-key.d.ts.map +1 -0
- package/api/utils/sub-key.js +5 -0
- package/api/utils/union-to-intersection.d.ts +2 -0
- package/api/utils/union-to-intersection.d.ts.map +1 -0
- package/api/utils/union-to-intersection.js +0 -0
- package/base/accordion/index.d.ts +2 -0
- package/base/accordion/index.d.ts.map +1 -0
- package/base/accordion/index.js +9 -0
- package/base/accordion-panel/index.d.ts +2 -0
- package/base/accordion-panel/index.d.ts.map +1 -0
- package/base/accordion-panel/index.js +43 -0
- package/base/api/index.d.ts +3 -0
- package/base/api/index.d.ts.map +1 -0
- package/base/api/index.js +2 -0
- package/base/api/movable.d.ts +2 -0
- package/base/api/movable.d.ts.map +1 -0
- package/base/api/movable.js +13 -0
- package/base/api/resizable.d.ts +2 -0
- package/base/api/resizable.d.ts.map +1 -0
- package/base/api/resizable.js +13 -0
- package/base/avatar/index.d.ts +151 -0
- package/base/avatar/index.d.ts.map +1 -0
- package/base/avatar/index.js +41 -0
- package/base/breadcrumb/index.d.ts +2 -0
- package/base/breadcrumb/index.d.ts.map +1 -0
- package/base/breadcrumb/index.js +26 -0
- package/base/button/index.d.ts +2 -0
- package/base/button/index.d.ts.map +1 -0
- package/base/button/index.js +13 -0
- package/base/button-group/index.d.ts +2 -0
- package/base/button-group/index.d.ts.map +1 -0
- package/base/button-group/index.js +30 -0
- package/base/calendar/index.d.ts +2 -0
- package/base/calendar/index.d.ts.map +1 -0
- package/base/calendar/index.js +69 -0
- package/base/checkbox/index.d.ts +2 -0
- package/base/checkbox/index.d.ts.map +1 -0
- package/base/checkbox/index.js +35 -0
- package/base/chip/index.d.ts +2 -0
- package/base/chip/index.d.ts.map +1 -0
- package/base/chip/index.js +19 -0
- package/base/colors/index.d.ts +24 -0
- package/base/colors/index.d.ts.map +1 -0
- package/base/colors/index.js +112 -0
- package/base/dialog/index.d.ts +2 -0
- package/base/dialog/index.d.ts.map +1 -0
- package/base/dialog/index.js +36 -0
- package/base/drawer/index.d.ts +2 -0
- package/base/drawer/index.d.ts.map +1 -0
- package/base/drawer/index.js +35 -0
- package/base/edit-inplace/index.d.ts +2 -0
- package/base/edit-inplace/index.d.ts.map +1 -0
- package/base/edit-inplace/index.js +7 -0
- package/base/filter/index.d.ts +2 -0
- package/base/filter/index.d.ts.map +1 -0
- package/base/filter/index.js +52 -0
- package/base/global/index.d.ts +2 -0
- package/base/global/index.d.ts.map +1 -0
- package/base/global/index.js +25 -0
- package/base/icon/index.d.ts +2 -0
- package/base/icon/index.d.ts.map +1 -0
- package/base/icon/index.js +32 -0
- package/base/index.d.ts +368 -0
- package/base/index.d.ts.map +1 -0
- package/base/index.js +86 -0
- package/base/inplace/index.d.ts +2 -0
- package/base/inplace/index.d.ts.map +1 -0
- package/base/inplace/index.js +7 -0
- package/base/input/index.d.ts +2 -0
- package/base/input/index.d.ts.map +1 -0
- package/base/input/index.js +20 -0
- package/base/input-field/index.d.ts +2 -0
- package/base/input-field/index.d.ts.map +1 -0
- package/base/input-field/index.js +45 -0
- package/base/input-mask/index.d.ts +2 -0
- package/base/input-mask/index.d.ts.map +1 -0
- package/base/input-mask/index.js +24 -0
- package/base/item-view/index.d.ts +2 -0
- package/base/item-view/index.d.ts.map +1 -0
- package/base/item-view/index.js +44 -0
- package/base/list-box/index.d.ts +2 -0
- package/base/list-box/index.d.ts.map +1 -0
- package/base/list-box/index.js +29 -0
- package/base/menu/index.d.ts +2 -0
- package/base/menu/index.d.ts.map +1 -0
- package/base/menu/index.js +19 -0
- package/base/message/index.d.ts +2 -0
- package/base/message/index.d.ts.map +1 -0
- package/base/message/index.js +23 -0
- package/base/paginator/index.d.ts +2 -0
- package/base/paginator/index.d.ts.map +1 -0
- package/base/paginator/index.js +16 -0
- package/base/popover/index.d.ts +2 -0
- package/base/popover/index.d.ts.map +1 -0
- package/base/popover/index.js +43 -0
- package/base/progress/index.d.ts +2 -0
- package/base/progress/index.d.ts.map +1 -0
- package/base/progress/index.js +41 -0
- package/base/scroller/index.d.ts +2 -0
- package/base/scroller/index.d.ts.map +1 -0
- package/base/scroller/index.js +39 -0
- package/base/select/index.d.ts +2 -0
- package/base/select/index.d.ts.map +1 -0
- package/base/select/index.js +34 -0
- package/base/select-button/index.d.ts +2 -0
- package/base/select-button/index.d.ts.map +1 -0
- package/base/select-button/index.js +13 -0
- package/base/slider/index.d.ts +2 -0
- package/base/slider/index.d.ts.map +1 -0
- package/base/slider/index.js +65 -0
- package/base/spinner/index.d.ts +2 -0
- package/base/spinner/index.d.ts.map +1 -0
- package/base/spinner/index.js +29 -0
- package/base/splitter/index.d.ts +2 -0
- package/base/splitter/index.d.ts.map +1 -0
- package/base/splitter/index.js +58 -0
- package/base/switch/index.d.ts +2 -0
- package/base/switch/index.d.ts.map +1 -0
- package/base/switch/index.js +30 -0
- package/base/table/index.d.ts +15 -0
- package/base/table/index.d.ts.map +1 -0
- package/base/table/index.js +75 -0
- package/base/tabs/index.d.ts +2 -0
- package/base/tabs/index.d.ts.map +1 -0
- package/base/tabs/index.js +68 -0
- package/base/tag/index.d.ts +2 -0
- package/base/tag/index.d.ts.map +1 -0
- package/base/tag/index.js +23 -0
- package/base/toast/index.d.ts +2 -0
- package/base/toast/index.d.ts.map +1 -0
- package/base/toast/index.js +25 -0
- package/base/toggle-button/index.d.ts +2 -0
- package/base/toggle-button/index.d.ts.map +1 -0
- package/base/toggle-button/index.js +33 -0
- package/base/tooltip/index.d.ts +2 -0
- package/base/tooltip/index.d.ts.map +1 -0
- package/base/tooltip/index.js +85 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +2 -0
- package/nova/accordion/index.d.ts +150 -0
- package/nova/accordion/index.d.ts.map +1 -0
- package/nova/accordion/index.js +19 -0
- package/nova/accordion-panel/index.d.ts +150 -0
- package/nova/accordion-panel/index.d.ts.map +1 -0
- package/nova/accordion-panel/index.js +74 -0
- package/nova/api/index.d.ts +3 -0
- package/nova/api/index.d.ts.map +1 -0
- package/nova/api/index.js +2 -0
- package/nova/api/movable.d.ts +2 -0
- package/nova/api/movable.d.ts.map +1 -0
- package/nova/api/movable.js +18 -0
- package/nova/api/resizable.d.ts +2 -0
- package/nova/api/resizable.d.ts.map +1 -0
- package/nova/api/resizable.js +13 -0
- package/nova/avatar/index.d.ts +299 -0
- package/nova/avatar/index.d.ts.map +1 -0
- package/nova/avatar/index.js +48 -0
- package/nova/base/animation.d.ts +21 -0
- package/nova/base/animation.d.ts.map +1 -0
- package/nova/base/animation.js +30 -0
- package/nova/base/colors.d.ts +244 -0
- package/nova/base/colors.d.ts.map +1 -0
- package/nova/base/colors.js +100 -0
- package/nova/base/font.d.ts +37 -0
- package/nova/base/font.d.ts.map +1 -0
- package/nova/base/font.js +46 -0
- package/nova/base/index.d.ts +6 -0
- package/nova/base/index.d.ts.map +1 -0
- package/nova/base/index.js +5 -0
- package/nova/base/shadow.d.ts +13 -0
- package/nova/base/shadow.d.ts.map +1 -0
- package/nova/base/shadow.js +22 -0
- package/nova/base/sizes.d.ts +29 -0
- package/nova/base/sizes.d.ts.map +1 -0
- package/nova/base/sizes.js +38 -0
- package/nova/breadcrumb/index.d.ts +150 -0
- package/nova/breadcrumb/index.d.ts.map +1 -0
- package/nova/breadcrumb/index.js +45 -0
- package/nova/button/index.d.ts +150 -0
- package/nova/button/index.d.ts.map +1 -0
- package/nova/button/index.js +105 -0
- package/nova/button-group/index.d.ts +150 -0
- package/nova/button-group/index.d.ts.map +1 -0
- package/nova/button-group/index.js +59 -0
- package/nova/calendar/index.d.ts +150 -0
- package/nova/calendar/index.d.ts.map +1 -0
- package/nova/calendar/index.js +98 -0
- package/nova/checkbox/index.d.ts +142 -0
- package/nova/checkbox/index.d.ts.map +1 -0
- package/nova/checkbox/index.js +65 -0
- package/nova/chip/index.d.ts +150 -0
- package/nova/chip/index.d.ts.map +1 -0
- package/nova/chip/index.js +78 -0
- package/nova/colors/index.d.ts +27 -0
- package/nova/colors/index.d.ts.map +1 -0
- package/nova/colors/index.js +18 -0
- package/nova/dialog/index.d.ts +155 -0
- package/nova/dialog/index.d.ts.map +1 -0
- package/nova/dialog/index.js +40 -0
- package/nova/drawer/index.d.ts +164 -0
- package/nova/drawer/index.d.ts.map +1 -0
- package/nova/drawer/index.js +77 -0
- package/nova/edit-inplace/index.d.ts +133 -0
- package/nova/edit-inplace/index.d.ts.map +1 -0
- package/nova/edit-inplace/index.js +48 -0
- package/nova/filter/index.d.ts +133 -0
- package/nova/filter/index.d.ts.map +1 -0
- package/nova/filter/index.js +52 -0
- package/nova/icon/index.d.ts +120 -0
- package/nova/icon/index.d.ts.map +1 -0
- package/nova/icon/index.js +12 -0
- package/nova/index.d.ts +5678 -0
- package/nova/index.d.ts.map +1 -0
- package/nova/index.js +108 -0
- package/nova/inplace/index.d.ts +133 -0
- package/nova/inplace/index.d.ts.map +1 -0
- package/nova/inplace/index.js +29 -0
- package/nova/input/index.d.ts +133 -0
- package/nova/input/index.d.ts.map +1 -0
- package/nova/input/index.js +12 -0
- package/nova/input-field/index.d.ts +159 -0
- package/nova/input-field/index.d.ts.map +1 -0
- package/nova/input-field/index.js +247 -0
- package/nova/input-mask/index.d.ts +133 -0
- package/nova/input-mask/index.d.ts.map +1 -0
- package/nova/input-mask/index.js +23 -0
- package/nova/item-view/index.d.ts +133 -0
- package/nova/item-view/index.d.ts.map +1 -0
- package/nova/item-view/index.js +16 -0
- package/nova/list-box/index.d.ts +150 -0
- package/nova/list-box/index.d.ts.map +1 -0
- package/nova/list-box/index.js +71 -0
- package/nova/menu/index.d.ts +133 -0
- package/nova/menu/index.d.ts.map +1 -0
- package/nova/menu/index.js +62 -0
- package/nova/message/index.d.ts +150 -0
- package/nova/message/index.d.ts.map +1 -0
- package/nova/message/index.js +46 -0
- package/nova/paginator/index.d.ts +133 -0
- package/nova/paginator/index.d.ts.map +1 -0
- package/nova/paginator/index.js +19 -0
- package/nova/popover/index.d.ts +147 -0
- package/nova/popover/index.d.ts.map +1 -0
- package/nova/popover/index.js +65 -0
- package/nova/progress/index.d.ts +142 -0
- package/nova/progress/index.d.ts.map +1 -0
- package/nova/progress/index.js +84 -0
- package/nova/scroller/index.d.ts +133 -0
- package/nova/scroller/index.d.ts.map +1 -0
- package/nova/scroller/index.js +12 -0
- package/nova/select/index.d.ts +133 -0
- package/nova/select/index.d.ts.map +1 -0
- package/nova/select/index.js +39 -0
- package/nova/select-button/index.d.ts +133 -0
- package/nova/select-button/index.d.ts.map +1 -0
- package/nova/select-button/index.js +17 -0
- package/nova/slider/index.d.ts +133 -0
- package/nova/slider/index.d.ts.map +1 -0
- package/nova/slider/index.js +98 -0
- package/nova/spinner/index.d.ts +133 -0
- package/nova/spinner/index.d.ts.map +1 -0
- package/nova/spinner/index.js +57 -0
- package/nova/splitter/index.d.ts +120 -0
- package/nova/splitter/index.d.ts.map +1 -0
- package/nova/splitter/index.js +37 -0
- package/nova/switch/index.d.ts +142 -0
- package/nova/switch/index.d.ts.map +1 -0
- package/nova/switch/index.js +61 -0
- package/nova/table/index.d.ts +150 -0
- package/nova/table/index.d.ts.map +1 -0
- package/nova/table/index.js +63 -0
- package/nova/tabs/index.d.ts +150 -0
- package/nova/tabs/index.d.ts.map +1 -0
- package/nova/tabs/index.js +80 -0
- package/nova/tag/index.d.ts +150 -0
- package/nova/tag/index.d.ts.map +1 -0
- package/nova/tag/index.js +34 -0
- package/nova/toast/index.d.ts +159 -0
- package/nova/toast/index.d.ts.map +1 -0
- package/nova/toast/index.js +92 -0
- package/nova/toggle-button/index.d.ts +159 -0
- package/nova/toggle-button/index.d.ts.map +1 -0
- package/nova/toggle-button/index.js +65 -0
- package/nova/tooltip/index.d.ts +142 -0
- package/nova/tooltip/index.d.ts.map +1 -0
- package/nova/tooltip/index.js +53 -0
- package/package.json +519 -0
- package/templates/accordion/index.d.ts +2 -0
- package/templates/accordion/index.d.ts.map +1 -0
- package/templates/accordion/index.js +5 -0
- package/templates/accordion-panel/index.d.ts +2 -0
- package/templates/accordion-panel/index.d.ts.map +1 -0
- package/templates/accordion-panel/index.js +13 -0
- package/templates/api/index.d.ts +3 -0
- package/templates/api/index.d.ts.map +1 -0
- package/templates/api/index.js +2 -0
- package/templates/api/movable.d.ts +2 -0
- package/templates/api/movable.d.ts.map +1 -0
- package/templates/api/movable.js +5 -0
- package/templates/api/resizable.d.ts +2 -0
- package/templates/api/resizable.d.ts.map +1 -0
- package/templates/api/resizable.js +5 -0
- package/templates/avatar/index.d.ts +3 -0
- package/templates/avatar/index.d.ts.map +1 -0
- package/templates/avatar/index.js +10 -0
- package/templates/breadcrumb/index.d.ts +2 -0
- package/templates/breadcrumb/index.d.ts.map +1 -0
- package/templates/breadcrumb/index.js +8 -0
- package/templates/button/index.d.ts +2 -0
- package/templates/button/index.d.ts.map +1 -0
- package/templates/button/index.js +5 -0
- package/templates/button-group/index.d.ts +2 -0
- package/templates/button-group/index.d.ts.map +1 -0
- package/templates/button-group/index.js +8 -0
- package/templates/calendar/index.d.ts +2 -0
- package/templates/calendar/index.d.ts.map +1 -0
- package/templates/calendar/index.js +36 -0
- package/templates/checkbox/index.d.ts +2 -0
- package/templates/checkbox/index.d.ts.map +1 -0
- package/templates/checkbox/index.js +15 -0
- package/templates/chip/index.d.ts +2 -0
- package/templates/chip/index.d.ts.map +1 -0
- package/templates/chip/index.js +13 -0
- package/templates/dialog/index.d.ts +2 -0
- package/templates/dialog/index.d.ts.map +1 -0
- package/templates/dialog/index.js +16 -0
- package/templates/drawer/index.d.ts +2 -0
- package/templates/drawer/index.d.ts.map +1 -0
- package/templates/drawer/index.js +15 -0
- package/templates/edit-inplace/index.d.ts +2 -0
- package/templates/edit-inplace/index.d.ts.map +1 -0
- package/templates/edit-inplace/index.js +17 -0
- package/templates/filter/index.d.ts +2 -0
- package/templates/filter/index.d.ts.map +1 -0
- package/templates/filter/index.js +31 -0
- package/templates/global/index.d.ts +2 -0
- package/templates/global/index.d.ts.map +1 -0
- package/templates/global/index.js +5 -0
- package/templates/icon/index.d.ts +2 -0
- package/templates/icon/index.d.ts.map +1 -0
- package/templates/icon/index.js +5 -0
- package/templates/index.d.ts +46 -0
- package/templates/index.d.ts.map +1 -0
- package/templates/index.js +0 -0
- package/templates/inplace/index.d.ts +2 -0
- package/templates/inplace/index.d.ts.map +1 -0
- package/templates/inplace/index.js +5 -0
- package/templates/input/index.d.ts +3 -0
- package/templates/input/index.d.ts.map +1 -0
- package/templates/input/index.js +6 -0
- package/templates/input-field/index.d.ts +2 -0
- package/templates/input-field/index.d.ts.map +1 -0
- package/templates/input-field/index.js +16 -0
- package/templates/input-mask/index.d.ts +3 -0
- package/templates/input-mask/index.d.ts.map +1 -0
- package/templates/input-mask/index.js +9 -0
- package/templates/item-view/index.d.ts +2 -0
- package/templates/item-view/index.d.ts.map +1 -0
- package/templates/item-view/index.js +13 -0
- package/templates/list-box/index.d.ts +2 -0
- package/templates/list-box/index.d.ts.map +1 -0
- package/templates/list-box/index.js +19 -0
- package/templates/menu/index.d.ts +2 -0
- package/templates/menu/index.d.ts.map +1 -0
- package/templates/menu/index.js +7 -0
- package/templates/message/index.d.ts +2 -0
- package/templates/message/index.d.ts.map +1 -0
- package/templates/message/index.js +5 -0
- package/templates/paginator/index.d.ts +2 -0
- package/templates/paginator/index.d.ts.map +1 -0
- package/templates/paginator/index.js +8 -0
- package/templates/popover/index.d.ts +2 -0
- package/templates/popover/index.d.ts.map +1 -0
- package/templates/popover/index.js +5 -0
- package/templates/progress/index.d.ts +2 -0
- package/templates/progress/index.d.ts.map +1 -0
- package/templates/progress/index.js +5 -0
- package/templates/scroller/index.d.ts +2 -0
- package/templates/scroller/index.d.ts.map +1 -0
- package/templates/scroller/index.js +5 -0
- package/templates/select/index.d.ts +2 -0
- package/templates/select/index.d.ts.map +1 -0
- package/templates/select/index.js +20 -0
- package/templates/select-button/index.d.ts +2 -0
- package/templates/select-button/index.d.ts.map +1 -0
- package/templates/select-button/index.js +5 -0
- package/templates/slider/index.d.ts +2 -0
- package/templates/slider/index.d.ts.map +1 -0
- package/templates/slider/index.js +5 -0
- package/templates/spinner/index.d.ts +2 -0
- package/templates/spinner/index.d.ts.map +1 -0
- package/templates/spinner/index.js +5 -0
- package/templates/splitter/index.d.ts +2 -0
- package/templates/splitter/index.d.ts.map +1 -0
- package/templates/splitter/index.js +14 -0
- package/templates/switch/index.d.ts +2 -0
- package/templates/switch/index.d.ts.map +1 -0
- package/templates/switch/index.js +5 -0
- package/templates/table/index.d.ts +2 -0
- package/templates/table/index.d.ts.map +1 -0
- package/templates/table/index.js +35 -0
- package/templates/tabs/index.d.ts +2 -0
- package/templates/tabs/index.d.ts.map +1 -0
- package/templates/tabs/index.js +15 -0
- package/templates/tag/index.d.ts +2 -0
- package/templates/tag/index.d.ts.map +1 -0
- package/templates/tag/index.js +5 -0
- package/templates/toast/index.d.ts +2 -0
- package/templates/toast/index.d.ts.map +1 -0
- package/templates/toast/index.js +14 -0
- package/templates/toggle-button/index.d.ts +2 -0
- package/templates/toggle-button/index.d.ts.map +1 -0
- package/templates/toggle-button/index.js +6 -0
- package/templates/tooltip/index.d.ts +2 -0
- package/templates/tooltip/index.d.ts.map +1 -0
- package/templates/tooltip/index.js +20 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 NGneers
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @ngneers/controls-themes
|
package/api/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './style/apply-theme';
|
|
2
|
+
export * from './style/get-class-name';
|
|
3
|
+
export * from './style/style-scope';
|
|
4
|
+
export * from './style/upsert-theme-style-element';
|
|
5
|
+
export * from './theme/classes';
|
|
6
|
+
export * from './theme/combine-variable-variations';
|
|
7
|
+
export * from './theme/combine-variations';
|
|
8
|
+
export * from './theme/control-template';
|
|
9
|
+
export * from './theme/css';
|
|
10
|
+
export * from './theme/repeat-variables';
|
|
11
|
+
export * from './theme/scoped';
|
|
12
|
+
export * from './theme/template-variable';
|
|
13
|
+
export * from './theme/theme';
|
|
14
|
+
export * from './theme/theme-part';
|
|
15
|
+
export * from './theme/variable';
|
|
16
|
+
export * from './theme/variable-template';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC"}
|
package/api/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './style/apply-theme';
|
|
2
|
+
export * from './style/get-class-name';
|
|
3
|
+
export * from './style/style-scope';
|
|
4
|
+
export * from './style/upsert-theme-style-element';
|
|
5
|
+
export * from './theme/classes';
|
|
6
|
+
export * from './theme/combine-variable-variations';
|
|
7
|
+
export * from './theme/combine-variations';
|
|
8
|
+
export * from './theme/control-template';
|
|
9
|
+
export * from './theme/css';
|
|
10
|
+
export * from './theme/repeat-variables';
|
|
11
|
+
export * from './theme/scoped';
|
|
12
|
+
export * from './theme/template-variable';
|
|
13
|
+
export * from './theme/theme';
|
|
14
|
+
export * from './theme/theme-part';
|
|
15
|
+
export * from './theme/variable';
|
|
16
|
+
export * from './theme/variable-template';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type StyleScope } from './style-scope';
|
|
2
|
+
import { type Theme } from '../theme/theme';
|
|
3
|
+
import { type ThemePart } from '../theme/theme-part';
|
|
4
|
+
export type ApplyThemeOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* The document to apply the theme to. Defaults to `window.document`.
|
|
7
|
+
* This is useful for server-side rendering or when you want to apply the theme to a
|
|
8
|
+
* specific document instance.
|
|
9
|
+
* @default `window.document`
|
|
10
|
+
*/
|
|
11
|
+
document: Document;
|
|
12
|
+
/**
|
|
13
|
+
* The CSS layer to apply the theme to.
|
|
14
|
+
* If not provided, the theme will be applied to the default layer.
|
|
15
|
+
* @default `undefined`
|
|
16
|
+
*/
|
|
17
|
+
layer?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Defines whether the theme should be applied globally or scoped to a specific element.
|
|
20
|
+
* If not provided, the theme will be applied globally.
|
|
21
|
+
* @default `undefined`
|
|
22
|
+
*/
|
|
23
|
+
styleScope?: StyleScope;
|
|
24
|
+
/**
|
|
25
|
+
* A prefix to add to the class names and CSS variables of the theme parts.
|
|
26
|
+
* This is useful for avoiding name collisions in the global scope.
|
|
27
|
+
* @default `'ngn-'`
|
|
28
|
+
*/
|
|
29
|
+
namePrefix: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function applyTheme<T extends Theme>(theme: T, scopes: T['parts'][number]['scope'][], options: ApplyThemeOptions): void;
|
|
32
|
+
export declare function applyGlobalStyles(globalStyles: ThemePart, options: ApplyThemeOptions): void;
|
|
33
|
+
//# sourceMappingURL=apply-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-theme.d.ts","sourceRoot":"","sources":["../../../../src/api/style/apply-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,SAAS,KAAK,EACxC,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,EACrC,OAAO,EAAE,iBAAiB,QA0C3B;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,QA2BpF"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { getClassName } from './get-class-name';
|
|
2
|
+
import {} from './style-scope';
|
|
3
|
+
import { upsertThemeStyleElement } from './upsert-theme-style-element';
|
|
4
|
+
import {} from '../theme/theme';
|
|
5
|
+
import {} from '../theme/theme-part';
|
|
6
|
+
import { groupArrayUsing } from '../utils/group-array-using';
|
|
7
|
+
export function applyTheme(theme, scopes, options) {
|
|
8
|
+
const opt = {
|
|
9
|
+
document: options.document ?? window.document,
|
|
10
|
+
layer: options.layer,
|
|
11
|
+
scope: options.styleScope,
|
|
12
|
+
namePrefix: options.namePrefix ?? 'ngn-',
|
|
13
|
+
};
|
|
14
|
+
const parts = groupArrayUsing(getThemePartsByScopes(theme, scopes), x => x.scope);
|
|
15
|
+
// variable style elements
|
|
16
|
+
for (const [scope, scopeParts] of parts) {
|
|
17
|
+
const css = buildVariablesCss(scopeParts, opt);
|
|
18
|
+
upsertThemeStyleElement(opt.document, {
|
|
19
|
+
kind: 'variables',
|
|
20
|
+
'theme-scope': scope,
|
|
21
|
+
'style-scope': styleScopeToIdentifier(opt.scope),
|
|
22
|
+
}, css);
|
|
23
|
+
}
|
|
24
|
+
// style element
|
|
25
|
+
const allParts = scopes.map(scope => parts.get(scope) ?? scope);
|
|
26
|
+
for (const part of allParts) {
|
|
27
|
+
if (typeof part === 'string') {
|
|
28
|
+
console.warn(`No theme parts found for scope '${part}'. Skipping style generation.`);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const css = buildStyleCss(part, opt);
|
|
32
|
+
upsertThemeStyleElement(opt.document, {
|
|
33
|
+
kind: 'styles',
|
|
34
|
+
'theme-scope': part[0]?.scope,
|
|
35
|
+
'style-scope': styleScopeToIdentifier(opt.scope),
|
|
36
|
+
}, css);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function applyGlobalStyles(globalStyles, options) {
|
|
40
|
+
const opt = {
|
|
41
|
+
document: options.document ?? window.document,
|
|
42
|
+
layer: options.layer,
|
|
43
|
+
scope: options.styleScope,
|
|
44
|
+
namePrefix: options.namePrefix ?? 'ngn-',
|
|
45
|
+
};
|
|
46
|
+
const cssVariables = buildVariablesCss([globalStyles], opt);
|
|
47
|
+
upsertThemeStyleElement(opt.document, {
|
|
48
|
+
kind: 'variables',
|
|
49
|
+
'theme-scope': globalStyles.scope,
|
|
50
|
+
'style-scope': styleScopeToIdentifier(opt.scope),
|
|
51
|
+
}, cssVariables);
|
|
52
|
+
const cssStyles = buildStyleCss([globalStyles], opt);
|
|
53
|
+
upsertThemeStyleElement(opt.document, {
|
|
54
|
+
kind: 'styles',
|
|
55
|
+
'theme-scope': globalStyles.scope,
|
|
56
|
+
'style-scope': styleScopeToIdentifier(opt.scope),
|
|
57
|
+
}, cssStyles);
|
|
58
|
+
}
|
|
59
|
+
function styleScopeToIdentifier(scope) {
|
|
60
|
+
if (!scope)
|
|
61
|
+
return undefined;
|
|
62
|
+
switch (scope.kind) {
|
|
63
|
+
case 'attribute':
|
|
64
|
+
return `attr:${scope.name}${scope.value ? `:${scope.value}` : ''}`;
|
|
65
|
+
case 'class':
|
|
66
|
+
return `class:${scope.name}`;
|
|
67
|
+
case 'id':
|
|
68
|
+
return `id:${scope.name}`;
|
|
69
|
+
case 'tag':
|
|
70
|
+
return `tag:${scope.name}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function getThemePartsByScopes(theme, scopes) {
|
|
74
|
+
const result = new Set();
|
|
75
|
+
for (const scope of scopes) {
|
|
76
|
+
collectThemeParts(theme, scope, result);
|
|
77
|
+
}
|
|
78
|
+
return Array.from(result);
|
|
79
|
+
}
|
|
80
|
+
function collectThemeParts(theme, scope, result = new Set()) {
|
|
81
|
+
for (const part of theme.parts) {
|
|
82
|
+
if (part.scope !== scope || result.has(part)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
result.add(part);
|
|
86
|
+
for (const dep of part.dependencies ?? []) {
|
|
87
|
+
collectThemeParts(theme, dep.scope, result);
|
|
88
|
+
}
|
|
89
|
+
if (part.base) {
|
|
90
|
+
for (const dep of part.base.dependencies ?? []) {
|
|
91
|
+
collectThemeParts(theme, dep.scope, result);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
function buildVariablesCss(parts, options) {
|
|
98
|
+
const cssParts = parts.map(part => ({
|
|
99
|
+
root: variableCssFromVariableDefinition(part.root?.values, options, part.scope),
|
|
100
|
+
light: variableCssFromVariableDefinition(part.light?.values, options, part.scope),
|
|
101
|
+
dark: variableCssFromVariableDefinition(part.dark?.values, options, part.scope),
|
|
102
|
+
highContrast: variableCssFromVariableDefinition(part.highContrast?.values, options, part.scope),
|
|
103
|
+
}));
|
|
104
|
+
let css = options.layer ? `@layer ${options.layer} { ` : '';
|
|
105
|
+
css += `${getScopeSelector(options.styleScope)} { `;
|
|
106
|
+
for (const { root, dark } of cssParts) {
|
|
107
|
+
if (root) {
|
|
108
|
+
css += root;
|
|
109
|
+
}
|
|
110
|
+
if (dark) {
|
|
111
|
+
// check for special 'dark' class on body
|
|
112
|
+
css += `&.dark { ${dark} }`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// TODO: light, dark and highContrast themes
|
|
116
|
+
// TODO: Special handling for @media, @container, ... for scoping
|
|
117
|
+
css += ' }';
|
|
118
|
+
if (options.layer)
|
|
119
|
+
css += ' }';
|
|
120
|
+
return css;
|
|
121
|
+
}
|
|
122
|
+
function variableCssFromVariableDefinition(content, options, scope) {
|
|
123
|
+
if (typeof content !== 'object')
|
|
124
|
+
return '';
|
|
125
|
+
let result = '';
|
|
126
|
+
for (const key in content) {
|
|
127
|
+
const value = content[key];
|
|
128
|
+
if (!value)
|
|
129
|
+
continue;
|
|
130
|
+
if (typeof value === 'object') {
|
|
131
|
+
result += variableCssFromVariableDefinition(value, options, `${scope}-${key}`);
|
|
132
|
+
}
|
|
133
|
+
else if (typeof value === 'string') {
|
|
134
|
+
const varName = getCssVar(options.namePrefix, `${scope}.${key}`);
|
|
135
|
+
if (value.startsWith('{') && value.endsWith('}')) {
|
|
136
|
+
result += `${varName}: var(${getCssVar(options.namePrefix, value.slice(1, -1))});`;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
result += `${varName}: ${value};`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
function buildStyleCss(parts, options, isBase = false) {
|
|
146
|
+
const varKeySelector = (key) => `var(${getCssVar(options.namePrefix, key)})`;
|
|
147
|
+
const cssParts = parts.map(part => {
|
|
148
|
+
if (!part.root?.css && !part.light?.css && !part.dark?.css && !part.highContrast?.css) {
|
|
149
|
+
return {};
|
|
150
|
+
}
|
|
151
|
+
// Create a selector for unstyled mode. To avoid specificity issues, we use a always-true selector
|
|
152
|
+
// for when unstyled mode is active.
|
|
153
|
+
const unstyledSelector = `:not(${isBase ? '.ngn-css-specificity' : '.ngn-unstyled'})`;
|
|
154
|
+
const args = {
|
|
155
|
+
v: (key) => varKeySelector(key),
|
|
156
|
+
c: (className, kind = 'class') => {
|
|
157
|
+
const prefix = kind === 'animation' ? '' : '.';
|
|
158
|
+
const unstyledSuffix = kind === 'animation' ? '' : unstyledSelector;
|
|
159
|
+
return `${prefix}${getClassName(options.namePrefix, part.scope, className)}${unstyledSuffix}`;
|
|
160
|
+
},
|
|
161
|
+
d: (scope, className) => {
|
|
162
|
+
return `.${getClassName(options.namePrefix, scope, className)}${unstyledSelector}`;
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
return {
|
|
166
|
+
root: part.root?.css?.(args),
|
|
167
|
+
light: part.light?.css?.(args),
|
|
168
|
+
dark: part.dark?.css?.(args),
|
|
169
|
+
highContrast: part.highContrast?.css?.(args),
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
let css = options.layer ? `@layer ${options.layer} { ` : '';
|
|
173
|
+
const baseCss = parts
|
|
174
|
+
.filter(p => p.base)
|
|
175
|
+
.map(part => {
|
|
176
|
+
const base = part.base;
|
|
177
|
+
return buildStyleCss([base], { ...options, layer: undefined }, true);
|
|
178
|
+
});
|
|
179
|
+
if (baseCss.length > 0) {
|
|
180
|
+
css += baseCss.join('\n');
|
|
181
|
+
}
|
|
182
|
+
css += `${getScopeSelector(options.styleScope)} { `;
|
|
183
|
+
let unscopableCss = '';
|
|
184
|
+
for (const { root, dark } of cssParts) {
|
|
185
|
+
if (root) {
|
|
186
|
+
const { unscopable, scopable } = splitScopableCss(root);
|
|
187
|
+
css += scopable;
|
|
188
|
+
unscopableCss += unscopable;
|
|
189
|
+
}
|
|
190
|
+
if (dark) {
|
|
191
|
+
const { unscopable, scopable } = splitScopableCss(dark);
|
|
192
|
+
// check for special 'dark' class on body
|
|
193
|
+
css += `&.dark { ${scopable} }`;
|
|
194
|
+
if (unscopable) {
|
|
195
|
+
console.warn('Unscopable CSS inside dark theme is not supported and will be ignored:', unscopable);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// TODO: light, dark and highContrast themes
|
|
200
|
+
// TODO: Special handling for @media, @container, ... for scoping
|
|
201
|
+
css += ' }';
|
|
202
|
+
css += unscopableCss;
|
|
203
|
+
if (options.layer)
|
|
204
|
+
css += ' }';
|
|
205
|
+
return css;
|
|
206
|
+
}
|
|
207
|
+
function getScopeSelector(scope) {
|
|
208
|
+
if (!scope) {
|
|
209
|
+
return ':root';
|
|
210
|
+
}
|
|
211
|
+
switch (scope.kind) {
|
|
212
|
+
case 'attribute':
|
|
213
|
+
return `[${scope.name}${scope.value ? `="${scope.value}"` : ''}]`;
|
|
214
|
+
case 'class':
|
|
215
|
+
return `.${scope.name}`;
|
|
216
|
+
case 'id':
|
|
217
|
+
return `#${scope.name}`;
|
|
218
|
+
case 'tag':
|
|
219
|
+
return scope.name;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function getCssVar(prefix, key) {
|
|
223
|
+
// Replace dots with dashes and convert camelCase to kebab-case
|
|
224
|
+
const varName = key
|
|
225
|
+
.replace(/\./g, '-')
|
|
226
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
227
|
+
.toLowerCase();
|
|
228
|
+
return `--${prefix}${varName}`;
|
|
229
|
+
}
|
|
230
|
+
function splitScopableCss(css) {
|
|
231
|
+
let depth = 0;
|
|
232
|
+
let result = {
|
|
233
|
+
scopable: '',
|
|
234
|
+
unscopable: '',
|
|
235
|
+
};
|
|
236
|
+
let start = 0;
|
|
237
|
+
let kind = 'scopable';
|
|
238
|
+
for (let i = 0; i < css.length; i++) {
|
|
239
|
+
const char = css[i];
|
|
240
|
+
// @MaSch0212 review the `!depth` condition here, some queries are allowed inside scopable css
|
|
241
|
+
if (!depth && char === '@' && (!css[i - 1] || css[i - 1] === ' ') && kind === 'scopable') {
|
|
242
|
+
result.scopable += css.slice(start, i - 1);
|
|
243
|
+
start = i;
|
|
244
|
+
kind = 'unscopable';
|
|
245
|
+
}
|
|
246
|
+
else if (char === '{') {
|
|
247
|
+
depth++;
|
|
248
|
+
}
|
|
249
|
+
else if (char === '}') {
|
|
250
|
+
depth--;
|
|
251
|
+
if (depth === 0 && kind === 'unscopable') {
|
|
252
|
+
result.unscopable += css.slice(start, i + 1);
|
|
253
|
+
start = i + 1;
|
|
254
|
+
kind = 'scopable';
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
result[kind] += css.slice(start);
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-class-name.d.ts","sourceRoot":"","sources":["../../../../src/api/style/get-class-name.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,OAAO,GACjB,MAAM,CAKR"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type StyleScope = {
|
|
2
|
+
kind: 'attribute';
|
|
3
|
+
name: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'class';
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'id';
|
|
10
|
+
name: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'tag';
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=style-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-scope.d.ts","sourceRoot":"","sources":["../../../../src/api/style/style-scope.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upsert-theme-style-element.d.ts","sourceRoot":"","sources":["../../../../src/api/style/upsert-theme-style-element.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC/C,GAAG,EAAE,MAAM,GACV,gBAAgB,CAqBlB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function upsertThemeStyleElement(document, identifiers, css) {
|
|
2
|
+
let selector = '';
|
|
3
|
+
for (const key in identifiers) {
|
|
4
|
+
if (identifiers[key] === undefined)
|
|
5
|
+
continue;
|
|
6
|
+
selector += `[data-${key}="${identifiers[key]}"]`;
|
|
7
|
+
}
|
|
8
|
+
if (!selector)
|
|
9
|
+
throw new Error('No identifiers provided for the style element');
|
|
10
|
+
let styleElement = document.head.querySelector(`style[ngn-style]${selector}`);
|
|
11
|
+
if (!styleElement) {
|
|
12
|
+
styleElement = document.createElement('style');
|
|
13
|
+
styleElement.setAttribute('ngn-style', '');
|
|
14
|
+
for (const key in identifiers) {
|
|
15
|
+
if (identifiers[key] === undefined)
|
|
16
|
+
continue;
|
|
17
|
+
styleElement.setAttribute(`data-${key}`, identifiers[key]);
|
|
18
|
+
}
|
|
19
|
+
document.head.appendChild(styleElement);
|
|
20
|
+
}
|
|
21
|
+
styleElement.innerHTML = css;
|
|
22
|
+
return styleElement;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ControlTemplate } from '@ngneers/controls-themes';
|
|
2
|
+
type Prettify<T> = {
|
|
3
|
+
[K in keyof T]: T[K];
|
|
4
|
+
} & {};
|
|
5
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
6
|
+
export type ThemeClasses<CT extends ControlTemplate> = Record<CT['classNames'][number], string> & {
|
|
7
|
+
$deps: UnionToIntersection<Prettify<CT['dependencies'][number] extends infer Dep ? Dep extends ControlTemplate<infer I> ? Record<I, ThemeClasses<Dep>> : never : never>>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/classes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,EAAE,CAAC;AACjD,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,IAAI,GAC/F,CAAC,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,eAAe,IAAI,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG;IAChG,KAAK,EAAE,mBAAmB,CACxB,QAAQ,CACN,EAAE,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,GACxC,GAAG,SAAS,eAAe,CAAC,MAAM,CAAC,CAAC,GAClC,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,GAC5B,KAAK,GACP,KAAK,CACV,CACF,CAAC;CACH,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SubKey } from '../utils/sub-key';
|
|
2
|
+
type CombineVariableVariations<A extends readonly string[], B extends readonly string[], Result extends string[] = []> = A extends readonly [infer AH, ...infer AT] ? AH extends string ? AT extends readonly string[] ? [
|
|
3
|
+
...CombineVariableVariations<AT, B, Result>,
|
|
4
|
+
...{
|
|
5
|
+
[K in keyof B]: SubKey<[AH, B[K]]>;
|
|
6
|
+
}
|
|
7
|
+
] : Result : Result : Result;
|
|
8
|
+
export declare function combineVariableVariations<const A extends readonly string[], const B extends readonly string[]>(a: A, b: B): CombineVariableVariations<A, B>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=combine-variable-variations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combine-variable-variations.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/combine-variable-variations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,KAAK,yBAAyB,CAC5B,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,MAAM,SAAS,MAAM,EAAE,GAAG,EAAE,IAC1B,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,GAC1C,EAAE,SAAS,MAAM,GACf,EAAE,SAAS,SAAS,MAAM,EAAE,GAC1B;IACE,GAAG,yBAAyB,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAC3C,GAAG;SACA,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC;CACF,GACD,MAAM,GACR,MAAM,GACR,MAAM,CAAC;AAEX,wBAAgB,yBAAyB,CACvC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAQ7C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {} from '../utils/sub-key';
|
|
2
|
+
export function combineVariableVariations(a, b) {
|
|
3
|
+
const result = [];
|
|
4
|
+
for (const itemA of a) {
|
|
5
|
+
for (const itemB of b) {
|
|
6
|
+
result.push(itemA === '' ? itemB : itemB === '' ? itemA : `${itemA}.${itemB}`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type CombineVariations<A extends readonly string[], B extends readonly string[], Result extends string[] = []> = A extends readonly [infer AH, ...infer AT] ? AH extends string ? AT extends readonly string[] ? [
|
|
2
|
+
...CombineVariations<AT, B, Result>,
|
|
3
|
+
...{
|
|
4
|
+
[K in keyof B]: [AH, B[K]];
|
|
5
|
+
}
|
|
6
|
+
] : Result : Result : Result;
|
|
7
|
+
export declare function combineVariations<const A extends readonly string[], const B extends readonly string[]>(a: A, b: B): CombineVariations<A, B>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=combine-variations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combine-variations.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/combine-variations.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,CACpB,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,MAAM,SAAS,MAAM,EAAE,GAAG,EAAE,IAC1B,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,GAC1C,EAAE,SAAS,MAAM,GACf,EAAE,SAAS,SAAS,MAAM,EAAE,GAC1B;IACE,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IACnC,GAAG;SACA,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3B;CACF,GACD,MAAM,GACR,MAAM,GACR,MAAM,CAAC;AAEX,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAQrC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Scoped } from './scoped';
|
|
2
|
+
export type ControlTemplate<S extends string = string, C extends string[] = string[], Deps extends readonly ControlTemplate[] = readonly any[]> = Scoped<S> & {
|
|
3
|
+
readonly classNames: C;
|
|
4
|
+
readonly dependencies: Deps;
|
|
5
|
+
};
|
|
6
|
+
type _ResolveWildcards<C extends string> = C extends `${infer Prefix}*${infer Suffix}` ? `${Prefix}${string}${Suffix}` : C;
|
|
7
|
+
type ResolveWildcards<C extends readonly string[]> = C extends readonly [infer Head, ...infer Tail] ? Head extends string ? Tail extends readonly string[] ? [_ResolveWildcards<Head>, ...ResolveWildcards<Tail>] : never : never : C;
|
|
8
|
+
export declare function createControlTemplate<S extends string, const C extends string[], const Deps extends readonly ControlTemplate[]>(init: {
|
|
9
|
+
scope: S;
|
|
10
|
+
classNames: C;
|
|
11
|
+
readonly dependencies?: Deps;
|
|
12
|
+
}): ControlTemplate<S, ResolveWildcards<C>, Deps>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=control-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-template.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/control-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,eAAe,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,CAAC,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EAC7B,IAAI,SAAS,SAAS,eAAe,EAAE,GAAG,SAAS,GAAG,EAAE,IACtD,MAAM,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAA;CAAE,CAAC;AAExE,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,MAAM,IAAI,MAAM,MAAM,EAAE,GAClF,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAC7B,CAAC,CAAC;AACN,KAAK,gBAAgB,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,GAC/F,IAAI,SAAS,MAAM,GACjB,IAAI,SAAS,SAAS,MAAM,EAAE,GAC5B,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,GACpD,KAAK,GACP,KAAK,GACP,CAAC,CAAC;AACN,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,MAAM,EAChB,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,EACxB,KAAK,CAAC,IAAI,SAAS,SAAS,eAAe,EAAE,EAC7C,IAAI,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAA;CAAE,iDAEhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/css.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG;;qCAAa,CAAC"}
|
package/api/theme/css.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const css = String.raw;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TemplateVariable } from './template-variable';
|
|
2
|
+
import { type UnionToIntersection } from '../utils/union-to-intersection';
|
|
3
|
+
type RepeatVariables<K extends string, T> = UnionToIntersection<K extends `${infer P}.${infer R}` ? {
|
|
4
|
+
[Q in P]: RepeatVariables<R, T>;
|
|
5
|
+
} : K extends '' ? T : {
|
|
6
|
+
[P in K]: T;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function repeatVariables<const TVariations extends readonly string[], TVariables extends Record<string, TemplateVariable<null>>>(variations: TVariations, variables: TVariables): RepeatVariables<TVariations[number], TVariables>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=repeat-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeat-variables.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/repeat-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,KAAK,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,mBAAmB,CAC7D,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,CAAC,EAAE,GAC7B;KAAG,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;CAAE,GACnC,CAAC,SAAS,EAAE,GACV,CAAC,GACD;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAAE,CACtB,CAAC;AAEF,wBAAgB,eAAe,CAC7B,KAAK,CAAC,WAAW,SAAS,SAAS,MAAM,EAAE,EAC3C,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAEzD,UAAU,EAAE,WAAW,EACvB,SAAS,EAAE,UAAU,GACpB,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAQlD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {} from './template-variable';
|
|
2
|
+
import { deepSet } from '../utils/deep-set';
|
|
3
|
+
import {} from '../utils/union-to-intersection';
|
|
4
|
+
export function repeatVariables(variations, variables) {
|
|
5
|
+
return variations.reduce((acc, variation) => {
|
|
6
|
+
deepSet(acc, variation, variables);
|
|
7
|
+
return acc;
|
|
8
|
+
}, {});
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/scoped.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-variable.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/template-variable.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ControlTemplate } from './control-template';
|
|
2
|
+
import { type Scoped } from './scoped';
|
|
3
|
+
import { type VariableValues } from './variable';
|
|
4
|
+
import { type VariableTemplate } from './variable-template';
|
|
5
|
+
type ChildrenScopes<Deps> = Deps extends readonly (infer Child)[] ? Child extends ControlTemplate ? Child['scope'] : never : never;
|
|
6
|
+
type ClassnameForChildScope<Deps, Scope> = Scope extends ChildrenScopes<Deps> ? Deps extends readonly (infer Child)[] ? Child extends ControlTemplate<Scope> ? Child['classNames'][number] : never : never : never;
|
|
7
|
+
type ThemePartContent<V, K, C, Deps> = {
|
|
8
|
+
readonly values?: V;
|
|
9
|
+
readonly css?: (args: {
|
|
10
|
+
v: (key: K) => string;
|
|
11
|
+
c: (className: C, kind?: 'class' | 'animation') => string;
|
|
12
|
+
d: <const Scope extends ChildrenScopes<Deps>>(scope: Scope, className: ClassnameForChildScope<Deps, Scope>) => string;
|
|
13
|
+
}) => string;
|
|
14
|
+
};
|
|
15
|
+
type _ThemePartContent<S extends string = string, C extends ControlTemplate = ControlTemplate<S>, V extends VariableTemplate<S>[] = VariableTemplate<S>[], D extends VariableTemplate[] = VariableTemplate[]> = ThemePartContent<VariableValues<V[number]['variables'], V[number]['__varkeys'] | D[number]['__varkeys']>, V[number]['__varkeys'] | D[number]['__varkeys'], C['classNames'][number], C['dependencies']>;
|
|
16
|
+
export type ThemePart<S extends string = string, C extends ControlTemplate<S> = ControlTemplate<S>, V extends VariableTemplate<S>[] = VariableTemplate<S>[], D extends VariableTemplate[] = VariableTemplate[]> = Scoped<S> & {
|
|
17
|
+
readonly controlTemplate?: C;
|
|
18
|
+
readonly variables?: V;
|
|
19
|
+
readonly base?: ThemePart<S, C, V, VariableTemplate[]>;
|
|
20
|
+
readonly dependencies?: D;
|
|
21
|
+
readonly root?: _ThemePartContent<S, C, V, D>;
|
|
22
|
+
readonly light?: _ThemePartContent<S, C, V, D>;
|
|
23
|
+
readonly dark?: _ThemePartContent<S, C, V, D>;
|
|
24
|
+
readonly highContrast?: _ThemePartContent<S, C, V, D>;
|
|
25
|
+
};
|
|
26
|
+
export declare function createThemePart<C extends ControlTemplate = ControlTemplate, const V extends VariableTemplate<C['scope']>[] = VariableTemplate<C['scope']>[], const D extends VariableTemplate[] = VariableTemplate[]>(init: Omit<ThemePart<C['scope'], C, V, D>, 'scope' | 'controlTemplate'> & {
|
|
27
|
+
controlTemplate: C;
|
|
28
|
+
}): ThemePart<C['scope'], C, V, D>;
|
|
29
|
+
export declare function createThemePart<S extends string = string, const V extends VariableTemplate<S>[] = VariableTemplate<S>[], const D extends VariableTemplate[] = VariableTemplate[]>(init: ThemePart<S, never, V, D>): ThemePart<S, never, V, D>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=theme-part.d.ts.map
|