@viraui/react 0.0.16 → 0.0.17

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 (154) hide show
  1. package/dist/catalog.json +6 -0
  2. package/dist/components/avatar/avatar.css +1 -55
  3. package/dist/components/avatar/avatar.d.ts +1 -2
  4. package/dist/components/avatar/avatar.js +49 -14
  5. package/dist/components/avatar/avatar.module.js +7 -0
  6. package/dist/components/avatar/index.d.ts +2 -2
  7. package/dist/components/basic-input/basic-input.css +1 -45
  8. package/dist/components/basic-input/basic-input.d.ts +0 -1
  9. package/dist/components/basic-input/basic-input.js +24 -13
  10. package/dist/components/basic-input/basic-input.module.js +3 -0
  11. package/dist/components/basic-input/field-helper-copy.d.ts +2 -1
  12. package/dist/components/basic-input/field-helper-copy.js +43 -24
  13. package/dist/components/basic-input/field-label.css +1 -0
  14. package/dist/components/basic-input/field-label.d.ts +10 -0
  15. package/dist/components/basic-input/field-label.js +24 -0
  16. package/dist/components/basic-input/field-label.module.js +3 -0
  17. package/dist/components/basic-input/index.d.ts +7 -2
  18. package/dist/components/basic-input/input-control-group.d.ts +2 -0
  19. package/dist/components/basic-input/input-control-group.js +40 -7
  20. package/dist/components/button/button.css +1 -157
  21. package/dist/components/button/button.d.ts +2 -3
  22. package/dist/components/button/button.js +100 -55
  23. package/dist/components/button/button.module.js +7 -0
  24. package/dist/components/button/index.d.ts +2 -2
  25. package/dist/components/checkbox/checkbox.css +1 -0
  26. package/dist/components/checkbox/checkbox.d.ts +65 -0
  27. package/dist/components/checkbox/checkbox.guide.json +22 -0
  28. package/dist/components/checkbox/checkbox.js +73 -0
  29. package/dist/components/checkbox/checkbox.module.js +10 -0
  30. package/dist/components/checkbox/index.d.ts +2 -0
  31. package/dist/components/clamp-text/clamp-text.css +1 -12
  32. package/dist/components/clamp-text/clamp-text.d.ts +1 -2
  33. package/dist/components/clamp-text/clamp-text.js +27 -22
  34. package/dist/components/clamp-text/clamp-text.module.js +3 -0
  35. package/dist/components/clamp-text/index.d.ts +2 -2
  36. package/dist/components/elevator/elevator.d.ts +5 -5
  37. package/dist/components/elevator/elevator.js +27 -27
  38. package/dist/components/elevator/index.d.ts +2 -2
  39. package/dist/components/icon/icon.css +1 -7
  40. package/dist/components/icon/icon.d.ts +2 -3
  41. package/dist/components/icon/icon.js +18 -9
  42. package/dist/components/icon/icon.module.js +3 -0
  43. package/dist/components/icon/index.d.ts +2 -2
  44. package/dist/components/icon-button/icon-button.d.ts +2 -2
  45. package/dist/components/icon-button/icon-button.js +10 -3
  46. package/dist/components/icon-button/index.d.ts +2 -2
  47. package/dist/components/index.d.ts +18 -17
  48. package/dist/components/select/index.d.ts +2 -2
  49. package/dist/components/select/select-group.d.ts +1 -1
  50. package/dist/components/select/select-group.js +37 -9
  51. package/dist/components/select/select-indicator-slot.js +33 -10
  52. package/dist/components/select/select-option.d.ts +1 -1
  53. package/dist/components/select/select-option.js +40 -10
  54. package/dist/components/select/select-separator.js +14 -6
  55. package/dist/components/select/select.css +1 -193
  56. package/dist/components/select/select.d.ts +10 -11
  57. package/dist/components/select/select.js +156 -32
  58. package/dist/components/select/select.module.js +19 -0
  59. package/dist/components/skeleton/index.d.ts +2 -2
  60. package/dist/components/skeleton/skeleton.css +1 -36
  61. package/dist/components/skeleton/skeleton.d.ts +2 -3
  62. package/dist/components/skeleton/skeleton.js +26 -15
  63. package/dist/components/skeleton/skeleton.module.js +6 -0
  64. package/dist/components/slider/index.d.ts +2 -2
  65. package/dist/components/slider/slider-control.d.ts +1 -2
  66. package/dist/components/slider/slider-control.js +43 -19
  67. package/dist/components/slider/slider-utils.js +6 -3
  68. package/dist/components/slider/slider.css +1 -64
  69. package/dist/components/slider/slider.d.ts +5 -8
  70. package/dist/components/slider/slider.js +83 -17
  71. package/dist/components/slider/slider.module.js +12 -0
  72. package/dist/components/spinner/index.d.ts +2 -2
  73. package/dist/components/spinner/spinner.css +1 -45
  74. package/dist/components/spinner/spinner.d.ts +1 -2
  75. package/dist/components/spinner/spinner.js +29 -6
  76. package/dist/components/spinner/spinner.module.js +7 -0
  77. package/dist/components/stack/index.d.ts +2 -2
  78. package/dist/components/stack/stack.css +1 -57
  79. package/dist/components/stack/stack.d.ts +2 -3
  80. package/dist/components/stack/stack.js +40 -36
  81. package/dist/components/stack/stack.module.js +3 -0
  82. package/dist/components/surface/index.d.ts +2 -2
  83. package/dist/components/surface/surface.css +1 -70
  84. package/dist/components/surface/surface.d.ts +10 -6
  85. package/dist/components/surface/surface.js +43 -40
  86. package/dist/components/surface/surface.module.js +6 -0
  87. package/dist/components/switch/index.d.ts +2 -2
  88. package/dist/components/switch/switch.css +1 -73
  89. package/dist/components/switch/switch.d.ts +17 -5
  90. package/dist/components/switch/switch.js +59 -13
  91. package/dist/components/switch/switch.module.js +7 -0
  92. package/dist/components/text/index.d.ts +2 -2
  93. package/dist/components/text/text.css +1 -145
  94. package/dist/components/text/text.d.ts +8 -3
  95. package/dist/components/text/text.js +46 -41
  96. package/dist/components/text/text.module.js +3 -0
  97. package/dist/components/textarea/index.d.ts +2 -2
  98. package/dist/components/textarea/textarea.css +1 -45
  99. package/dist/components/textarea/textarea.d.ts +3 -4
  100. package/dist/components/textarea/textarea.js +51 -11
  101. package/dist/components/textarea/textarea.module.js +7 -0
  102. package/dist/components/textfield/index.d.ts +2 -2
  103. package/dist/components/textfield/textfield.css +1 -87
  104. package/dist/components/textfield/textfield.d.ts +3 -4
  105. package/dist/components/textfield/textfield.js +58 -12
  106. package/dist/components/textfield/textfield.module.js +9 -0
  107. package/dist/components/title/index.d.ts +2 -2
  108. package/dist/components/title/title.css +1 -137
  109. package/dist/components/title/title.d.ts +8 -3
  110. package/dist/components/title/title.js +44 -39
  111. package/dist/components/title/title.module.js +3 -0
  112. package/dist/consumption.json +6 -2
  113. package/dist/core/elevation/elevation-types.js +6 -3
  114. package/dist/core/elevation/get-elevation-props.d.ts +1 -1
  115. package/dist/core/elevation/get-elevation-props.js +14 -11
  116. package/dist/core/props/intrinsic-vira-props.js +12 -9
  117. package/dist/core/styles/resolve-axis-padding.d.ts +1 -1
  118. package/dist/core/styles/resolve-axis-padding.js +15 -16
  119. package/dist/core/theme/resolve-theme-value.d.ts +1 -1
  120. package/dist/core/theme/resolve-theme-value.js +7 -6
  121. package/dist/index.d.ts +2 -2
  122. package/dist/index.js +21 -1
  123. package/dist/internal-icons/icon-registry.d.ts +242 -239
  124. package/dist/internal-icons/icon-registry.js +247 -238
  125. package/dist/internal-icons/icons/duo/Magnifier.d.ts +7 -0
  126. package/dist/internal-icons/icons/duo/Magnifier.js +13 -0
  127. package/dist/internal-icons/icons/duo/Minus.d.ts +7 -0
  128. package/dist/internal-icons/icons/duo/Minus.js +13 -0
  129. package/dist/internal-icons/icons/duo/Plus.d.ts +7 -0
  130. package/dist/internal-icons/icons/duo/Plus.js +13 -0
  131. package/dist/internal-icons/icons/duo/index.d.ts +241 -238
  132. package/dist/internal-icons/icons/duo/index.js +241 -238
  133. package/dist/preflight.css +1 -1
  134. package/package.json +10 -9
  135. package/dist/components/avatar/index.js +0 -1
  136. package/dist/components/basic-input/index.js +0 -1
  137. package/dist/components/button/index.js +0 -1
  138. package/dist/components/clamp-text/index.js +0 -1
  139. package/dist/components/elevator/index.js +0 -1
  140. package/dist/components/icon/index.js +0 -1
  141. package/dist/components/icon-button/index.js +0 -1
  142. package/dist/components/index.js +0 -17
  143. package/dist/components/select/index.js +0 -1
  144. package/dist/components/skeleton/index.js +0 -1
  145. package/dist/components/slider/index.js +0 -1
  146. package/dist/components/slider/slider-control.css +0 -71
  147. package/dist/components/spinner/index.js +0 -1
  148. package/dist/components/stack/index.js +0 -1
  149. package/dist/components/surface/index.js +0 -1
  150. package/dist/components/switch/index.js +0 -1
  151. package/dist/components/text/index.js +0 -1
  152. package/dist/components/textarea/index.js +0 -1
  153. package/dist/components/textfield/index.js +0 -1
  154. package/dist/components/title/index.js +0 -1
