@gild-ui/vue 0.0.0 → 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -2
  3. package/dist/Button.cjs +238 -0
  4. package/dist/Button.d.cts +17 -0
  5. package/dist/Button.d.mts +17 -0
  6. package/dist/Button.mjs +237 -0
  7. package/dist/Button.types-BnJ28ym9.d.mts +1113 -0
  8. package/dist/Flex.cjs +25 -0
  9. package/dist/Flex.d.cts +11 -0
  10. package/dist/Flex.d.mts +11 -0
  11. package/dist/Flex.mjs +24 -0
  12. package/dist/Modal.cjs +369 -0
  13. package/dist/Modal.d.cts +23 -0
  14. package/dist/Modal.d.mts +23 -0
  15. package/dist/Modal.mjs +368 -0
  16. package/dist/TextInput.cjs +299 -0
  17. package/dist/TextInput.d.cts +37 -0
  18. package/dist/TextInput.d.mts +37 -0
  19. package/dist/TextInput.mjs +298 -0
  20. package/dist/ThemeProvider-CareN7BO.mjs +58 -0
  21. package/dist/ThemeProvider-DIeSdYou.cjs +63 -0
  22. package/dist/ThemeProvider.cjs +3 -0
  23. package/dist/ThemeProvider.d.cts +25 -0
  24. package/dist/ThemeProvider.d.mts +25 -0
  25. package/dist/ThemeProvider.mjs +1 -0
  26. package/dist/Typography.cjs +72 -0
  27. package/dist/Typography.d.cts +15 -0
  28. package/dist/Typography.d.mts +15 -0
  29. package/dist/Typography.mjs +71 -0
  30. package/dist/View.cjs +12 -0
  31. package/dist/View.d.cts +11 -0
  32. package/dist/View.d.mts +11 -0
  33. package/dist/View.mjs +11 -0
  34. package/dist/ViewRoot-CsaIxrtD.mjs +40 -0
  35. package/dist/ViewRoot-X9F9RROv.cjs +45 -0
  36. package/dist/bridge-D-x2kK4r.d.mts +36 -0
  37. package/dist/bridge-t6zHXVt-.d.cts +36 -0
  38. package/dist/engine.cjs +82 -0
  39. package/dist/engine.d.cts +46 -0
  40. package/dist/engine.d.mts +46 -0
  41. package/dist/engine.mjs +26 -0
  42. package/dist/index.cjs +57 -0
  43. package/dist/index.d.cts +37 -0
  44. package/dist/index.d.mts +37 -0
  45. package/dist/index.mjs +6 -0
  46. package/dist/props-BRLGZVjJ.d.mts +21 -0
  47. package/dist/props-Bzm7Wbdv.d.cts +21 -0
  48. package/dist/props-DDBSpAkG.mjs +49 -0
  49. package/dist/props-DxoB9cT4.cjs +72 -0
  50. package/dist/styled-Cmxvlft5.mjs +34 -0
  51. package/dist/styled-JHkZtq_1.cjs +39 -0
  52. package/dist/themes-BqxOUMCB.cjs +12 -0
  53. package/dist/themes-CgFrk0_b.d.cts +1112 -0
  54. package/dist/themes-rGHVhV5e.mjs +8 -0
  55. package/dist/useDefaultProps--fOGOSGa.mjs +18 -0
  56. package/dist/useDefaultProps-qCDgeYFm.cjs +23 -0
  57. package/dist/useTheme.cjs +8 -0
  58. package/dist/useTheme.d.cts +3 -0
  59. package/dist/useTheme.d.mts +3 -0
  60. package/dist/useTheme.mjs +1 -0
  61. package/package.json +167 -4
