@viraui/react 0.0.15 → 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 (155) 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 -156
  21. package/dist/components/button/button.d.ts +3 -3
  22. package/dist/components/button/button.js +104 -14
  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 -140
  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 -127
  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 +8 -4
  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-surface.json +160 -0
  134. package/dist/preflight.css +1 -1
  135. package/package.json +11 -9
  136. package/dist/components/avatar/index.js +0 -1
  137. package/dist/components/basic-input/index.js +0 -1
  138. package/dist/components/button/index.js +0 -1
  139. package/dist/components/clamp-text/index.js +0 -1
  140. package/dist/components/elevator/index.js +0 -1
  141. package/dist/components/icon/index.js +0 -1
  142. package/dist/components/icon-button/index.js +0 -1
  143. package/dist/components/index.js +0 -17
  144. package/dist/components/select/index.js +0 -1
  145. package/dist/components/skeleton/index.js +0 -1
  146. package/dist/components/slider/index.js +0 -1
  147. package/dist/components/slider/slider-control.css +0 -71
  148. package/dist/components/spinner/index.js +0 -1
  149. package/dist/components/stack/index.js +0 -1
  150. package/dist/components/surface/index.js +0 -1
  151. package/dist/components/switch/index.js +0 -1
  152. package/dist/components/text/index.js +0 -1
  153. package/dist/components/textarea/index.js +0 -1
  154. package/dist/components/textfield/index.js +0 -1
  155. package/dist/components/title/index.js +0 -1