@@ -1,137 +1 @@
1
- @scope (.Title) {
2
- :scope {
3
- /*
4
- * Fluid heading scale (web.dev baseline pattern).
5
- * Foundation refs: --font-scale-body-medium (fluid base), --font-heading-typescale, --font-scale-* bounds.
6
- */
7
- --title-medium: clamp(
8
- var(--font-scale-body-medium),
9
- calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 12 + 0.24cqi),
10
- calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 3)
11
- );
12
-
13
- --title-font-size: clamp(
14
- var(--font-scale-h2),
15
- calc(var(--title-medium) * pow(var(--font-heading-typescale), 5)),
16
- var(--font-scale-h1)
17
- );
18
-
19
- /* --- typography --- */
20
- --title-font-family: var(--font-family-heading);
21
- --title-font-weight: 500;
22
- --title-font-width: 100;
23
- --title-font-opsz: 16;
24
- --title-line-height: var(--font-leading-standard);
25
- --title-letter-spacing: -0.03em;
26
-
27
- /* --- layout defaults --- */
28
- --title-align: start;
29
- --title-max-width: none;
30
- --title-white-space: normal;
31
- --title-padding-inline-start: 0;
32
- --title-padding-inline-end: 0;
33
- --title-padding-block-start: 0;
34
- --title-padding-block-end: 0;
35
-
36
- margin: 0;
37
- max-inline-size: var(--title-max-width);
38
- font-family: var(--title-font-family);
39
- font-size: var(--title-font-size);
40
- line-height: var(--title-line-height);
41
- letter-spacing: var(--title-letter-spacing);
42
- text-align: var(--title-align);
43
- white-space: var(--title-white-space);
44
- word-break: break-word;
45
- font-optical-sizing: auto;
46
- font-variation-settings:
47
- 'wght' var(--title-font-weight),
48
- 'wdth' var(--title-font-width),
49
- 'opsz' var(--title-font-opsz);
50
- text-box: var(--title-trim) var(--title-trim-type);
51
- display: inline-flex;
52
-
53
- &[data-title-balanced='true'] {
54
- text-wrap: balance;
55
- }
56
-
57
- &[data-title-has-padding='true'] {
58
- padding: var(--title-padding-block-start) var(--title-padding-inline-end) var(--title-padding-block-end)
59
- var(--title-padding-inline-start);
60
- }
61
-
62
- /* --- level overrides --- */
63
- &[data-title-level='display'] {
64
- --title-font-size: clamp(
65
- var(--font-scale-h1),
66
- calc(var(--font-scale-h1) + 4.643cqi - 0.9286rem),
67
- var(--font-scale-display)
68
- );
69
- }
70
-
71
- &[data-title-level='h1'] {
72
- --title-font-size: clamp(
73
- var(--font-scale-h2),
74
- calc(var(--title-medium) * pow(var(--font-heading-typescale), 5)),
75
- var(--font-scale-h1)
76
- );
77
- }
78
-
79
- &[data-title-level='h2'] {
80
- --title-font-size: clamp(
81
- var(--font-scale-h3),
82
- calc(var(--title-medium) * pow(var(--font-heading-typescale), 4)),
83
- var(--font-scale-h2)
84
- );
85
- }
86
-
87
- &[data-title-level='h3'] {
88
- --title-font-size: clamp(
89
- var(--font-scale-h4),
90
- calc(var(--title-medium) * pow(var(--font-heading-typescale), 3)),
91
- var(--font-scale-h3)
92
- );
93
- }
94
-
95
- &[data-title-level='h4'] {
96
- --title-font-size: clamp(
97
- var(--font-scale-h5),
98
- calc(var(--title-medium) * pow(var(--font-heading-typescale), 2)),
99
- var(--font-scale-h4)
100
- );
101
- }
102
-
103
- &[data-title-level='h5'] {
104
- --title-font-size: clamp(
105
- var(--font-scale-h6),
106
- calc(var(--title-medium) * pow(var(--font-heading-typescale), 1)),
107
- var(--font-scale-h5)
108
- );
109
- --title-letter-spacing: -0.02em;
110
- }
111
-
112
- &[data-title-level='h6'] {
113
- --title-font-size: clamp(var(--font-scale-body-medium), var(--title-medium), var(--font-scale-h6));
114
- --title-letter-spacing: -0.02em;
115
- }
116
-
117
- &[data-title-has-literal-color='true'] {
118
- color: var(--title-literal-color);
119
- }
120
-
121
- &[data-title-line-height='none'] {
122
- --title-line-height: 0;
123
- }
124
-
125
- &[data-title-line-height='x-small'] {
126
- --title-line-height: var(--font-leading-x-small);
127
- }
128
-
129
- &[data-title-line-height='small'] {
130
- --title-line-height: var(--font-leading-small);
131
- }
132
-
133
- &[data-title-line-height='large'] {
134
- --title-line-height: var(--font-leading-large);
135
- }
136
- }
137
- }
1
+ .title-module_Title_CXMUX{--title-medium:clamp(var(--font-scale-body-medium),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 12 + 0.24cqi),calc(var(--font-scale-body-medium) + var(--font-scale-body-x-small) / 3));--title-font-size:clamp(var(--font-scale-h2),calc(var(--title-medium) * pow(var(--font-heading-typescale), 5)),var(--font-scale-h1));--title-font-family:var(--font-family-heading);--title-font-weight:500;--title-font-width:100;--title-font-opsz:16;--title-line-height:var(--font-leading-standard);--title-letter-spacing:-0.03em;--title-align:start;--title-max-width:none;--title-white-space:normal;--title-padding-inline-start:0;--title-padding-inline-end:0;--title-padding-block-start:0;--title-padding-block-end:0;margin:0;max-inline-size:var(--title-max-width);font-family:var(--title-font-family);font-size:var(--title-font-size);line-height:var(--title-line-height);letter-spacing:var(--title-letter-spacing);text-align:var(--title-align);white-space:var(--title-white-space);word-break:break-word;font-optical-sizing:auto;font-variation-settings:"wght" var(--title-font-weight),"wdth" var(--title-font-width),"opsz" var(--title-font-opsz);text-box:var(--title-trim) var(--title-trim-type);display:inline-flex;&[data-title-balanced=true]{text-wrap:balance}&[data-title-selection=false]{-webkit-user-select:none;user-select:none}&[data-title-has-padding=true]{padding:var(--title-padding-block-start) var(--title-padding-inline-end) var(--title-padding-block-end) var(--title-padding-inline-start)}&[data-title-level=display]{--title-font-size:clamp(var(--font-scale-h1),calc(var(--font-scale-h1) + 4.643cqi - 0.9286rem),var(--font-scale-display))}&[data-title-level=h1]{--title-font-size:clamp(var(--font-scale-h2),calc(var(--title-medium) * pow(var(--font-heading-typescale), 5)),var(--font-scale-h1))}&[data-title-level=h2]{--title-font-size:clamp(var(--font-scale-h3),calc(var(--title-medium) * pow(var(--font-heading-typescale), 4)),var(--font-scale-h2))}&[data-title-level=h3]{--title-font-size:clamp(var(--font-scale-h4),calc(var(--title-medium) * pow(var(--font-heading-typescale), 3)),var(--font-scale-h3))}&[data-title-level=h4]{--title-font-size:clamp(var(--font-scale-h5),calc(var(--title-medium) * pow(var(--font-heading-typescale), 2)),var(--font-scale-h4))}&[data-title-level=h5]{--title-font-size:clamp(var(--font-scale-h6),calc(var(--title-medium) * pow(var(--font-heading-typescale), 1)),var(--font-scale-h5));--title-letter-spacing:-0.02em}&[data-title-level=h6]{--title-font-size:clamp(var(--font-scale-body-medium),var(--title-medium),var(--font-scale-h6));--title-letter-spacing:-0.02em}&[data-title-has-literal-color=true]{color:var(--title-literal-color)}&[data-title-line-height=none]{--title-line-height:0}&[data-title-line-height=x-small]{--title-line-height:var(--font-leading-x-small)}&[data-title-line-height=small]{--title-line-height:var(--font-leading-small)}&[data-title-line-height=large]{--title-line-height:var(--font-leading-large)}}
@@ -1,8 +1,7 @@
1
1
  import { useRender } from '@base-ui/react/use-render';
