@hkdigital/lib-core 0.3.14 → 0.4.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/README.md +18 -9
- package/dist/auth/errors.d.ts +1 -0
- package/dist/auth/errors.js +1 -0
- package/dist/{states → browser/navigation}/navigation.svelte.js +1 -1
- package/dist/browser/navigation.d.ts +1 -0
- package/dist/browser/navigation.js +1 -0
- package/dist/config/README.md +5 -5
- package/dist/config/generators/imagetools.d.ts +2 -0
- package/dist/config/generators/imagetools.js +23 -10
- package/dist/config/generators/vite.js +1 -1
- package/dist/config/imagetools.d.ts +5 -5
- package/dist/config/typedef.d.ts +11 -0
- package/dist/config/typedef.js +17 -0
- package/dist/design/README.md +211 -66
- package/dist/design/config/{design-config.d.ts → design-tokens.d.ts} +23 -10
- package/dist/design/config/design-tokens.js +107 -0
- package/dist/design/generators/index.d.ts +51 -0
- package/dist/design/generators/index.js +124 -0
- package/dist/design/index.d.ts +3 -4
- package/dist/design/index.js +24 -41
- package/dist/design/plugins/skeleton.d.ts +4 -2
- package/dist/design/plugins/skeleton.js +3 -2
- package/dist/design/themes/hkdev/components/buttons/button-text.css +38 -25
- package/dist/design/themes/hkdev/theme-ext.js +1 -1
- package/dist/design/utils/clamp.js +1 -1
- package/dist/design/utils/root-vars.d.ts +50 -39
- package/dist/design/utils/root-vars.js +127 -29
- package/dist/{classes/data → generic/data/classes}/IterableTree.js +2 -2
- package/dist/{classes/data → generic/data/classes}/Selector.js +1 -1
- package/dist/generic/data/classes/typedef.d.ts +24 -0
- package/dist/generic/data/classes/typedef.js +14 -0
- package/dist/generic/data.d.ts +2 -0
- package/dist/generic/data.js +2 -0
- package/dist/generic/errors.d.ts +2 -0
- package/dist/generic/errors.js +2 -0
- package/dist/generic/events.d.ts +1 -0
- package/dist/generic/events.js +1 -0
- package/dist/{classes/promise → generic/promises/classes}/HkPromise.d.ts +17 -7
- package/dist/{classes/promise → generic/promises/classes}/HkPromise.js +20 -10
- package/dist/generic/promises.d.ts +1 -0
- package/dist/generic/promises.js +1 -0
- package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.d.ts +1 -1
- package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.js +2 -2
- package/dist/generic/streaming.d.ts +3 -0
- package/dist/generic/streaming.js +3 -0
- package/dist/generic/typedef.d.ts +1 -0
- package/dist/generic/typedef.js +1 -0
- package/dist/index.js +1 -0
- package/dist/logging/errors.d.ts +7 -0
- package/dist/logging/errors.js +11 -0
- package/dist/logging/index.d.ts +2 -3
- package/dist/logging/index.js +3 -4
- package/dist/logging/internal/adapters/console.d.ts +1 -16
- package/dist/logging/internal/adapters/console.js +322 -14
- package/dist/logging/internal/adapters/formatting.d.ts +69 -0
- package/dist/logging/internal/adapters/formatting.js +395 -0
- package/dist/logging/internal/adapters/pino.js +128 -27
- package/dist/logging/internal/adapters/typedef.d.ts +30 -0
- package/dist/logging/internal/adapters/typedef.js +11 -0
- package/dist/logging/internal/factories/client.js +1 -1
- package/dist/logging/internal/factories/server.js +12 -2
- package/dist/logging/internal/logger/Logger.d.ts +9 -7
- package/dist/logging/internal/logger/Logger.js +44 -9
- package/dist/logging/internal/test-errors.d.ts +35 -0
- package/dist/logging/internal/test-errors.js +137 -0
- package/dist/network/cache/IndexedDbCache.d.ts +1 -1
- package/dist/network/cache/MemoryResponseCache.d.ts +5 -0
- package/dist/network/cache/MemoryResponseCache.js +5 -2
- package/dist/network/errors.d.ts +2 -0
- package/dist/network/errors.js +2 -0
- package/dist/network/http/caching.js +1 -1
- package/dist/network/http/errors.d.ts +2 -2
- package/dist/network/http/errors.js +5 -13
- package/dist/network/http/http-request.js +1 -1
- package/dist/network/http/json-request.js +1 -1
- package/dist/network/http/response.js +1 -1
- package/dist/network/http/url.js +1 -1
- package/dist/network/loaders/README.md +14 -7
- package/dist/network/loaders/audio/AudioScene.svelte.js +3 -2
- package/dist/network/loaders/image/ImageLoader.svelte.d.ts +2 -2
- package/dist/network/loaders/image/ImageLoader.svelte.js +1 -1
- package/dist/network/loaders/image/ImageScene.svelte.d.ts +2 -2
- package/dist/network/loaders/image/ImageScene.svelte.js +9 -8
- package/dist/network/loaders/image/ImageVariantsLoader.svelte.d.ts +5 -5
- package/dist/network/loaders/image/ImageVariantsLoader.svelte.js +14 -13
- package/dist/network/loaders/image/utils/index.d.ts +2 -2
- package/dist/network/loaders/image/utils/index.js +9 -12
- package/dist/network/loaders/typedef.d.ts +0 -9
- package/dist/network/loaders/typedef.js +0 -12
- package/dist/network/states/NetworkLoader.svelte.d.ts +1 -1
- package/dist/network/states/NetworkLoader.svelte.js +3 -2
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -3
- package/dist/services/service-base/ServiceBase.d.ts +2 -2
- package/dist/services/service-base/ServiceBase.js +15 -11
- package/dist/services/service-base/typedef.d.ts +2 -31
- package/dist/services/service-base/typedef.js +3 -2
- package/dist/services/service-manager/ServiceManager.d.ts +3 -3
- package/dist/services/service-manager/ServiceManager.js +2 -2
- package/dist/services/service-manager/typedef.d.ts +3 -3
- package/dist/services/service-manager/typedef.js +3 -3
- package/dist/services/typedef.d.ts +2 -0
- package/dist/services/typedef.js +2 -0
- package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.d.ts +1 -1
- package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.js +1 -1
- package/dist/state/classes/subscribers-count/index.d.ts +1 -0
- package/dist/state/classes/subscribers-count/index.js +1 -0
- package/dist/state/classes.d.ts +3 -0
- package/dist/state/classes.js +3 -0
- package/dist/{util/svelte/state-context/index.d.ts → state/context/state-context.d.ts} +1 -1
- package/dist/{util/svelte/state-context/index.js → state/context/state-context.js} +4 -4
- package/dist/state/context.d.ts +1 -0
- package/dist/state/context.js +1 -0
- package/dist/state/stores.d.ts +1 -0
- package/dist/state/stores.js +1 -0
- package/dist/ui/README.md +49 -0
- package/dist/ui/components/button-group/index.d.ts +1 -0
- package/dist/ui/components/button-group/index.js +1 -0
- package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte +1 -1
- package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte.d.ts +1 -1
- package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte +2 -2
- package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte.d.ts +1 -1
- package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte +4 -4
- package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte.d.ts +3 -3
- package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte +3 -3
- package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte.d.ts +4 -4
- package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte +3 -3
- package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte.d.ts +3 -3
- package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.d.ts +11 -11
- package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.js +5 -5
- package/dist/ui/components/drag-drop/typedef.d.ts +2 -0
- package/dist/ui/components/drag-drop/typedef.js +2 -0
- package/dist/ui/components/game-box/GameBox.svelte +1 -1
- package/dist/ui/components/game-box/index.d.ts +1 -0
- package/dist/ui/components/game-box/index.js +1 -0
- package/dist/ui/components/grid-layers/index.d.ts +1 -0
- package/dist/ui/components/grid-layers/index.js +1 -0
- package/dist/ui/{primitives/layout → components}/grid-layers/util.js +1 -1
- package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.d.ts +3 -3
- package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.js +3 -4
- package/dist/ui/components/hk-app-layout/index.d.ts +1 -0
- package/dist/ui/components/hk-app-layout/index.js +1 -0
- package/dist/ui/components/image-box/ImageBox.svelte +2 -2
- package/dist/ui/components/image-box/ImageBox.svelte.d.ts +3 -3
- package/dist/ui/components/image-box/index.d.ts +1 -1
- package/dist/ui/components/presenter/ImageSlide.svelte +1 -1
- package/dist/ui/components/presenter/ImageSlide.svelte.d.ts +2 -2
- package/dist/ui/components/presenter/Presenter.state.svelte.d.ts +3 -3
- package/dist/ui/components/presenter/Presenter.state.svelte.js +1 -1
- package/dist/ui/components/presenter/Presenter.svelte +1 -1
- package/dist/ui/components/presenter/Presenter.svelte.d.ts +1 -1
- package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte.d.ts +1 -1
- package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte.d.ts +1 -1
- package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.d.ts +3 -3
- package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.js +4 -2
- package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte +2 -2
- package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte.d.ts +2 -2
- package/dist/ui/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
- package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.state.svelte.js +2 -2
- package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte +1 -1
- package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte.d.ts +2 -2
- package/dist/ui/{primitives → components}/tab-bar/typedef.d.ts +1 -1
- package/dist/ui/{primitives → components}/tab-bar/typedef.js +1 -1
- package/dist/ui/components/typedef.d.ts +5 -0
- package/dist/ui/components/typedef.js +5 -0
- package/dist/ui/components/virtual-viewport/index.d.ts +1 -0
- package/dist/ui/components/virtual-viewport/index.js +1 -0
- package/dist/ui/components.d.ts +11 -0
- package/dist/ui/components.js +11 -0
- package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte +1 -1
- package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +8 -8
- package/dist/ui/dev.d.ts +3 -0
- package/dist/ui/dev.js +3 -0
- package/dist/ui/primitives/buttons/button/Button.svelte.d.ts +1 -1
- package/dist/ui/primitives/buttons/button-text/TextButton.svelte +1 -1
- package/dist/ui/primitives/typedef.d.ts +1 -0
- package/dist/ui/primitives/typedef.js +1 -0
- package/dist/ui/primitives.d.ts +5 -0
- package/dist/ui/primitives.js +5 -0
- package/dist/ui/typedef.d.ts +2 -0
- package/dist/ui/typedef.js +2 -0
- package/dist/util/array/index.js +1 -1
- package/dist/util/bases/base58.d.ts +3 -3
- package/dist/util/bases/base58.js +3 -3
- package/dist/util/compare/index.d.ts +4 -5
- package/dist/util/compare/index.js +3 -4
- package/dist/util/exceptions/index.js +1 -1
- package/dist/util/expect/arrays.d.ts +11 -11
- package/dist/util/expect/arrays.js +14 -6
- package/dist/util/expect/index.js +2 -2
- package/dist/util/expect/primitives.d.ts +6 -5
- package/dist/util/expect/primitives.js +15 -5
- package/dist/util/expect/url.d.ts +6 -5
- package/dist/util/expect/url.js +15 -5
- package/dist/util/function/index.d.ts +1 -14
- package/dist/util/index.d.ts +5 -0
- package/dist/util/index.js +13 -0
- package/dist/util/is/index.d.ts +3 -2
- package/dist/util/is/index.js +2 -1
- package/dist/util/iterate/index.d.ts +6 -8
- package/dist/util/iterate/index.js +5 -5
- package/dist/util/object/index.d.ts +1 -2
- package/dist/util/object/index.js +2 -3
- package/dist/util/ssr/index.d.ts +16 -0
- package/dist/util/ssr/index.js +44 -0
- package/dist/util/svelte/index.d.ts +1 -1
- package/dist/util/svelte/index.js +1 -1
- package/dist/util/time/index.d.ts +2 -2
- package/dist/util/time/index.js +1 -1
- package/dist/valibot/index.d.ts +1 -1
- package/dist/valibot/index.js +27 -1
- package/package.json +4 -4
- package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker.d.ts +0 -17
- package/dist/assets/autospuiten/car-paint-picker.js +0 -41
- package/dist/assets/autospuiten/labels.d.ts +0 -7
- package/dist/assets/autospuiten/labels.js +0 -7
- package/dist/classes/data/index.d.ts +0 -2
- package/dist/classes/data/index.js +0 -2
- package/dist/classes/event-emitter/index.d.ts +0 -1
- package/dist/classes/event-emitter/index.js +0 -2
- package/dist/classes/index.d.ts +0 -4
- package/dist/classes/index.js +0 -4
- package/dist/classes/promise/index.d.ts +0 -1
- package/dist/classes/promise/index.js +0 -1
- package/dist/classes/stores/index.d.ts +0 -1
- package/dist/classes/stores/index.js +0 -1
- package/dist/classes/streams/index.d.ts +0 -3
- package/dist/classes/streams/index.js +0 -3
- package/dist/classes/svelte/index.d.ts +0 -1
- package/dist/classes/svelte/index.js +0 -1
- package/dist/design/config/design-config.js +0 -73
- package/dist/design/tailwind-theme-extend.d.ts +0 -23
- package/dist/design/tailwind-theme-extend.js +0 -158
- package/dist/errors/index.d.ts +0 -5
- package/dist/errors/index.js +0 -5
- package/dist/logging/internal/factories/universal.d.ts +0 -9
- package/dist/logging/internal/factories/universal.js +0 -22
- package/dist/services/service-base/index.d.ts +0 -3
- package/dist/services/service-base/index.js +0 -3
- package/dist/states/index.d.ts +0 -1
- package/dist/states/index.js +0 -1
- package/dist/stores/index.d.ts +0 -1
- package/dist/stores/index.js +0 -1
- package/dist/typedef/index.d.ts +0 -4
- package/dist/typedef/index.js +0 -4
- package/dist/ui/primitives/debug/index.d.ts +0 -1
- package/dist/ui/primitives/debug/index.js +0 -1
- package/dist/ui/primitives/index.d.ts +0 -0
- package/dist/ui/primitives/index.js +0 -2
- package/dist/ui/primitives/layout/grid-layers/GridLayers.svelte__heightFrom__ +0 -372
- package/dist/ui/primitives/layout/index.d.ts +0 -1
- package/dist/ui/primitives/layout/index.js +0 -1
- package/dist/ui/primitives/tab-bar/HkTabBarSelector.state.svelte.d.ts +0 -19
- /package/dist/{errors → auth/errors}/jwt.d.ts +0 -0
- /package/dist/{errors → auth/errors}/jwt.js +0 -0
- /package/dist/{states → browser/navigation}/navigation.svelte.d.ts +0 -0
- /package/dist/{classes/data → generic/data/classes}/IterableTree.d.ts +0 -0
- /package/dist/{classes/data → generic/data/classes}/Selector.d.ts +0 -0
- /package/dist/{classes → generic}/data/typedef.d.ts +0 -0
- /package/dist/{classes → generic}/data/typedef.js +0 -0
- /package/dist/{errors → generic/errors}/generic.d.ts +0 -0
- /package/dist/{errors → generic/errors}/generic.js +0 -0
- /package/dist/{errors → generic/errors}/promise.d.ts +0 -0
- /package/dist/{errors → generic/errors}/promise.js +0 -0
- /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.d.ts +0 -0
- /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.js +0 -0
- /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.d.ts +0 -0
- /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.js +0 -0
- /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.d.ts +0 -0
- /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.js +0 -0
- /package/dist/logging/{internal/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/logging/{internal/constants.js → constants.js} +0 -0
- /package/dist/logging/{internal/typedef.d.ts → typedef.d.ts} +0 -0
- /package/dist/logging/{internal/typedef.js → typedef.js} +0 -0
- /package/dist/{errors → network/errors}/api.d.ts +0 -0
- /package/dist/{errors → network/errors}/api.js +0 -0
- /package/dist/{errors → network/errors}/http.d.ts +0 -0
- /package/dist/{errors → network/errors}/http.js +0 -0
- /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.d.ts +0 -0
- /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.js +0 -0
- /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.d.ts +0 -0
- /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.js +0 -0
- /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.d.ts +0 -0
- /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.js +0 -0
- /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.d.ts +0 -0
- /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.js +0 -0
- /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.d.ts +0 -0
- /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.js +0 -0
- /package/dist/{typedef/context.d.ts → state/context/typedef.d.ts} +0 -0
- /package/dist/{typedef/context.js → state/context/typedef.js} +0 -0
- /package/dist/{stores → state/stores}/theme.d.ts +0 -0
- /package/dist/{stores → state/stores}/theme.js +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/DragController.d.ts +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/DragController.js +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/actions.d.ts +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/actions.js +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/index.d.ts +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/index.js +0 -0
- /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.d.ts +0 -0
- /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.js +0 -0
- /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.d.ts +0 -0
- /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.js +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/util.d.ts +0 -0
- /package/dist/ui/{primitives → components}/drag-drop/util.js +0 -0
- /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte +0 -0
- /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte.d.ts +0 -0
- /package/dist/ui/{primitives/layout → components}/grid-layers/util.d.ts +0 -0
- /package/dist/ui/{primitives → components}/rows/index.d.ts +0 -0
- /package/dist/ui/{primitives → components}/rows/index.js +0 -0
- /package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte +0 -0
- /package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte +0 -0
- /package/dist/ui/{primitives → components}/tab-bar/index.d.ts +0 -0
- /package/dist/ui/{primitives → components}/tab-bar/index.js +0 -0
- /package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte.d.ts +0 -0
- /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte +0 -0
- /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte.d.ts +0 -0
- /package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +0 -0
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
export namespace
|
|
1
|
+
export namespace designTokens {
|
|
2
|
+
export { DESIGN };
|
|
3
|
+
export { CLAMPING };
|
|
4
|
+
export { TEXT_POINT_SIZES };
|
|
5
|
+
export { VIEWPORT_POINT_SIZES };
|
|
6
|
+
export { TEXT_BASE_SIZES };
|
|
7
|
+
export { TEXT_HEADING_SIZES };
|
|
8
|
+
export { TEXT_UI_SIZES };
|
|
9
|
+
export { RADIUS_SIZES };
|
|
10
|
+
export { BORDER_WIDTH_SIZES };
|
|
11
|
+
export { STROKE_WIDTH_SIZES };
|
|
12
|
+
}
|
|
13
|
+
declare namespace DESIGN {
|
|
2
14
|
let width: number;
|
|
3
15
|
let height: number;
|
|
4
16
|
}
|
|
5
|
-
|
|
17
|
+
declare namespace CLAMPING {
|
|
6
18
|
namespace ui {
|
|
7
19
|
let min: number;
|
|
8
20
|
let max: number;
|
|
@@ -26,9 +38,9 @@ export namespace CLAMPING {
|
|
|
26
38
|
export { max_3 as max };
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
declare const TEXT_POINT_SIZES: number[];
|
|
42
|
+
declare const VIEWPORT_POINT_SIZES: number[];
|
|
43
|
+
declare namespace TEXT_BASE_SIZES {
|
|
32
44
|
namespace sm {
|
|
33
45
|
let size: number;
|
|
34
46
|
let lineHeight: number;
|
|
@@ -46,7 +58,7 @@ export namespace TEXT_BASE_SIZES {
|
|
|
46
58
|
export { lineHeight_2 as lineHeight };
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
|
-
|
|
61
|
+
declare namespace TEXT_HEADING_SIZES {
|
|
50
62
|
namespace h1 {
|
|
51
63
|
let size_3: number;
|
|
52
64
|
export { size_3 as size };
|
|
@@ -78,7 +90,7 @@ export namespace TEXT_HEADING_SIZES {
|
|
|
78
90
|
export { lineHeight_7 as lineHeight };
|
|
79
91
|
}
|
|
80
92
|
}
|
|
81
|
-
|
|
93
|
+
declare namespace TEXT_UI_SIZES {
|
|
82
94
|
export namespace sm_1 {
|
|
83
95
|
let size_8: number;
|
|
84
96
|
export { size_8 as size };
|
|
@@ -101,7 +113,7 @@ export namespace TEXT_UI_SIZES {
|
|
|
101
113
|
}
|
|
102
114
|
export { lg_1 as lg };
|
|
103
115
|
}
|
|
104
|
-
|
|
116
|
+
declare namespace RADIUS_SIZES {
|
|
105
117
|
export let none: string;
|
|
106
118
|
export namespace xs {
|
|
107
119
|
let size_11: number;
|
|
@@ -124,7 +136,7 @@ export namespace RADIUS_SIZES {
|
|
|
124
136
|
export { lg_2 as lg };
|
|
125
137
|
export let full: string;
|
|
126
138
|
}
|
|
127
|
-
|
|
139
|
+
declare namespace BORDER_WIDTH_SIZES {
|
|
128
140
|
namespace thin {
|
|
129
141
|
let size_15: number;
|
|
130
142
|
export { size_15 as size };
|
|
@@ -138,7 +150,7 @@ export namespace BORDER_WIDTH_SIZES {
|
|
|
138
150
|
export { size_17 as size };
|
|
139
151
|
}
|
|
140
152
|
}
|
|
141
|
-
|
|
153
|
+
declare namespace STROKE_WIDTH_SIZES {
|
|
142
154
|
export namespace thin_1 {
|
|
143
155
|
let size_18: number;
|
|
144
156
|
export { size_18 as size };
|
|
@@ -155,3 +167,4 @@ export namespace STROKE_WIDTH_SIZES {
|
|
|
155
167
|
}
|
|
156
168
|
export { thick_1 as thick };
|
|
157
169
|
}
|
|
170
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview HKdigital Design Tokens
|
|
3
|
+
*
|
|
4
|
+
* Default design system tokens for the HKdigital design system.
|
|
5
|
+
* These tokens define all the design values used to generate Tailwind theme extensions.
|
|
6
|
+
*
|
|
7
|
+
* Users can create their own design-tokens.js file with custom values
|
|
8
|
+
* and pass it to generateTailwindThemeExtensions().
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* == Design dimensions == */
|
|
12
|
+
|
|
13
|
+
const DESIGN = {
|
|
14
|
+
width: 1024,
|
|
15
|
+
height: 768
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/* == Scaling-clamping behaviour == */
|
|
19
|
+
|
|
20
|
+
const CLAMPING = {
|
|
21
|
+
ui: { min: 0.3, max: 2 },
|
|
22
|
+
textBase: { min: 0.75, max: 1.5 },
|
|
23
|
+
textHeading: { min: 0.75, max: 2.25 },
|
|
24
|
+
textUi: { min: 0.5, max: 1.25 }
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/* == Text == */
|
|
28
|
+
|
|
29
|
+
const TEXT_POINT_SIZES = [
|
|
30
|
+
1, 2, 4, 6, 8, 10, 11, 12, 16, 20, 24, 28, 32, 36, 50
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const VIEWPORT_POINT_SIZES = [
|
|
34
|
+
1, 2, 4, 5, 6, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140, 160, 180,
|
|
35
|
+
200
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const TEXT_BASE_SIZES = {
|
|
39
|
+
sm: { size: 14, lineHeight: 1.25 },
|
|
40
|
+
md: { size: 16, lineHeight: 1.25 },
|
|
41
|
+
lg: { size: 18, lineHeight: 1.25 }
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const TEXT_HEADING_SIZES = {
|
|
45
|
+
h1: { size: 32, lineHeight: 1.25 },
|
|
46
|
+
h2: { size: 28, lineHeight: 1.25 },
|
|
47
|
+
h3: { size: 24, lineHeight: 1.25 },
|
|
48
|
+
h4: { size: 20, lineHeight: 1.25 },
|
|
49
|
+
h5: { size: 16, lineHeight: 1.25 }
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const TEXT_UI_SIZES = {
|
|
53
|
+
sm: { size: 14, lineHeight: 1 },
|
|
54
|
+
md: { size: 16, lineHeight: 1 },
|
|
55
|
+
lg: { size: 18, lineHeight: 1 }
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/* == Border radius == */
|
|
59
|
+
|
|
60
|
+
const RADIUS_SIZES = {
|
|
61
|
+
none: '0px',
|
|
62
|
+
xs: { size: 5 },
|
|
63
|
+
sm: { size: 10 },
|
|
64
|
+
md: { size: 25 },
|
|
65
|
+
lg: { size: 35 },
|
|
66
|
+
full: '9999px'
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/* == Border width == */
|
|
70
|
+
|
|
71
|
+
const BORDER_WIDTH_SIZES = {
|
|
72
|
+
thin: { size: 1 },
|
|
73
|
+
normal: { size: 2 },
|
|
74
|
+
thick: { size: 4 }
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/* == Stroke width == */
|
|
78
|
+
|
|
79
|
+
const STROKE_WIDTH_SIZES = {
|
|
80
|
+
thin: { size: 1 },
|
|
81
|
+
normal: { size: 2 },
|
|
82
|
+
thick: { size: 4 }
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Complete design tokens configuration
|
|
87
|
+
*
|
|
88
|
+
* @example Usage with generateTailwindThemeExtensions
|
|
89
|
+
* ```javascript
|
|
90
|
+
* import { generateTailwindThemeExtensions } from '@hkdigital/lib-core/design/index.js';
|
|
91
|
+
* import { designTokens } from '@hkdigital/lib-core/design/config/design-tokens.js';
|
|
92
|
+
*
|
|
93
|
+
* const themeExtensions = generateTailwindThemeExtensions(designTokens);
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export const designTokens = {
|
|
97
|
+
DESIGN,
|
|
98
|
+
CLAMPING,
|
|
99
|
+
TEXT_POINT_SIZES,
|
|
100
|
+
VIEWPORT_POINT_SIZES,
|
|
101
|
+
TEXT_BASE_SIZES,
|
|
102
|
+
TEXT_HEADING_SIZES,
|
|
103
|
+
TEXT_UI_SIZES,
|
|
104
|
+
RADIUS_SIZES,
|
|
105
|
+
BORDER_WIDTH_SIZES,
|
|
106
|
+
STROKE_WIDTH_SIZES
|
|
107
|
+
};
|
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate complete Tailwind CSS theme extensions from design configuration
|
|
3
|
+
*
|
|
4
|
+
* Takes design configuration objects and generates complete Tailwind theme extensions.
|
|
5
|
+
* Users can define their own design-config.js with custom values and pass them here.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} designConfig - Design configuration object
|
|
8
|
+
* @param {Object} designConfig.TEXT_POINT_SIZES - Array of text point sizes for spacing
|
|
9
|
+
* @param {Object} designConfig.VIEWPORT_POINT_SIZES - Array of viewport point sizes
|
|
10
|
+
* @param {Object} designConfig.TEXT_BASE_SIZES - Base text size configurations
|
|
11
|
+
* @param {Object} designConfig.TEXT_HEADING_SIZES - Heading text size configurations
|
|
12
|
+
* @param {Object} designConfig.TEXT_UI_SIZES - UI text size configurations
|
|
13
|
+
* @param {Object} designConfig.RADIUS_SIZES - Border radius configurations
|
|
14
|
+
* @param {Object} designConfig.BORDER_WIDTH_SIZES - Border width configurations
|
|
15
|
+
* @param {Object} designConfig.STROKE_WIDTH_SIZES - Stroke width configurations
|
|
16
|
+
*
|
|
17
|
+
* @returns {Object} Complete Tailwind theme extension object
|
|
18
|
+
*
|
|
19
|
+
* @example Basic usage
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // your-project/src/lib/design/design-config.js
|
|
22
|
+
* export const DESIGN = { width: 1440, height: 900 };
|
|
23
|
+
* export const TEXT_BASE_SIZES = {
|
|
24
|
+
* sm: { size: 12, lineHeight: 1.3 },
|
|
25
|
+
* md: { size: 16, lineHeight: 1.4 }
|
|
26
|
+
* };
|
|
27
|
+
* // ... other exports
|
|
28
|
+
*
|
|
29
|
+
* // your-project/tailwind.config.js
|
|
30
|
+
* import { generateTailwindThemeExtensions } from '@hkdigital/lib-core/design/index.js';
|
|
31
|
+
* import { customUtilitiesPlugin } from '@hkdigital/lib-core/design/index.js';
|
|
32
|
+
* import * as designConfig from './src/lib/design/design-config.js';
|
|
33
|
+
*
|
|
34
|
+
* export default {
|
|
35
|
+
* theme: {
|
|
36
|
+
* extend: generateTailwindThemeExtensions(designConfig)
|
|
37
|
+
* },
|
|
38
|
+
* plugins: [customUtilitiesPlugin]
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function generateTailwindThemeExtensions({ TEXT_POINT_SIZES, VIEWPORT_POINT_SIZES, TEXT_BASE_SIZES, TEXT_HEADING_SIZES, TEXT_UI_SIZES, RADIUS_SIZES, BORDER_WIDTH_SIZES, STROKE_WIDTH_SIZES }: {
|
|
43
|
+
TEXT_POINT_SIZES: any;
|
|
44
|
+
VIEWPORT_POINT_SIZES: any;
|
|
45
|
+
TEXT_BASE_SIZES: any;
|
|
46
|
+
TEXT_HEADING_SIZES: any;
|
|
47
|
+
TEXT_UI_SIZES: any;
|
|
48
|
+
RADIUS_SIZES: any;
|
|
49
|
+
BORDER_WIDTH_SIZES: any;
|
|
50
|
+
STROKE_WIDTH_SIZES: any;
|
|
51
|
+
}): any;
|
|
1
52
|
/**
|
|
2
53
|
* Generates text-based spacing units with with different scaling
|
|
3
54
|
* units (ut, bt, ht)
|
|
@@ -1,3 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate complete Tailwind CSS theme extensions from design configuration
|
|
3
|
+
*
|
|
4
|
+
* Takes design configuration objects and generates complete Tailwind theme extensions.
|
|
5
|
+
* Users can define their own design-config.js with custom values and pass them here.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} designConfig - Design configuration object
|
|
8
|
+
* @param {Object} designConfig.TEXT_POINT_SIZES - Array of text point sizes for spacing
|
|
9
|
+
* @param {Object} designConfig.VIEWPORT_POINT_SIZES - Array of viewport point sizes
|
|
10
|
+
* @param {Object} designConfig.TEXT_BASE_SIZES - Base text size configurations
|
|
11
|
+
* @param {Object} designConfig.TEXT_HEADING_SIZES - Heading text size configurations
|
|
12
|
+
* @param {Object} designConfig.TEXT_UI_SIZES - UI text size configurations
|
|
13
|
+
* @param {Object} designConfig.RADIUS_SIZES - Border radius configurations
|
|
14
|
+
* @param {Object} designConfig.BORDER_WIDTH_SIZES - Border width configurations
|
|
15
|
+
* @param {Object} designConfig.STROKE_WIDTH_SIZES - Stroke width configurations
|
|
16
|
+
*
|
|
17
|
+
* @returns {Object} Complete Tailwind theme extension object
|
|
18
|
+
*
|
|
19
|
+
* @example Basic usage
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // your-project/src/lib/design/design-config.js
|
|
22
|
+
* export const DESIGN = { width: 1440, height: 900 };
|
|
23
|
+
* export const TEXT_BASE_SIZES = {
|
|
24
|
+
* sm: { size: 12, lineHeight: 1.3 },
|
|
25
|
+
* md: { size: 16, lineHeight: 1.4 }
|
|
26
|
+
* };
|
|
27
|
+
* // ... other exports
|
|
28
|
+
*
|
|
29
|
+
* // your-project/tailwind.config.js
|
|
30
|
+
* import { generateTailwindThemeExtensions } from '@hkdigital/lib-core/design/index.js';
|
|
31
|
+
* import { customUtilitiesPlugin } from '@hkdigital/lib-core/design/index.js';
|
|
32
|
+
* import * as designConfig from './src/lib/design/design-config.js';
|
|
33
|
+
*
|
|
34
|
+
* export default {
|
|
35
|
+
* theme: {
|
|
36
|
+
* extend: generateTailwindThemeExtensions(designConfig)
|
|
37
|
+
* },
|
|
38
|
+
* plugins: [customUtilitiesPlugin]
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function generateTailwindThemeExtensions({
|
|
43
|
+
TEXT_POINT_SIZES,
|
|
44
|
+
VIEWPORT_POINT_SIZES,
|
|
45
|
+
TEXT_BASE_SIZES,
|
|
46
|
+
TEXT_HEADING_SIZES,
|
|
47
|
+
TEXT_UI_SIZES,
|
|
48
|
+
RADIUS_SIZES,
|
|
49
|
+
BORDER_WIDTH_SIZES,
|
|
50
|
+
STROKE_WIDTH_SIZES
|
|
51
|
+
}) {
|
|
52
|
+
const textBasedSpacing = generateTextBasedSpacing(TEXT_POINT_SIZES);
|
|
53
|
+
const viewportBasedSpacing = generateViewportBasedSpacing(VIEWPORT_POINT_SIZES);
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
spacing: {
|
|
57
|
+
...viewportBasedSpacing,
|
|
58
|
+
...textBasedSpacing
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
fontSize: {
|
|
62
|
+
...textBasedSpacing,
|
|
63
|
+
...generateTextStyles(TEXT_BASE_SIZES, 'base'),
|
|
64
|
+
...generateTextStyles(TEXT_HEADING_SIZES, 'heading'),
|
|
65
|
+
...generateTextStyles(TEXT_UI_SIZES, 'ui')
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
borderRadius: {
|
|
69
|
+
...generateBorderRadiusStyles(RADIUS_SIZES)
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
borderWidth: {
|
|
73
|
+
...generateWidthStyles(BORDER_WIDTH_SIZES, 'width')
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
strokeWidth: {
|
|
77
|
+
...generateWidthStyles(STROKE_WIDTH_SIZES, 'width')
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
outlineWidth: {
|
|
81
|
+
...generateWidthStyles(STROKE_WIDTH_SIZES, '')
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
outlineOffset: {
|
|
85
|
+
...generateWidthStyles(STROKE_WIDTH_SIZES, '')
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
colors: {
|
|
89
|
+
...generateColorStyles()
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
borderColor: {
|
|
93
|
+
...generateColorStyles()
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Generates color styles using CSS variables
|
|
100
|
+
* Creates color classes for the design system theme
|
|
101
|
+
* @returns {Object} Color styles in Tailwind format
|
|
102
|
+
*/
|
|
103
|
+
function generateColorStyles() {
|
|
104
|
+
const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
105
|
+
const colorNames = ['primary', 'secondary', 'tertiary', 'surface', 'success', 'warning', 'error'];
|
|
106
|
+
const colors = {};
|
|
107
|
+
|
|
108
|
+
// Generate main color variations
|
|
109
|
+
for (const colorName of colorNames) {
|
|
110
|
+
colors[colorName] = {};
|
|
111
|
+
for (const shade of shades) {
|
|
112
|
+
colors[colorName][shade] = `rgb(var(--color-${colorName}-${shade}) / <alpha-value>)`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Add contrast colors
|
|
116
|
+
for (const shade of shades) {
|
|
117
|
+
colors[`${colorName}-contrast`] = colors[`${colorName}-contrast`] || {};
|
|
118
|
+
colors[`${colorName}-contrast`][shade] = `rgb(var(--color-${colorName}-contrast-${shade}) / <alpha-value>)`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return colors;
|
|
123
|
+
}
|
|
124
|
+
|
|
1
125
|
/**
|
|
2
126
|
* Generates text-based spacing units with with different scaling
|
|
3
127
|
* units (ut, bt, ht)
|
package/dist/design/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
export { designTokens } from "./config/design-tokens.js";
|
|
1
2
|
export { customUtilitiesPlugin } from "./plugins/skeleton.js";
|
|
2
3
|
export { toStateClasses } from "./utils/states.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { spacing, fontSize, borderRadius, borderWidth, strokeWidth, outlineWidth, outlineOffset } from "./tailwind-theme-extend.js";
|
|
6
|
-
export { rootDesignVarsHTML, getRootCssDesignWidth, getRootCssDesignHeight, getAllRootScalingVars } from "./utils/root-vars.js";
|
|
4
|
+
export { generateTailwindThemeExtensions, generateTextBasedSpacing, generateViewportBasedSpacing, generateTextStyles, generateBorderRadiusStyles, generateWidthStyles } from "./generators/index.js";
|
|
5
|
+
export { designTokensToRootCssVars, getRootCssDesignWidth, getRootCssDesignHeight, getAllRootScalingVars } from "./utils/root-vars.js";
|
|
7
6
|
export { getClampParams, clamp } from "./utils/clamp.js";
|
|
8
7
|
export { enableContainerScaling, enableScalingUI } from "./utils/scaling.js";
|
package/dist/design/index.js
CHANGED
|
@@ -2,53 +2,49 @@
|
|
|
2
2
|
* @fileoverview HKdigital Core Design System
|
|
3
3
|
*
|
|
4
4
|
* This module provides a comprehensive design system for building consistent,
|
|
5
|
-
* responsive interfaces. It includes
|
|
6
|
-
* and
|
|
5
|
+
* responsive interfaces. It includes design tokens, generator functions,
|
|
6
|
+
* and utility functions for creating custom Tailwind theme extensions.
|
|
7
7
|
*
|
|
8
|
-
* @example Basic usage
|
|
8
|
+
* @example Basic usage with default tokens
|
|
9
9
|
* ```javascript
|
|
10
|
-
* import {
|
|
10
|
+
* import { generateTailwindThemeExtensions, designTokens, customUtilitiesPlugin } from '@hkdigital/lib-core/design/index.js';
|
|
11
|
+
*
|
|
12
|
+
* const themeExtensions = generateTailwindThemeExtensions(designTokens);
|
|
11
13
|
*
|
|
12
14
|
* export default {
|
|
13
15
|
* theme: {
|
|
14
|
-
* extend:
|
|
16
|
+
* extend: themeExtensions
|
|
15
17
|
* },
|
|
16
18
|
* plugins: [customUtilitiesPlugin]
|
|
17
19
|
* };
|
|
18
20
|
* ```
|
|
19
21
|
*
|
|
20
|
-
* @example
|
|
22
|
+
* @example Custom design tokens
|
|
21
23
|
* ```javascript
|
|
22
|
-
* import {
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* TEXT_POINT_SIZES
|
|
26
|
-
*
|
|
24
|
+
* import { generateTailwindThemeExtensions } from '@hkdigital/lib-core/design/index.js';
|
|
25
|
+
*
|
|
26
|
+
* const myTokens = {
|
|
27
|
+
* TEXT_POINT_SIZES: [4, 8, 12, 16, 24],
|
|
28
|
+
* TEXT_BASE_SIZES: {
|
|
29
|
+
* sm: { size: 12, lineHeight: 1.3 }
|
|
30
|
+
* }
|
|
31
|
+
* // ... other tokens
|
|
32
|
+
* };
|
|
27
33
|
*
|
|
28
|
-
* const
|
|
34
|
+
* const themeExtensions = generateTailwindThemeExtensions(myTokens);
|
|
29
35
|
* ```
|
|
30
36
|
*/
|
|
31
37
|
|
|
32
|
-
// ===
|
|
33
|
-
//
|
|
38
|
+
// === Design Tokens ===
|
|
39
|
+
// Default design tokens - projects can import and customize for their own design systems
|
|
34
40
|
|
|
35
|
-
export {
|
|
36
|
-
DESIGN,
|
|
37
|
-
CLAMPING,
|
|
38
|
-
TEXT_POINT_SIZES,
|
|
39
|
-
VIEWPORT_POINT_SIZES,
|
|
40
|
-
TEXT_BASE_SIZES,
|
|
41
|
-
TEXT_HEADING_SIZES,
|
|
42
|
-
TEXT_UI_SIZES,
|
|
43
|
-
RADIUS_SIZES,
|
|
44
|
-
BORDER_WIDTH_SIZES,
|
|
45
|
-
STROKE_WIDTH_SIZES
|
|
46
|
-
} from './config/design-config.js';
|
|
41
|
+
export { designTokens } from './config/design-tokens.js';
|
|
47
42
|
|
|
48
43
|
// === Generator Functions ===
|
|
49
44
|
// Essential tools for projects to build custom Tailwind extensions
|
|
50
45
|
|
|
51
46
|
export {
|
|
47
|
+
generateTailwindThemeExtensions,
|
|
52
48
|
generateTextBasedSpacing,
|
|
53
49
|
generateViewportBasedSpacing,
|
|
54
50
|
generateTextStyles,
|
|
@@ -56,19 +52,6 @@ export {
|
|
|
56
52
|
generateWidthStyles
|
|
57
53
|
} from './generators/index.js';
|
|
58
54
|
|
|
59
|
-
// === Ready-to-use Tailwind Extensions ===
|
|
60
|
-
// Built using default configuration - projects can use directly or as reference
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
spacing,
|
|
64
|
-
fontSize,
|
|
65
|
-
borderRadius,
|
|
66
|
-
borderWidth,
|
|
67
|
-
strokeWidth,
|
|
68
|
-
outlineWidth,
|
|
69
|
-
outlineOffset
|
|
70
|
-
} from './tailwind-theme-extend.js';
|
|
71
|
-
|
|
72
55
|
// === Plugins & Utilities ===
|
|
73
56
|
// Framework integration tools
|
|
74
57
|
|
|
@@ -78,7 +61,7 @@ export { customUtilitiesPlugin } from './plugins/skeleton.js';
|
|
|
78
61
|
// Essential utility functions for design system implementation
|
|
79
62
|
|
|
80
63
|
export {
|
|
81
|
-
|
|
64
|
+
designTokensToRootCssVars,
|
|
82
65
|
getRootCssDesignWidth,
|
|
83
66
|
getRootCssDesignHeight,
|
|
84
67
|
getAllRootScalingVars
|
|
@@ -94,4 +77,4 @@ export { toStateClasses } from './utils/states.js';
|
|
|
94
77
|
export {
|
|
95
78
|
enableContainerScaling,
|
|
96
79
|
enableScalingUI
|
|
97
|
-
} from './utils/scaling.js';
|
|
80
|
+
} from './utils/scaling.js';
|
|
@@ -33,9 +33,11 @@
|
|
|
33
33
|
* ]
|
|
34
34
|
* };
|
|
35
35
|
*
|
|
36
|
-
* @param {
|
|
37
|
-
* @param {
|
|
36
|
+
* @param {object} _ - Tailwind plugin API
|
|
37
|
+
* @param {function} _.addUtilities - Function to add utilities
|
|
38
|
+
* @param {*} _.theme
|
|
38
39
|
*/
|
|
39
40
|
export function customUtilitiesPlugin({ addUtilities, theme }: {
|
|
40
41
|
addUtilities: Function;
|
|
42
|
+
theme: any;
|
|
41
43
|
}): void;
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
* ]
|
|
34
34
|
* };
|
|
35
35
|
*
|
|
36
|
-
* @param {
|
|
37
|
-
* @param {
|
|
36
|
+
* @param {object} _ - Tailwind plugin API
|
|
37
|
+
* @param {function} _.addUtilities - Function to add utilities
|
|
38
|
+
* @param {*} _.theme
|
|
38
39
|
*/
|
|
39
40
|
export function customUtilitiesPlugin({ addUtilities, theme }) {
|
|
40
41
|
const fontFamilyUtilities = {
|
|
@@ -1,32 +1,45 @@
|
|
|
1
|
-
@define-mixin component-button-text {
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
/* Type-based styling for text buttons */
|
|
3
|
+
[data-component='button'][data-type='text'] {
|
|
4
|
+
/* Typography settings */
|
|
5
|
+
@apply type-ui-md-dark;
|
|
6
|
+
@apply uppercase;
|
|
7
|
+
@apply whitespace-nowrap;
|
|
8
|
+
|
|
9
|
+
/* Size settings */
|
|
10
|
+
|
|
11
|
+
&[data-size='sm'] {
|
|
12
|
+
@apply rounded-sm;
|
|
13
|
+
@apply type-ui-sm-dark;
|
|
14
|
+
@apply py-2ut px-8ut;
|
|
15
|
+
min-width: var(--btn-min-width);
|
|
16
|
+
min-height: var(--btn-min-height);
|
|
17
|
+
}
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
&[data-size='md'] {
|
|
20
|
+
@apply rounded-sm;
|
|
21
|
+
@apply type-ui-md-dark;
|
|
22
|
+
@apply py-4ut px-8ut;
|
|
23
|
+
min-width: var(--btn-min-width);
|
|
24
|
+
min-height: var(--btn-min-height);
|
|
25
|
+
}
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
&[data-size='lg'] {
|
|
28
|
+
@apply rounded-sm;
|
|
29
|
+
@apply type-ui-lg-dark;
|
|
30
|
+
@apply py-8ut px-16ut;
|
|
31
|
+
min-width: var(--btn-min-width);
|
|
32
|
+
min-height: var(--btn-min-height);
|
|
33
|
+
}
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
/* Role-specific text adjustments */
|
|
36
|
+
&[data-role='primary'] {
|
|
37
|
+
color: var(--btn-primary-text);
|
|
38
|
+
@apply font-extrabold;
|
|
30
39
|
}
|
|
31
40
|
|
|
41
|
+
&[data-role='secondary'] {
|
|
42
|
+
color: var(--btn-secondary-text);
|
|
43
|
+
@apply font-bold;
|
|
44
|
+
}
|
|
32
45
|
}
|