@@ -0,0 +1,71 @@
1
+ import { r as styled$1 } from "./styled-Cmxvlft5.mjs";
2
+ import { r as rootProps, t as declare } from "./props-DDBSpAkG.mjs";
3
+ import { defineComponent, h } from "vue";
4
+ import { useTheme } from "@umber-style/vue";
5
+ import { createShouldForwardProp, props } from "@soroush.tech/styled-system/should-forward-prop";
6
+ import { border, flexbox, layout, position, space, system, typography } from "@soroush.tech/styled-system";
7
+ // src/Typography/Typography.ts
8
+ const shouldForwardProp = createShouldForwardProp([
9
+ ...props,
10
+ "noWrap",
11
+ "gutterBottom",
12
+ "align",
13
+ "textTransform"
14
+ ]);
15
+ const colorSystem = system({
16
+ color: {
17
+ property: "color",
18
+ scale: "text"
19
+ },
20
+ bg: {
21
+ property: "backgroundColor",
22
+ scale: "background"
23
+ },
24
+ opacity: { property: "opacity" },
25
+ textTransform: { property: "textTransform" }
26
+ });
27
+ const typographyVariants = ({ variant = "body1", theme }) => {
28
+ const { fontSize, fontWeight, letterSpacing, textTransform } = theme.typography[variant];
29
+ return {
30
+ ...fontSize !== void 0 && { fontSize: theme.fontSizes[fontSize] },
31
+ ...fontWeight && { fontWeight: theme.fontWeights[fontWeight] },
32
+ ...letterSpacing && { letterSpacing: theme.letterSpacings[letterSpacing] },
33
+ ...textTransform && { textTransform }
34
+ };
35
+ };
36
+ const TypographyBase = styled$1("p", {
37
+ name: "Typography",
38
+ label: "Typography",
39
+ shouldForwardProp,
40
+ systemProps: [
41
+ space,
42
+ layout,
43
+ colorSystem,
44
+ typography,
45
+ flexbox,
46
+ border,
47
+ position
48
+ ]
49
+ })(typographyVariants, ({ align }) => align ? { textAlign: align } : {}, ({ gutterBottom }) => gutterBottom ? { marginBottom: "0.5em" } : {}, ({ noWrap }) => noWrap ? {
50
+ overflow: "hidden",
51
+ textOverflow: "ellipsis",
52
+ whiteSpace: "nowrap"
53
+ } : {});
54
+ const Typography = defineComponent((props, { attrs, slots }) => {
55
+ const theme = useTheme();
56
+ return () => {
57
+ const variant = props.variant ?? "body1";
58
+ const element = props.as ?? theme.value.typography[variant].element;
59
+ return h(TypographyBase, {
60
+ as: element,
61
+ variant,
62
+ ...rootProps(props, attrs)
63
+ }, slots);
64
+ };
65
+ }, {
66
+ name: "Typography",
67
+ inheritAttrs: false,
68
+ props: declare("variant", "align", "gutterBottom", "noWrap", "as", "slotProps", "style"),
69
+ slots: {}
70
+ });
71
+ export { Typography };
package/dist/View.cjs ADDED
@@ -0,0 +1,12 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_ViewRoot = require("./ViewRoot-X9F9RROv.cjs");
3
+ const require_props = require("./props-DxoB9cT4.cjs");
4
+ let vue = require("vue");
5
+ // src/View/View.ts
6
+ const View = (0, vue.defineComponent)((props, { attrs, slots }) => () => (0, vue.h)(require_ViewRoot.ViewRoot, require_props.rootProps(props, attrs), slots), {
7
+ name: "View",
8
+ inheritAttrs: false,
9
+ props: require_props.declare("slotProps", "style"),
10
+ slots: {}
11
+ });
12
+ exports.View = View;
@@ -0,0 +1,11 @@
1
+ import { n as SharedProps, r as Slot, t as Listeners } from "./props-Bzm7Wbdv.cjs";
2
+ import { B as ViewProps$1, F as ViewBorderColorToken, H as ViewThemeConfig, I as ViewBorderRadiusToken, L as ViewBorderWidthToken, P as ViewBackgroundToken, R as ViewColorToken, V as ViewSlot, z as ViewOwnerState } from "./themes-CgFrk0_b.cjs";
3
+ import { HTMLAttributes, SlotsType } from "vue";
4
+ /** The props of `View`: the shared props of `@gild-ui/react`, and a listener for each DOM event of the element. */
5
+ export type ViewProps = SharedProps<ViewProps$1> & Listeners<HTMLAttributes>;
6
+ /** The slots of the `View` component: the content. */
7
+ export interface ViewSlots {
8
+ default?: Slot;
9
+ }
10
+ export declare const View: import("vue").DefineSetupFnComponent<ViewProps, Record<never, never>, SlotsType<ViewSlots>, SharedProps<ViewProps$1, never> & Pick<HTMLAttributes, "onAbort" | "onAnimationcancel" | "onAnimationend" | "onAnimationiteration" | "onAnimationstart" | "onAuxclick" | "onBeforeinput" | "onBeforetoggle" | "onBlur" | "onCanplay" | "onCanplaythrough" | "onChange" | "onClick" | "onCompositionend" | "onCompositionstart" | "onCompositionupdate" | "onContextmenu" | "onCopy" | "onCut" | "onDblclick" | "onDrag" | "onDragend" | "onDragenter" | "onDragexit" | "onDragleave" | "onDragover" | "onDragstart" | "onDrop" | "onDurationchange" | "onEmptied" | "onEncrypted" | "onEnded" | "onError" | "onFocus" | "onFocusin" | "onFocusout" | "onFormdata" | "onFullscreenchange" | "onFullscreenerror" | "onGotpointercapture" | "onInput" | "onInvalid" | "onKeydown" | "onKeypress" | "onKeyup" | "onLoad" | "onLoadeddata" | "onLoadedmetadata" | "onLoadstart" | "onLostpointercapture" | "onMousedown" | "onMouseenter" | "onMouseleave" | "onMousemove" | "onMouseout" | "onMouseover" | "onMouseup" | "onPaste" | "onPause" | "onPlay" | "onPlaying" | "onPointercancel" | "onPointerdown" | "onPointerenter" | "onPointerleave" | "onPointermove" | "onPointerout" | "onPointerover" | "onPointerup" | "onProgress" | "onRatechange" | "onReset" | "onScroll" | "onScrollend" | "onSecuritypolicyviolation" | "onSeeked" | "onSeeking" | "onSelect" | "onStalled" | "onSubmit" | "onSuspend" | "onTimeupdate" | "onToggle" | "onTouchcancel" | "onTouchend" | "onTouchmove" | "onTouchstart" | "onTransitioncancel" | "onTransitionend" | "onTransitionrun" | "onTransitionstart" | "onVolumechange" | "onWaiting" | "onWheel"> & Pick<HTMLAttributes, "class"> & {}, import("vue").PublicProps>;
11
+ export type { ViewBackgroundToken, ViewBorderColorToken, ViewBorderRadiusToken, ViewBorderWidthToken, ViewColorToken, ViewOwnerState, ViewSlot, ViewThemeConfig };
@@ -0,0 +1,11 @@
1
+ import { n as SharedProps, r as Slot, t as Listeners } from "./props-BRLGZVjJ.mjs";
2
+ import { G as ViewBorderColorToken, J as ViewColorToken, K as ViewBorderRadiusToken, Q as ViewThemeConfig, W as ViewBackgroundToken, X as ViewProps$1, Y as ViewOwnerState, Z as ViewSlot, q as ViewBorderWidthToken } from "./Button.types-BnJ28ym9.mjs";
3
+ import { HTMLAttributes, SlotsType } from "vue";
4
+ /** The props of `View`: the shared props of `@gild-ui/react`, and a listener for each DOM event of the element. */
5
+ export type ViewProps = SharedProps<ViewProps$1> & Listeners<HTMLAttributes>;
6
+ /** The slots of the `View` component: the content. */
7
+ export interface ViewSlots {
8
+ default?: Slot;
9
+ }
10
+ export declare const View: import("vue").DefineSetupFnComponent<ViewProps, Record<never, never>, SlotsType<ViewSlots>, SharedProps<ViewProps$1, never> & Pick<HTMLAttributes, "onAbort" | "onAnimationcancel" | "onAnimationend" | "onAnimationiteration" | "onAnimationstart" | "onAuxclick" | "onBeforeinput" | "onBeforetoggle" | "onBlur" | "onCanplay" | "onCanplaythrough" | "onChange" | "onClick" | "onCompositionend" | "onCompositionstart" | "onCompositionupdate" | "onContextmenu" | "onCopy" | "onCut" | "onDblclick" | "onDrag" | "onDragend" | "onDragenter" | "onDragexit" | "onDragleave" | "onDragover" | "onDragstart" | "onDrop" | "onDurationchange" | "onEmptied" | "onEncrypted" | "onEnded" | "onError" | "onFocus" | "onFocusin" | "onFocusout" | "onFormdata" | "onFullscreenchange" | "onFullscreenerror" | "onGotpointercapture" | "onInput" | "onInvalid" | "onKeydown" | "onKeypress" | "onKeyup" | "onLoad" | "onLoadeddata" | "onLoadedmetadata" | "onLoadstart" | "onLostpointercapture" | "onMousedown" | "onMouseenter" | "onMouseleave" | "onMousemove" | "onMouseout" | "onMouseover" | "onMouseup" | "onPaste" | "onPause" | "onPlay" | "onPlaying" | "onPointercancel" | "onPointerdown" | "onPointerenter" | "onPointerleave" | "onPointermove" | "onPointerout" | "onPointerover" | "onPointerup" | "onProgress" | "onRatechange" | "onReset" | "onScroll" | "onScrollend" | "onSecuritypolicyviolation" | "onSeeked" | "onSeeking" | "onSelect" | "onStalled" | "onSubmit" | "onSuspend" | "onTimeupdate" | "onToggle" | "onTouchcancel" | "onTouchend" | "onTouchmove" | "onTouchstart" | "onTransitioncancel" | "onTransitionend" | "onTransitionrun" | "onTransitionstart" | "onVolumechange" | "onWaiting" | "onWheel"> & Pick<HTMLAttributes, "class"> & {}, import("vue").PublicProps>;
11
+ export type { ViewBackgroundToken, ViewBorderColorToken, ViewBorderRadiusToken, ViewBorderWidthToken, ViewColorToken, ViewOwnerState, ViewSlot, ViewThemeConfig };
package/dist/View.mjs ADDED
@@ -0,0 +1,11 @@
1
+ import { t as ViewRoot } from "./ViewRoot-CsaIxrtD.mjs";
2
+ import { r as rootProps, t as declare } from "./props-DDBSpAkG.mjs";
3
+ import { defineComponent, h } from "vue";
4
+ // src/View/View.ts
5
+ const View = defineComponent((props, { attrs, slots }) => () => h(ViewRoot, rootProps(props, attrs), slots), {
6
+ name: "View",
7
+ inheritAttrs: false,
8
+ props: declare("slotProps", "style"),
9
+ slots: {}
10
+ });
11
+ export { View };
@@ -0,0 +1,40 @@
1
+ import { r as styled } from "./styled-Cmxvlft5.mjs";
2
+ import { createShouldForwardProp, props } from "@soroush.tech/styled-system/should-forward-prop";
3
+ import { border, layout, layoutFrame, position, space, span, system, typography } from "@soroush.tech/styled-system";
4
+ // src/View/ViewRoot.ts
5
+ const shouldForwardProp = createShouldForwardProp([
6
+ ...props,
7
+ "cursor",
8
+ "order",
9
+ "layout"
10
+ ]);
11
+ const colorSystem = system({
12
+ bg: {
13
+ property: "backgroundColor",
14
+ scale: "background"
15
+ },
16
+ borderColor: {
17
+ property: "borderColor",
18
+ scale: "border"
19
+ },
20
+ opacity: { property: "opacity" },
21
+ cursor: { property: "cursor" },
22
+ order: { property: "order" }
23
+ });
24
+ /** The styled element a `View` renders, which `Flex` and `Modal` style again. */
25
+ const ViewRoot = styled("div", {
26
+ name: "View",
27
+ label: "View",
28
+ shouldForwardProp,
29
+ systemProps: [
30
+ space,
31
+ layout,
32
+ typography,
33
+ border,
34
+ colorSystem,
35
+ position,
36
+ span,
37
+ layoutFrame
38
+ ]
39
+ })();
40
+ export { ViewRoot as t };
@@ -0,0 +1,45 @@
1
+ const require_styled = require("./styled-JHkZtq_1.cjs");
2
+ let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
3
+ let _soroush_tech_styled_system = require("@soroush.tech/styled-system");
4
+ // src/View/ViewRoot.ts
5
+ const shouldForwardProp = (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
6
+ ..._soroush_tech_styled_system_should_forward_prop.props,
7
+ "cursor",
8
+ "order",
9
+ "layout"
10
+ ]);
11
+ const colorSystem = (0, _soroush_tech_styled_system.system)({
12
+ bg: {
13
+ property: "backgroundColor",
14
+ scale: "background"
15
+ },
16
+ borderColor: {
17
+ property: "borderColor",
18
+ scale: "border"
19
+ },
20
+ opacity: { property: "opacity" },
21
+ cursor: { property: "cursor" },
22
+ order: { property: "order" }
23
+ });
24
+ /** The styled element a `View` renders, which `Flex` and `Modal` style again. */
25
+ const ViewRoot = require_styled.styled("div", {
26
+ name: "View",
27
+ label: "View",
28
+ shouldForwardProp,
29
+ systemProps: [
30
+ _soroush_tech_styled_system.space,
31
+ _soroush_tech_styled_system.layout,
32
+ _soroush_tech_styled_system.typography,
33
+ _soroush_tech_styled_system.border,
34
+ colorSystem,
35
+ _soroush_tech_styled_system.position,
36
+ _soroush_tech_styled_system.span,
37
+ _soroush_tech_styled_system.layoutFrame
38
+ ]
39
+ })();
40
+ Object.defineProperty(exports, "ViewRoot", {
41
+ enumerable: true,
42
+ get: function() {
43
+ return ViewRoot;
44
+ }
45
+ });
@@ -0,0 +1,36 @@
1
+ import { p as GildTheme } from "./Button.types-BnJ28ym9.mjs";
2
+ import * as GildCore from "@gild-ui/core/theme";
3
+ type GildFallback = GildCore.Register extends {
4
+ themes: unknown;
5
+ } ? Record<never, never> : GildTheme;
6
+ declare module '@umber-style/core' {
7
+ interface Register extends GildCore.Register {}
8
+ interface Theme extends GildFallback {}
9
+ }
10
+ type GildStyleThemes = GildCore.Register extends {
11
+ themes: infer Themes;
12
+ } ? {
13
+ themes: Themes;
14
+ } : Record<never, never>;
15
+ interface GildStyleRegister extends GildStyleThemes {
16
+ defaultValues: {
17
+ space: 'strict';
18
+ sizes: 'wide';
19
+ colors: 'strict';
20
+ fontSizes: 'strict';
21
+ fontWeights: 'strict';
22
+ lineHeights: 'strict';
23
+ letterSpacings: 'strict';
24
+ fonts: 'strict';
25
+ borders: 'strict';
26
+ borderStyles: 'strict';
27
+ borderWidths: 'strict';
28
+ radii: 'strict';
29
+ shadows: 'strict';
30
+ zIndices: 'strict';
31
+ };
32
+ }
33
+ declare module '@soroush.tech/styled-system' {
34
+ interface Register extends GildStyleRegister {}
35
+ }
36
+ export {};
@@ -0,0 +1,36 @@
1
+ import { r as GildTheme } from "./themes-CgFrk0_b.cjs";
2
+ import * as GildCore from "@gild-ui/core/theme";
3
+ type GildFallback = GildCore.Register extends {
4
+ themes: unknown;
5
+ } ? Record<never, never> : GildTheme;
6
+ declare module '@umber-style/core' {
7
+ interface Register extends GildCore.Register {}
8
+ interface Theme extends GildFallback {}
9
+ }
10
+ type GildStyleThemes = GildCore.Register extends {
11
+ themes: infer Themes;
12
+ } ? {
13
+ themes: Themes;
14
+ } : Record<never, never>;
15
+ interface GildStyleRegister extends GildStyleThemes {
16
+ defaultValues: {
17
+ space: 'strict';
18
+ sizes: 'wide';
19
+ colors: 'strict';
20
+ fontSizes: 'strict';
21
+ fontWeights: 'strict';
22
+ lineHeights: 'strict';
23
+ letterSpacings: 'strict';
24
+ fonts: 'strict';
25
+ borders: 'strict';
26
+ borderStyles: 'strict';
27
+ borderWidths: 'strict';
28
+ radii: 'strict';
29
+ shadows: 'strict';
30
+ zIndices: 'strict';
31
+ };
32
+ }
33
+ declare module '@soroush.tech/styled-system' {
34
+ interface Register extends GildStyleRegister {}
35
+ }
36
+ export {};
@@ -0,0 +1,82 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_themes = require("./themes-BqxOUMCB.cjs");
3
+ let _umber_style_vue = require("@umber-style/vue");
4
+ let _umber_style_cache = require("@umber-style/cache");
5
+ let _umber_style_core = require("@umber-style/core");
6
+ // src/engine/styleCache.ts
7
+ /**
8
+ * The library's own cache, the one `configure` gives the engine unless the app brings its own: the
9
+ * same key and options as `styleCache` of `@gild-ui/react`, so a class has the same name in both
10
+ * packages. `nonce` is the page's own, read from its scripts so the style element passes a style policy
11
+ * that allows style elements by nonce; an empty string means no nonce.
12
+ */
13
+ const styleCache = (0, _umber_style_cache.createCache)({
14
+ key: "soroush",
15
+ hasStyleMemo: true,
16
+ hasColorFallbacks: false,
17
+ nonce: typeof document === "undefined" ? void 0 : document.querySelector("script[nonce]")?.nonce || void 0
18
+ });
19
+ // src/engine/configure.ts
20
+ function configure({ serverTheme, cache, prefix } = {}) {
21
+ (0, _umber_style_vue.configure)({
22
+ cache: cache ?? styleCache,
23
+ prefix,
24
+ serverTheme: serverTheme ?? require_themes.baseTheme
25
+ });
26
+ }
27
+ Object.defineProperty(exports, "asIs", {
28
+ enumerable: true,
29
+ get: function() {
30
+ return _umber_style_vue.asIs;
31
+ }
32
+ });
33
+ exports.configure = configure;
34
+ Object.defineProperty(exports, "createCache", {
35
+ enumerable: true,
36
+ get: function() {
37
+ return _umber_style_cache.createCache;
38
+ }
39
+ });
40
+ Object.defineProperty(exports, "defineTheme", {
41
+ enumerable: true,
42
+ get: function() {
43
+ return _umber_style_vue.defineTheme;
44
+ }
45
+ });
46
+ Object.defineProperty(exports, "extractPageStyles", {
47
+ enumerable: true,
48
+ get: function() {
49
+ return _umber_style_core.extractPageStyles;
50
+ }
51
+ });
52
+ Object.defineProperty(exports, "fallback", {
53
+ enumerable: true,
54
+ get: function() {
55
+ return _umber_style_vue.fallback;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, "globalStyles", {
59
+ enumerable: true,
60
+ get: function() {
61
+ return _umber_style_vue.globalStyles;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, "setNonceSource", {
65
+ enumerable: true,
66
+ get: function() {
67
+ return _umber_style_vue.setNonceSource;
68
+ }
69
+ });
70
+ exports.styleCache = styleCache;
71
+ Object.defineProperty(exports, "val", {
72
+ enumerable: true,
73
+ get: function() {
74
+ return _umber_style_vue.val;
75
+ }
76
+ });
77
+ Object.defineProperty(exports, "variable", {
78
+ enumerable: true,
79
+ get: function() {
80
+ return _umber_style_vue.variable;
81
+ }
82
+ });
@@ -0,0 +1,46 @@
1
+ import "./bridge-t6zHXVt-.cjs";
2
+ import { i as Theme$1, t as AppTheme } from "./themes-CgFrk0_b.cjs";
3
+ import { Register } from "@gild-ui/core/theme";
4
+ import { extractPageStyles } from "@umber-style/core";
5
+ import { createCache } from "@umber-style/cache";
6
+ import { Cache, UmberCache, asIs, defineTheme, fallback, globalStyles, setNonceSource, val, variable } from "@umber-style/vue";
7
+ /**
8
+ * Once themes are registered, `T` may have no key the registered themes lack, at any depth: each
9
+ * extra key is typed `never`, so the error names it. `components` is the one shared value, which
10
+ * `defineThemes` already checked.
11
+ */
12
+ type Exact<T, Shape> = keyof Register extends never ? unknown : Same<T, Shape>;
13
+ type Same<T, Shape> = T extends readonly unknown[] | ((...args: never[]) => unknown) | string | number | boolean | null | undefined ? T : { [K in keyof T]: K extends 'components' ? T[K] : K extends keyof Shape ? Same<T[K], NonNullable<Shape[K]>> : never; };
14
+ interface ConfigureOwnProps<T> {
15
+ /** The theme of anything with no provider above it: the server render, and the first render. Defaults to the built-in `baseTheme`. */
16
+ serverTheme?: T & Exact<T, AppTheme>;
17
+ /** The cache every rule is written to. Defaults to `styleCache`, the library's own. */
18
+ cache?: Cache;
19
+ /** The class prefix. It is the prefix of the cache, which is `soroush` for `styleCache`, so leave it out unless the cache is your own. */
20
+ prefix?: string;
21
+ }
22
+ /** The options once the app registers its themes: it has no built-in theme to fall back to, so `serverTheme` is required. */
23
+ interface RegisteredConfigureProps<T> extends Omit<ConfigureOwnProps<T>, 'serverTheme'> {
24
+ /** The theme of anything with no provider above it: the server render, and the first render. */
25
+ serverTheme: T & Exact<T, AppTheme>;
26
+ }
27
+ type ConfigureOptions<T = Theme$1> = Register extends {
28
+ themes: unknown;
29
+ } ? RegisteredConfigureProps<T> : ConfigureOwnProps<T>;
30
+ /**
31
+ * Configures the styling engine, once for the whole program, in the `setup` module of the app:
32
+ * `configure({ serverTheme: themes.light })`. `serverTheme` is the theme of anything with no provider
33
+ * above it - the page until the browser mounts - so pass the same one on the server and in the browser.
34
+ * Every entry of the app may call it: the same options again do nothing.
35
+ */
36
+ export declare function configure<T extends Theme$1 = Theme$1>(...args: Register extends {
37
+ themes: unknown;
38
+ } ? [options: Readonly<RegisteredConfigureProps<T>>] : [options?: Readonly<ConfigureOwnProps<T>>]): void;
39
+ /**
40
+ * The library's own cache, the one `configure` gives the engine unless the app brings its own: the
41
+ * same key and options as `styleCache` of `@gild-ui/react`, so a class has the same name in both
42
+ * packages. `nonce` is the page's own, read from its scripts so the style element passes a style policy
43
+ * that allows style elements by nonce; an empty string means no nonce.
44
+ */
45
+ declare const styleCache: UmberCache;
46
+ export { type ConfigureOptions, asIs, createCache, defineTheme, extractPageStyles, fallback, globalStyles, setNonceSource, styleCache, val, variable };
@@ -0,0 +1,46 @@
1
+ import "./bridge-D-x2kK4r.mjs";
2
+ import { d as AppTheme, m as Theme$1 } from "./Button.types-BnJ28ym9.mjs";
3
+ import { Cache, UmberCache, asIs, defineTheme, fallback, globalStyles, setNonceSource, val, variable } from "@umber-style/vue";
4
+ import { Register } from "@gild-ui/core/theme";
5
+ import { createCache } from "@umber-style/cache";
6
+ import { extractPageStyles } from "@umber-style/core";
7
+ /**
8
+ * Once themes are registered, `T` may have no key the registered themes lack, at any depth: each
9
+ * extra key is typed `never`, so the error names it. `components` is the one shared value, which
10
+ * `defineThemes` already checked.
11
+ */
12
+ type Exact<T, Shape> = keyof Register extends never ? unknown : Same<T, Shape>;
13
+ type Same<T, Shape> = T extends readonly unknown[] | ((...args: never[]) => unknown) | string | number | boolean | null | undefined ? T : { [K in keyof T]: K extends 'components' ? T[K] : K extends keyof Shape ? Same<T[K], NonNullable<Shape[K]>> : never; };
14
+ interface ConfigureOwnProps<T> {
15
+ /** The theme of anything with no provider above it: the server render, and the first render. Defaults to the built-in `baseTheme`. */
16
+ serverTheme?: T & Exact<T, AppTheme>;
17
+ /** The cache every rule is written to. Defaults to `styleCache`, the library's own. */
18
+ cache?: Cache;
19
+ /** The class prefix. It is the prefix of the cache, which is `soroush` for `styleCache`, so leave it out unless the cache is your own. */
20
+ prefix?: string;
21
+ }
22
+ /** The options once the app registers its themes: it has no built-in theme to fall back to, so `serverTheme` is required. */
23
+ interface RegisteredConfigureProps<T> extends Omit<ConfigureOwnProps<T>, 'serverTheme'> {
24
+ /** The theme of anything with no provider above it: the server render, and the first render. */
25
+ serverTheme: T & Exact<T, AppTheme>;
26
+ }
27
+ type ConfigureOptions<T = Theme$1> = Register extends {
28
+ themes: unknown;
29
+ } ? RegisteredConfigureProps<T> : ConfigureOwnProps<T>;
30
+ /**
31
+ * Configures the styling engine, once for the whole program, in the `setup` module of the app:
32
+ * `configure({ serverTheme: themes.light })`. `serverTheme` is the theme of anything with no provider
33
+ * above it - the page until the browser mounts - so pass the same one on the server and in the browser.
34
+ * Every entry of the app may call it: the same options again do nothing.
35
+ */
36
+ export declare function configure<T extends Theme$1 = Theme$1>(...args: Register extends {
37
+ themes: unknown;
38
+ } ? [options: Readonly<RegisteredConfigureProps<T>>] : [options?: Readonly<ConfigureOwnProps<T>>]): void;
39
+ /**
40
+ * The library's own cache, the one `configure` gives the engine unless the app brings its own: the
41
+ * same key and options as `styleCache` of `@gild-ui/react`, so a class has the same name in both
42
+ * packages. `nonce` is the page's own, read from its scripts so the style element passes a style policy
43
+ * that allows style elements by nonce; an empty string means no nonce.
44
+ */
45
+ declare const styleCache: UmberCache;
46
+ export { type ConfigureOptions, asIs, createCache, defineTheme, extractPageStyles, fallback, globalStyles, setNonceSource, styleCache, val, variable };
@@ -0,0 +1,26 @@
1
+ import { t as baseTheme } from "./themes-rGHVhV5e.mjs";
2
+ import { asIs, configure as configure$1, defineTheme, fallback, globalStyles, setNonceSource, val, variable } from "@umber-style/vue";
3
+ import { createCache, createCache as createCache$1 } from "@umber-style/cache";
4
+ import { extractPageStyles } from "@umber-style/core";
5
+ // src/engine/styleCache.ts
6
+ /**
7
+ * The library's own cache, the one `configure` gives the engine unless the app brings its own: the
8
+ * same key and options as `styleCache` of `@gild-ui/react`, so a class has the same name in both
9
+ * packages. `nonce` is the page's own, read from its scripts so the style element passes a style policy
10
+ * that allows style elements by nonce; an empty string means no nonce.
11
+ */
12
+ const styleCache = createCache$1({
13
+ key: "soroush",
14
+ hasStyleMemo: true,
15
+ hasColorFallbacks: false,
16
+ nonce: typeof document === "undefined" ? void 0 : document.querySelector("script[nonce]")?.nonce || void 0
17
+ });
18
+ // src/engine/configure.ts
19
+ function configure({ serverTheme, cache, prefix } = {}) {
20
+ configure$1({
21
+ cache: cache ?? styleCache,
22
+ prefix,
23
+ serverTheme: serverTheme ?? baseTheme
24
+ });
25
+ }
26
+ export { asIs, configure, createCache, defineTheme, extractPageStyles, fallback, globalStyles, setNonceSource, styleCache, val, variable };
package/dist/index.cjs ADDED
@@ -0,0 +1,57 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_ThemeProvider = require("./ThemeProvider-DIeSdYou.cjs");
3
+ require("./useTheme.cjs");
4
+ const require_useDefaultProps = require("./useDefaultProps-qCDgeYFm.cjs");
5
+ const require_styled = require("./styled-JHkZtq_1.cjs");
6
+ let _umber_style_vue = require("@umber-style/vue");
7
+ Object.defineProperty(exports, "Global", {
8
+ enumerable: true,
9
+ get: function() {
10
+ return _umber_style_vue.Global;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "StyleSheet", {
14
+ enumerable: true,
15
+ get: function() {
16
+ return _umber_style_vue.StyleSheet;
17
+ }
18
+ });
19
+ exports.ThemeProvider = require_ThemeProvider.ThemeProvider;
20
+ Object.defineProperty(exports, "alpha", {
21
+ enumerable: true,
22
+ get: function() {
23
+ return _umber_style_vue.alpha;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "css", {
27
+ enumerable: true,
28
+ get: function() {
29
+ return _umber_style_vue.css;
30
+ }
31
+ });
32
+ Object.defineProperty(exports, "keyframes", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return _umber_style_vue.keyframes;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, "negate", {
39
+ enumerable: true,
40
+ get: function() {
41
+ return _umber_style_vue.negate;
42
+ }
43
+ });
44
+ exports.styled = require_styled.styled;
45
+ exports.useDefaultProps = require_useDefaultProps.useDefaultProps;
46
+ Object.defineProperty(exports, "useStyle", {
47
+ enumerable: true,
48
+ get: function() {
49
+ return _umber_style_vue.useStyle;
50
+ }
51
+ });
52
+ Object.defineProperty(exports, "useTheme", {
53
+ enumerable: true,
54
+ get: function() {
55
+ return _umber_style_vue.useTheme;
56
+ }
57
+ });
@@ -0,0 +1,37 @@
1
+ import { ThemeProvider, ThemeProviderProps } from "./ThemeProvider.cjs";
2
+ import { useTheme } from "./useTheme.cjs";
3
+ import { $ as SlotOverride, a as ThemeComponents, et as SlotProps, n as ComponentConfig, tt as StyleOverride } from "./themes-CgFrk0_b.cjs";
4
+ import { Global, Interpolation, StyleSheet, StyledComponent, StyledOptions, alpha, css, keyframes, negate, useStyle } from "@umber-style/vue";
5
+ import { Component, ComputedRef } from "vue";
6
+ type DefaultPropsOf<N extends keyof ThemeComponents> = Partial<NonNullable<NonNullable<ThemeComponents[N]>['$owner']>>;
7
+ /**
8
+ * The theme-contributed default prop values for a component
9
+ * (`theme.components[name].defaultProps`), or an empty object, reactive. Call it in `setup`.
10
+ *
11
+ * Components apply it as one step of the default-resolution chain:
12
+ * explicit prop -> `useDefaultProps` -> `theme.defaults.*` -> literal fallback.
13
+ */
14
+ export declare function useDefaultProps<N extends keyof ThemeComponents>(name: N): ComputedRef<DefaultPropsOf<N>>;
15
+ /**
16
+ * The design system's additions to the engine's styled options, as `style/styled.ts` of `@gild-ui/react`
17
+ * has them. A styled root that passes `name` becomes theme-customizable: `theme.components[name]` may
18
+ * contribute `styleOverrides` (per `slot`) and `variants`, appended after the component's own styles so
19
+ * the theme wins the cascade. Roots without `name` are plain `styled`.
20
+ */
21
+ interface ThemeCustomizationOptions {
22
+ /** `theme.components` key enabling styleOverrides/variants for this root. */
23
+ name?: string;
24
+ /** The `styleOverrides` slot this root maps to. Default: `'root'`. */
25
+ slot?: string;
26
+ /**
27
+ * Styled-system prop parsers (`space`, `layout`, ...) appended AFTER the theme override resolver, so
28
+ * per-instance props (`m`, `p`, `width`, ...) always beat theme `styleOverrides`.
29
+ */
30
+ systemProps?: readonly Interpolation[];
31
+ }
32
+ /**
33
+ * The design system's `styled`: the engine's styled plus theme-level component customization
34
+ * (`theme.components[name].styleOverrides` / `.variants`).
35
+ */
36
+ export declare function styled(tag: string | Component, options?: StyledOptions & ThemeCustomizationOptions): <Props extends object = Record<string, unknown>>(...styles: readonly Interpolation<Props>[]) => StyledComponent;
37
+ export { type ComponentConfig, Global, type SlotOverride, type SlotProps, type StyleOverride, StyleSheet, type ThemeComponents, ThemeProvider, ThemeProviderProps, alpha, css, keyframes, negate, useStyle, useTheme };
@@ -0,0 +1,37 @@
1
+ import { ThemeProvider, ThemeProviderProps } from "./ThemeProvider.mjs";
2
+ import { useTheme } from "./useTheme.mjs";
3
+ import { $ as SlotOverride, et as SlotProps, f as ComponentConfig, h as ThemeComponents, tt as StyleOverride } from "./Button.types-BnJ28ym9.mjs";
4
+ import { Component, ComputedRef } from "vue";
5
+ import { Global, Interpolation, StyleSheet, StyledComponent, StyledOptions, alpha, css, keyframes, negate, useStyle } from "@umber-style/vue";
6
+ type DefaultPropsOf<N extends keyof ThemeComponents> = Partial<NonNullable<NonNullable<ThemeComponents[N]>['$owner']>>;
7
+ /**
8
+ * The theme-contributed default prop values for a component
9
+ * (`theme.components[name].defaultProps`), or an empty object, reactive. Call it in `setup`.
10
+ *
11
+ * Components apply it as one step of the default-resolution chain:
12
+ * explicit prop -> `useDefaultProps` -> `theme.defaults.*` -> literal fallback.
13
+ */
14
+ export declare function useDefaultProps<N extends keyof ThemeComponents>(name: N): ComputedRef<DefaultPropsOf<N>>;
15
+ /**
16
+ * The design system's additions to the engine's styled options, as `style/styled.ts` of `@gild-ui/react`
17
+ * has them. A styled root that passes `name` becomes theme-customizable: `theme.components[name]` may
18
+ * contribute `styleOverrides` (per `slot`) and `variants`, appended after the component's own styles so
19
+ * the theme wins the cascade. Roots without `name` are plain `styled`.
20
+ */
21
+ interface ThemeCustomizationOptions {
22
+ /** `theme.components` key enabling styleOverrides/variants for this root. */
23
+ name?: string;
24
+ /** The `styleOverrides` slot this root maps to. Default: `'root'`. */
25
+ slot?: string;
26
+ /**
27
+ * Styled-system prop parsers (`space`, `layout`, ...) appended AFTER the theme override resolver, so
28
+ * per-instance props (`m`, `p`, `width`, ...) always beat theme `styleOverrides`.
29
+ */
30
+ systemProps?: readonly Interpolation[];
31
+ }
32
+ /**
33
+ * The design system's `styled`: the engine's styled plus theme-level component customization
34
+ * (`theme.components[name].styleOverrides` / `.variants`).
35
+ */
36
+ export declare function styled(tag: string | Component, options?: StyledOptions & ThemeCustomizationOptions): <Props extends object = Record<string, unknown>>(...styles: readonly Interpolation<Props>[]) => StyledComponent;
37
+ export { type ComponentConfig, Global, type SlotOverride, type SlotProps, type StyleOverride, StyleSheet, type ThemeComponents, ThemeProvider, ThemeProviderProps, alpha, css, keyframes, negate, useStyle, useTheme };
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import { t as ThemeProvider } from "./ThemeProvider-CareN7BO.mjs";
2
+ import { useTheme } from "./useTheme.mjs";
3
+ import { t as useDefaultProps } from "./useDefaultProps--fOGOSGa.mjs";
4
+ import { r as styled } from "./styled-Cmxvlft5.mjs";
5
+ import { Global, StyleSheet, alpha, css, keyframes, negate, useStyle } from "@umber-style/vue";
6
+ export { Global, StyleSheet, ThemeProvider, alpha, css, keyframes, negate, styled, useDefaultProps, useStyle, useTheme };