@@ -1,127 +1 @@
1
- @scope (.Title) {
2
- :scope {
3
- /* --- fluid scale --- */
4
- --title-scale-min-vw: 320;
5
- --title-scale-max-vw: 1440;
6
- --title-scale-progress: clamp(
7
- 0,
8
- (100vw - calc(var(--title-scale-min-vw) * 1px)) /
9
- calc((var(--title-scale-max-vw) - var(--title-scale-min-vw)) * 1px),
10
- 1
11
- );
12
-
13
- /* Default fallback ≈ h2 → h3 */
14
- --title-font-size: calc(
15
- var(--font-scale-h3) + (var(--font-scale-h2) - var(--font-scale-h3)) * var(--title-scale-progress)
16
- );
17
-
18
- /* --- typography --- */
19
- --title-font-family: var(--font-family-heading);
20
- --title-font-weight: 500;
21
- --title-font-width: 100;
22
- --title-font-opsz: 16;
23
- --title-line-height: var(--font-leading-standard);
24
- --title-letter-spacing: -0.03em;
25
-
26
- /* --- layout defaults --- */
27
- --title-align: start;
28
- --title-max-width: none;
29
- --title-white-space: normal;
30
- --title-padding-inline-start: 0;
31
- --title-padding-inline-end: 0;
32
- --title-padding-block-start: 0;
33
- --title-padding-block-end: 0;
34
-
35
- margin: 0;
36
- max-inline-size: var(--title-max-width);
37
- font-family: var(--title-font-family);
38
- font-size: var(--title-font-size);
39
- line-height: var(--title-line-height);
40
- letter-spacing: var(--title-letter-spacing);
41
- text-align: var(--title-align);
42
- white-space: var(--title-white-space);
43
- word-break: break-word;
44
- font-optical-sizing: auto;
45
- font-variation-settings:
46
- 'wght' var(--title-font-weight),
47
- 'wdth' var(--title-font-width),
48
- 'opsz' var(--title-font-opsz);
49
- text-box: var(--title-trim) var(--title-trim-type);
50
- display: inline-flex;
51
-
52
- &[data-title-balanced='true'] {
53
- text-wrap: balance;
54
- }
55
-
56
- &[data-title-has-padding='true'] {
57
- padding: var(--title-padding-block-start) var(--title-padding-inline-end) var(--title-padding-block-end)
58
- var(--title-padding-inline-start);
59
- }
60
-
61
- /* --- level overrides --- */
62
- &[data-title-level='display'] {
63
- --title-font-size: calc(
64
- var(--font-scale-h1) + (var(--font-scale-display) - var(--font-scale-h1)) * var(--title-scale-progress)
65
- );
66
- }
67
-
68
- &[data-title-level='h1'] {
69
- --title-font-size: calc(
70
- var(--font-scale-h2) + (var(--font-scale-h1) - var(--font-scale-h2)) * var(--title-scale-progress)
71
- );
72
- }
73
-
74
- &[data-title-level='h2'] {
75
- --title-font-size: calc(
76
- var(--font-scale-h3) + (var(--font-scale-h2) - var(--font-scale-h3)) * var(--title-scale-progress)
77
- );
78
- }
79
-
80
- &[data-title-level='h3'] {
81
- --title-font-size: calc(
82
- var(--font-scale-h4) + (var(--font-scale-h3) - var(--font-scale-h4)) * var(--title-scale-progress)
83
- );
84
- }
85
-
86
- &[data-title-level='h4'] {
87
- --title-font-size: calc(
88
- var(--font-scale-h5) + (var(--font-scale-h4) - var(--font-scale-h5)) * var(--title-scale-progress)
89
- );
90
- }
91
-
92
- &[data-title-level='h5'] {
93
- --title-font-size: calc(
94
- var(--font-scale-h6) + (var(--font-scale-h5) - var(--font-scale-h6)) * var(--title-scale-progress)
95
- );
96
- --title-letter-spacing: -0.02em;
97
- }
98
-
99
- &[data-title-level='h6'] {
100
- --title-font-size: calc(
101
- var(--font-scale-body-medium) + (var(--font-scale-h6) - var(--font-scale-body-medium)) *
102
- var(--title-scale-progress)
103
- );
104
- --title-letter-spacing: -0.02em;
105
- }
106
-
107
- &[data-title-has-literal-color='true'] {
108
- color: var(--title-literal-color);
109
- }
110
-
111
- &[data-title-line-height='none'] {
112
- --title-line-height: 0;
113
- }
114
-
115
- &[data-title-line-height='x-small'] {
116
- --title-line-height: var(--font-leading-x-small);
117
- }
118
-
119
- &[data-title-line-height='small'] {
120
- --title-line-height: var(--font-leading-small);
121
- }
122
-
123
- &[data-title-line-height='large'] {
124
- --title-line-height: var(--font-leading-large);
125
- }
126
- }
127
- }
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 };
@@ -7,17 +7,20 @@
7
7
  "@base-ui/react": "Peer dependency for wrapped primitives."
8
8
  },
9
9
  "optionalPackages": {
10
- "@viraui/foundation": "Preset Vira brand theme CSS, ThemeTypes, and JSON only.",
11
- "@viraui/icons": "ViraUI icons assets when not using Icon from @viraui/react."
10
+ "@viraui/foundation": "Preset Vira brand theme CSS, ThemeTypes, and JSON only."
12
11
  },
13
12
  "importOrder": [
14
13
  "Compatible theme CSS (preset @viraui/foundation/vira.css, custom theme CSS, or future theme-builder export)",
15
14
  "Consumer font CSS or @font-face rules matching theme font-family strings (for example @fontsource-variable packages)",
16
15
  "@viraui/react/preflight.css"
17
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
+ },
18
21
  "importMechanism": {
19
- "rule": "Load theme CSS, font CSS, and preflight through JavaScript side-effect imports in the app root entry module.",
20
- "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."
21
24
  },
22
25
  "nextJsAppRouter": {
23
26
  "mandatory": true,
@@ -72,6 +75,7 @@
72
75
  "catalog": "@viraui/react/catalog.json",
73
76
  "consumption": "@viraui/react/consumption.json",
74
77
  "themeSurface": "@viraui/react/theme-surface.json",
78
+ "preflightSurface": "@viraui/react/preflight-surface.json",
75
79
  "componentGuide": "@viraui/react/<component>.guide.json"
76
80
  }
77
81
  }
@@ -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 };