2
- import type { ThemeTypes } from '@viraui/foundation/vira/types';
2
+ import { ThemeTypes } from '@viraui/foundation/vira/types';
3
+ import { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props';
3
4
  import type * as React from 'react';
4
- import './title.css';
5
- import type { IntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
6
5
  type TitleSpace = ThemeTypes['space'];
7
6
  type TitleAxisPadding = TitleSpace | [TitleSpace | 0, TitleSpace | 0];
8
7
  /**
@@ -76,6 +75,12 @@ export type TitleProps = React.ComponentPropsWithoutRef<'span'> & IntrinsicViraP
76
75
  * @default false
77
76
  */
78
77
  balanced?: boolean;
78
+ /**
79
+ * Enables text selection on the rendered copy.
80
+ *
81
+ * @default true
82
+ */
83
+ selection?: boolean;
79
84
  /**
80
85
  * Sets inline padding using one token for both sides or a `[start, end]` tuple.
81
86
  *
@@ -1,41 +1,46 @@
1
- 'use client';
2
- import { useRender } from '@base-ui/react/use-render';
3
- import { extractIntrinsicViraProps } from '../../core/props/intrinsic-vira-props.js';
4
- import { resolveAxisPadding } from '../../core/styles/resolve-axis-padding.js';
5
- import { clsx } from 'clsx';
6
1
  import './title.css';
7
- export const Title = ({ align = 'start', balanced = false, className, color, fontWidth, hPadding, level = 'h1', lineHeight = 'standard', maxWidth, opticalSize, ref, render, style, trim = 'both', trimType = 'cap alphabetic', vPadding, weight, whiteSpace = 'normal', ...otherProps }) => {
8
- const hasPadding = Boolean(hPadding || vPadding);
9
- const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
10
- const dynamicStyle = {
11
- '--title-align': align,
12
- '--title-max-width': maxWidth ?? 'none',
13
- '--title-literal-color': color,
14
- '--title-white-space': whiteSpace,
15
- '--title-trim': trim ? `trim-${trim}` : 'initial',
16
- '--title-trim-type': trim ? trimType : 'initial',
17
- ...(typeof weight === 'number' ? { '--title-font-weight': weight } : {}),
18
- ...(fontWidth !== undefined ? { '--title-font-width': fontWidth } : {}),
19
- ...(opticalSize !== undefined ? { '--title-font-opsz': opticalSize } : {}),
20
- ...resolveAxisPadding(hPadding, '--title-padding-inline-start', '--title-padding-inline-end'),
21
- ...resolveAxisPadding(vPadding, '--title-padding-block-start', '--title-padding-block-end'),
22
- ...style,
23
- };
24
- return useRender({
25
- defaultTagName: 'span',
26
- render,
27
- ref,
28
- props: {
29
- ...componentProps,
30
- ...intrinsicAttributes,
31
- 'data-title-level': level,
32
- 'data-title-weight': weight !== undefined ? 'custom' : 'preset',
33
- 'data-title-line-height': lineHeight,
34
- 'data-title-balanced': balanced ? 'true' : 'false',
35
- 'data-title-has-padding': hasPadding ? 'true' : 'false',
36
- 'data-title-has-literal-color': color ? 'true' : 'false',
37
- className: clsx('Title', className),
38
- style: dynamicStyle,
39
- },
40
- });
2
+ "use client";
3
+ import { extractIntrinsicViraProps } from "../../core/props/intrinsic-vira-props.js";
4
+ import { resolveAxisPadding } from "../../core/styles/resolve-axis-padding.js";
5
+ import title_module_default from "./title.module.js";
6
+ import { clsx } from "clsx";
7
+ import { useRender } from "@base-ui/react/use-render";
8
+ //#region src/components/title/title.tsx
9
+ var Title = ({ align = "start", balanced = false, selection = true, className, color, fontWidth, hPadding, level = "h1", lineHeight = "standard", maxWidth, opticalSize, ref, render, style, trim = "both", trimType = "cap alphabetic", vPadding, weight, whiteSpace = "normal", ...otherProps }) => {
10
+ const hasPadding = Boolean(hPadding || vPadding);
11
+ const { componentProps, intrinsicAttributes } = extractIntrinsicViraProps(otherProps);
12
+ const dynamicStyle = {
13
+ "--title-align": align,
14
+ "--title-max-width": maxWidth ?? "none",
15
+ "--title-literal-color": color,
16
+ "--title-white-space": whiteSpace,
17
+ "--title-trim": trim ? `trim-${trim}` : "initial",
18
+ "--title-trim-type": trim ? trimType : "initial",
19
+ ...typeof weight === "number" ? { "--title-font-weight": weight } : {},
20
+ ...fontWidth !== void 0 ? { "--title-font-width": fontWidth } : {},
21
+ ...opticalSize !== void 0 ? { "--title-font-opsz": opticalSize } : {},
22
+ ...resolveAxisPadding(hPadding, "--title-padding-inline-start", "--title-padding-inline-end"),
23
+ ...resolveAxisPadding(vPadding, "--title-padding-block-start", "--title-padding-block-end"),
24
+ ...style
25
+ };
26
+ return useRender({
27
+ defaultTagName: "span",
28
+ render,
29
+ ref,
30
+ props: {
31
+ ...componentProps,
32
+ ...intrinsicAttributes,
33
+ "data-title-level": level,
34
+ "data-title-weight": weight !== void 0 ? "custom" : "preset",
35
+ "data-title-line-height": lineHeight,
36
+ "data-title-balanced": balanced ? "true" : "false",
37
+ "data-title-selection": selection ? "true" : "false",
38
+ "data-title-has-padding": hasPadding ? "true" : "false",
39
+ "data-title-has-literal-color": color ? "true" : "false",
40
+ className: clsx(title_module_default.Title, className),
41
+ style: dynamicStyle
42
+ }
43
+ });
41
44
  };
45
+ //#endregion
46
+ export { Title };
@@ -0,0 +1,3 @@
1
+ var title_module_default = { Title: "title-module_Title_CXMUX" };
2
+ //#endregion
3
+ export { title_module_default as default };
@@ -14,9 +14,13 @@
14
14
  "Consumer font CSS or @font-face rules matching theme font-family strings (for example @fontsource-variable packages)",
15
15
  "@viraui/react/preflight.css"
16
16
  ],
17
+ "componentCss": {
18
+ "rule": "Import public components from the @viraui/react root barrel. Component CSS follows the JS module graph through side-effect CSS imports.",
19
+ "optionalExplicitImport": "@viraui/react/<component>.css for tree-shaking or debugging only; not part of default bootstrap."
20
+ },
17
21
  "importMechanism": {
18
- "rule": "Load theme CSS, font CSS, and preflight through JavaScript side-effect imports in the app root entry module.",
19
- "forbidden": "Do not bootstrap Vira theme, font, or preflight CSS with CSS @import in a global stylesheet."
22
+ "rule": "Load theme CSS, font CSS, and preflight through JavaScript side-effect imports in the app root entry module. Import public components from the @viraui/react root barrel; component CSS follows the emitted JavaScript module graph and is not part of bootstrap.",
23
+ "forbidden": "Do not bootstrap Vira theme, font, or preflight CSS with CSS @import in a global stylesheet. Do not require per-component CSS imports in app bootstrap."
20
24
  },
21
25
  "nextJsAppRouter": {
22
26
  "mandatory": true,
@@ -1,4 +1,7 @@
1
- export const ELEVATION_DEFAULTS = {
2
- direction: 'bottom',
3
- shadowColor: 'oklch(0% 0 0)',
1
+ //#region src/core/elevation/elevation-types.ts
2
+ var ELEVATION_DEFAULTS = {
3
+ direction: "bottom",
4
+ shadowColor: "oklch(0% 0 0)"
4
5
  };
6
+ //#endregion
7
+ export { ELEVATION_DEFAULTS };
@@ -1,5 +1,5 @@
1
+ import { ElevationConfig, ElevationDirection, ElevationLevel } from './elevation-types';
1
2
  import type * as React from 'react';
2
- import { type ElevationConfig, type ElevationDirection, type ElevationLevel } from './elevation-types.js';
3
3
  export type ElevationAttributes = {
4
4
  'data-elevation': ElevationLevel;
5
5
  'data-elevation-direction': ElevationDirection;
@@ -1,12 +1,15 @@
1
- import { ELEVATION_DEFAULTS, } from './elevation-types.js';
2
- export const getElevationProps = ({ resting, hover, direction = ELEVATION_DEFAULTS.direction, shadowColor = ELEVATION_DEFAULTS.shadowColor, extraShadow, }) => ({
3
- attributes: {
4
- 'data-elevation': resting,
5
- 'data-elevation-direction': direction,
6
- ...(hover !== undefined ? { 'data-elevation-hover': hover } : {}),
7
- },
8
- style: {
9
- '--shadow-color': shadowColor,
10
- ...(extraShadow !== undefined ? { '--extra-shadow': extraShadow } : {}),
11
- },
1
+ import { ELEVATION_DEFAULTS } from "./elevation-types.js";
2
+ //#region src/core/elevation/get-elevation-props.ts
3
+ var getElevationProps = ({ resting, hover, direction = ELEVATION_DEFAULTS.direction, shadowColor = ELEVATION_DEFAULTS.shadowColor, extraShadow }) => ({
4
+ attributes: {
5
+ "data-elevation": resting,
6
+ "data-elevation-direction": direction,
7
+ ...hover !== void 0 ? { "data-elevation-hover": hover } : {}
8
+ },
9
+ style: {
10
+ "--shadow-color": shadowColor,
11
+ ...extraShadow !== void 0 ? { "--extra-shadow": extraShadow } : {}
12
+ }
12
13
  });
14
+ //#endregion
15
+ export { getElevationProps };
@@ -1,10 +1,13 @@
1
- export const extractIntrinsicViraProps = (props) => {
2
- const { grow, shrink, ...componentProps } = props;
3
- return {
4
- componentProps,
5
- intrinsicAttributes: {
6
- ...(grow === false ? { 'data-grow': 'false' } : {}),
7
- ...(shrink === false ? { 'data-shrink': 'false' } : {}),
8
- },
9
- };
1
+ //#region src/core/props/intrinsic-vira-props.ts
2
+ var extractIntrinsicViraProps = (props) => {
3
+ const { grow, shrink, ...componentProps } = props;
4
+ return {
5
+ componentProps,
6
+ intrinsicAttributes: {
7
+ ...grow === false ? { "data-grow": "false" } : {},
8
+ ...shrink === false ? { "data-shrink": "false" } : {}
9
+ }
10
+ };
10
11
  };
12
+ //#endregion
13
+ export { extractIntrinsicViraProps };
@@ -1,4 +1,4 @@
1
- import type { ThemeTypes } from '@viraui/foundation/vira/types';
1
+ import { ThemeTypes } from '@viraui/foundation/vira/types';
2
2
  import type * as React from 'react';
3
3
  type AxisPadding = ThemeTypes['space'] | [ThemeTypes['space'] | 0, ThemeTypes['space'] | 0];
4
4
  export declare const resolveAxisPadding: (value: AxisPadding | undefined, startKey: string, endKey: string) => React.CSSProperties;
@@ -1,17 +1,16 @@
1
- import { resolveThemeValue } from '../../core/theme/resolve-theme-value.js';
2
- export const resolveAxisPadding = (value, startKey, endKey) => {
3
- if (!value) {
4
- return {};
5
- }
6
- if (Array.isArray(value)) {
7
- return {
8
- [startKey]: resolveThemeValue(value[0], 'space', 0),
9
- [endKey]: resolveThemeValue(value[1], 'space', 0),
10
- };
11
- }
12
- const resolvedValue = resolveThemeValue(value, 'space', 0);
13
- return {
14
- [startKey]: resolvedValue,
15
- [endKey]: resolvedValue,
16
- };
1
+ import { resolveThemeValue } from "../theme/resolve-theme-value.js";
2
+ //#region src/core/styles/resolve-axis-padding.ts
3
+ var resolveAxisPadding = (value, startKey, endKey) => {
4
+ if (!value) return {};
5
+ if (Array.isArray(value)) return {
6
+ [startKey]: resolveThemeValue(value[0], "space", 0),
7
+ [endKey]: resolveThemeValue(value[1], "space", 0)
8
+ };
9
+ const resolvedValue = resolveThemeValue(value, "space", 0);
10
+ return {
11
+ [startKey]: resolvedValue,
12
+ [endKey]: resolvedValue
13
+ };
17
14
  };
15
+ //#endregion
16
+ export { resolveAxisPadding };
@@ -1,4 +1,4 @@
1
- import theme from '@viraui/foundation/vira/nested';
1
+ import { default as theme } from '@viraui/foundation/vira/nested';
2
2
  type ThemeTree = typeof theme;
3
3
  type ThemeKey = keyof ThemeTree;
4
4
  export declare const resolveThemeValue: <TKey extends ThemeKey, TValue extends keyof ThemeTree[TKey], TFallback>(key: TValue | null | undefined | 0, themeKey: TKey, fallbackValue: TFallback) => ThemeTree[TKey][TValue] | TFallback;
@@ -1,7 +1,8 @@
1
- import theme from '@viraui/foundation/vira/nested';
2
- export const resolveThemeValue = (key, themeKey, fallbackValue) => {
3
- if (!key) {
4
- return fallbackValue;
5
- }
6
- return theme[themeKey][key];
1
+ import theme from "@viraui/foundation/vira/nested";
2
+ //#region src/core/theme/resolve-theme-value.ts
3
+ var resolveThemeValue = (key, themeKey, fallbackValue) => {
4
+ if (!key) return fallbackValue;
5
+ return theme[themeKey][key];
7
6
  };
7
+ //#endregion
8
+ export { resolveThemeValue };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './components/index.js';
2
- export type { IntrinsicViraProps } from './core/props/intrinsic-vira-props.js';
1
+ export * from './components';
2
+ export type { IntrinsicViraProps } from './core/props/intrinsic-vira-props';
package/dist/index.js CHANGED
@@ -1 +1,21 @@
1
- export * from './components/index.js';
1
+ import { Avatar } from "./components/avatar/avatar.js";
2
+ import { ClampText } from "./components/clamp-text/clamp-text.js";
3
+ import { ELEVATION_DEFAULTS } from "./core/elevation/elevation-types.js";
4
+ import { getElevationProps } from "./core/elevation/get-elevation-props.js";
5
+ import { Elevator } from "./components/elevator/elevator.js";
6
+ import { Spinner } from "./components/spinner/spinner.js";
7
+ import { Button } from "./components/button/button.js";
8
+ import { IconButton } from "./components/icon-button/icon-button.js";
9
+ import { Text } from "./components/text/text.js";
10
+ import { Textfield } from "./components/textfield/textfield.js";
11
+ import { Stack } from "./components/stack/stack.js";
12
+ import { Textarea } from "./components/textarea/textarea.js";
13
+ import { Slider } from "./components/slider/slider.js";
14
+ import { Switch } from "./components/switch/switch.js";
15
+ import { Checkbox } from "./components/checkbox/checkbox.js";
16
+ import { Icon } from "./components/icon/icon.js";
17
+ import { Select } from "./components/select/select.js";
18
+ import { Skeleton } from "./components/skeleton/skeleton.js";
19
+ import { Surface } from "./components/surface/surface.js";
20
+ import { Title } from "./components/title/title.js";
21
+ export { Avatar, Button, Checkbox, ClampText, ELEVATION_DEFAULTS, Elevator, Icon, IconButton, Select, Skeleton, Slider, Spinner, Stack, Surface, Switch, Text, Textarea, Textfield, Title, getElevationProps };