@cognite/aura 0.3.2 → 0.3.4

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 (143) hide show
  1. package/DESIGN.md +134 -5
  2. package/README.md +24 -3
  3. package/dist/components/index.d.ts +5 -1
  4. package/dist/components/index.js +59 -327
  5. package/dist/components/ui/core/accordion/accordion.js +79 -114
  6. package/dist/components/ui/core/action-toolbar/action-toolbar.js +108 -176
  7. package/dist/components/ui/core/alert/alert.js +158 -206
  8. package/dist/components/ui/core/avatar/avatar.js +64 -90
  9. package/dist/components/ui/core/badge/badge.js +73 -108
  10. package/dist/components/ui/core/banner/banner.js +146 -215
  11. package/dist/components/ui/core/breadcrumb/breadcrumb.js +105 -200
  12. package/dist/components/ui/core/button/button.js +47 -52
  13. package/dist/components/ui/core/button-group/button-group.js +40 -79
  14. package/dist/components/ui/core/calendar/calendar-header.js +63 -0
  15. package/dist/components/ui/core/calendar/calendar-utils.js +39 -0
  16. package/dist/components/ui/core/calendar/calendar.js +68 -0
  17. package/dist/components/ui/core/calendar/constants.d.ts +1 -0
  18. package/dist/components/ui/core/card/card.js +102 -185
  19. package/dist/components/ui/core/chart/chart.js +116 -206
  20. package/dist/components/ui/core/chart/index.js +2 -8
  21. package/dist/components/ui/core/checkbox/checkbox.js +67 -132
  22. package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
  23. package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
  24. package/dist/components/ui/core/code-block/code-block.js +179 -267
  25. package/dist/components/ui/core/collapsible/collapsible.js +29 -49
  26. package/dist/components/ui/core/combobox/combobox.js +41 -0
  27. package/dist/components/ui/core/command/command.js +85 -150
  28. package/dist/components/ui/core/count/count.js +21 -32
  29. package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +10 -0
  30. package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +13 -0
  31. package/dist/components/ui/core/data-grid/data-grid-row.d.ts +18 -0
  32. package/dist/components/ui/core/data-grid/data-grid.d.ts +43 -0
  33. package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +12 -0
  34. package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +9 -0
  35. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
  36. package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +2 -1
  37. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
  38. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
  39. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +2 -1
  40. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
  41. package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +1 -0
  42. package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +36 -0
  43. package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +3 -0
  44. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
  45. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +7 -6
  46. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
  47. package/dist/components/ui/core/date-time-pickers/index.d.ts +3 -1
  48. package/dist/components/ui/core/date-time-pickers/index.js +6 -10
  49. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +3 -2
  50. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
  51. package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +3 -8
  52. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
  53. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
  54. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
  55. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
  56. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
  57. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
  58. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +3 -3
  59. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
  60. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
  61. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +3 -2
  62. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
  63. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +3 -2
  64. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
  65. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
  66. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
  67. package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +5 -4
  68. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
  69. package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +1 -0
  70. package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +40 -0
  71. package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +3 -0
  72. package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +1 -0
  73. package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +3 -3
  74. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
  75. package/dist/components/ui/core/dialog/dialog.js +82 -155
  76. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
  77. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
  78. package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
  79. package/dist/components/ui/core/empty-state/empty-state.js +86 -138
  80. package/dist/components/ui/core/helper-text/helper-text.js +37 -65
  81. package/dist/components/ui/core/hover-card/hover-card.js +54 -80
  82. package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
  83. package/dist/components/ui/core/input/input.js +12 -27
  84. package/dist/components/ui/core/input-group/input-group.js +76 -173
  85. package/dist/components/ui/core/kbd/kbd.js +20 -36
  86. package/dist/components/ui/core/label/label.js +26 -43
  87. package/dist/components/ui/core/loader/loader.js +80 -117
  88. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
  89. package/dist/components/ui/core/message/message.d.ts +2 -2
  90. package/dist/components/ui/core/message/message.js +316 -542
  91. package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +52 -0
  92. package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
  93. package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
  94. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  95. package/dist/components/ui/core/pagination/pagination.js +231 -334
  96. package/dist/components/ui/core/popover/popover.js +90 -157
  97. package/dist/components/ui/core/progress/progress.js +36 -61
  98. package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
  99. package/dist/components/ui/core/radio-group/radio-group.js +58 -113
  100. package/dist/components/ui/core/reasoning/reasoning.js +55 -86
  101. package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
  102. package/dist/components/ui/core/search/search.js +77 -99
  103. package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
  104. package/dist/components/ui/core/select/select.js +168 -293
  105. package/dist/components/ui/core/separator/separator.js +13 -23
  106. package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
  107. package/dist/components/ui/core/shimmer/shimmer.js +40 -107
  108. package/dist/components/ui/core/skeleton/skeleton.js +13 -18
  109. package/dist/components/ui/core/slider/slider.d.ts +9 -0
  110. package/dist/components/ui/core/slider/slider.js +40 -0
  111. package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
  112. package/dist/components/ui/core/sources/sources.d.ts +5 -1
  113. package/dist/components/ui/core/sources/sources.js +58 -79
  114. package/dist/components/ui/core/switch/switch.js +62 -0
  115. package/dist/components/ui/core/tabs/tabs.js +149 -223
  116. package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
  117. package/dist/components/ui/core/textarea/textarea.js +13 -27
  118. package/dist/components/ui/core/toggle/toggle.js +55 -74
  119. package/dist/components/ui/core/tool/tool.js +127 -163
  120. package/dist/components/ui/core/tooltip/tooltip.js +47 -86
  121. package/dist/components/ui/core/topbar/topbar.js +106 -190
  122. package/dist/eslint/index.js +5 -10
  123. package/dist/eslint/no-overriding-styles.js +178 -237
  124. package/dist/icons/index.d.ts +1 -0
  125. package/dist/icons/index.js +1 -0
  126. package/dist/index.d.ts +1 -1
  127. package/dist/lib/highlight-code.d.ts +9 -0
  128. package/dist/lib/highlight-code.js +42 -0
  129. package/dist/lib/portal-container-context.js +8 -9
  130. package/dist/lib/style-scope.js +6 -6
  131. package/dist/lib/use-controllable-state.js +21 -30
  132. package/dist/lib/utils.d.ts +0 -2
  133. package/dist/lib/utils.js +32 -112
  134. package/dist/styles.css +1 -1
  135. package/dist/styles.source.css +26 -0
  136. package/package.json +42 -8
  137. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +0 -119
  138. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +0 -93
  139. package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
  140. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +0 -52
  141. /package/dist/components/ui/core/{date-time-pickers/shared/calendar-header → calendar}/calendar-header.d.ts +0 -0
  142. /package/dist/components/ui/core/{date-time-pickers/utils → calendar}/calendar-utils.d.ts +0 -0
  143. /package/dist/components/ui/core/{date-time-pickers/shared/calendar → calendar}/calendar.d.ts +0 -0
@@ -1,262 +1,203 @@
1
- const N = /* @__PURE__ */ new Set([
2
- "@cognite/aura/components",
3
- "@cognite/aura-labs/components"
4
- ]), b = [
5
- /^(block|inline|inline-block|flex|inline-flex|grid|inline-grid|contents|hidden)$/,
6
- /^(w|h|min-w|max-w|min-h|max-h|size|aspect)-.+$/,
7
- /^(m|mx|my|mt|mr|mb|ml|ms|me)-.+$/,
8
- /^space-[xy]-.+$/,
9
- /^gap(?:-[xy])?-.+$/,
10
- /^(grow|grow-0|shrink|shrink-0)$/,
11
- /^flex-(1|auto|initial|none|row|row-reverse|col|col-reverse|wrap|wrap-reverse|nowrap)$/,
12
- /^basis-.+$/,
13
- /^order-.+$/,
14
- /^grid-(cols|rows)-.+$/,
15
- /^auto-(cols|rows)-.+$/,
16
- /^(col|row)-(auto|span-.+|start-.+|end-.+)$/,
17
- /^justify-(start|end|center|between|around|evenly|stretch|normal)$/,
18
- /^items-(start|end|center|baseline|stretch)$/,
19
- /^content-(start|end|center|between|around|evenly|stretch|baseline)$/,
20
- /^self-(auto|start|end|center|stretch|baseline)$/,
21
- /^place-(items|content|self)-.+$/,
22
- /^justify-self-.+$/,
23
- /^(overflow|overflow-x|overflow-y|overscroll|overscroll-x|overscroll-y)-.+$/,
24
- /^(whitespace|break)-.+$/,
25
- /^(text-(left|center|right|justify|wrap|nowrap|balance|pretty))$/,
26
- /^(truncate|line-clamp-.+)$/,
27
- /^(static|fixed|absolute|relative|sticky)$/,
28
- /^(inset|inset-x|inset-y|top|right|bottom|left|start|end|z)-.+$/,
29
- /^(visible|invisible|isolate)$/
1
+ //#region libs/aura/src/eslint/no-overriding-styles.ts
2
+ var e = /* @__PURE__ */ new Set(["@cognite/aura/components", "@cognite/aura-labs/components"]), t = [
3
+ /^(block|inline|inline-block|flex|inline-flex|grid|inline-grid|contents|hidden)$/,
4
+ /^(w|h|min-w|max-w|min-h|max-h|size|aspect)-.+$/,
5
+ /^(m|mx|my|mt|mr|mb|ml|ms|me)-.+$/,
6
+ /^space-[xy]-.+$/,
7
+ /^gap(?:-[xy])?-.+$/,
8
+ /^(grow|grow-0|shrink|shrink-0)$/,
9
+ /^flex-(1|auto|initial|none|row|row-reverse|col|col-reverse|wrap|wrap-reverse|nowrap)$/,
10
+ /^basis-.+$/,
11
+ /^order-.+$/,
12
+ /^grid-(cols|rows)-.+$/,
13
+ /^auto-(cols|rows)-.+$/,
14
+ /^(col|row)-(auto|span-.+|start-.+|end-.+)$/,
15
+ /^justify-(start|end|center|between|around|evenly|stretch|normal)$/,
16
+ /^items-(start|end|center|baseline|stretch)$/,
17
+ /^content-(start|end|center|between|around|evenly|stretch|baseline)$/,
18
+ /^self-(auto|start|end|center|stretch|baseline)$/,
19
+ /^place-(items|content|self)-.+$/,
20
+ /^justify-self-.+$/,
21
+ /^(overflow|overflow-x|overflow-y|overscroll|overscroll-x|overscroll-y)-.+$/,
22
+ /^(whitespace|break)-.+$/,
23
+ /^(text-(left|center|right|justify|wrap|nowrap|balance|pretty))$/,
24
+ /^(truncate|line-clamp-.+)$/,
25
+ /^(static|fixed|absolute|relative|sticky)$/,
26
+ /^(inset|inset-x|inset-y|top|right|bottom|left|start|end|z)-.+$/,
27
+ /^(visible|invisible|isolate)$/
30
28
  ];
31
- function l(e) {
32
- return typeof e == "object" && e !== null;
33
- }
34
- function h(e) {
35
- return l(e) && typeof e.type == "string";
36
- }
37
- function u(e, n) {
38
- return h(e) && e.type === n;
39
- }
40
- function p(e) {
41
- return u(e, "Literal");
42
- }
43
- function y(e) {
44
- if (!l(e))
45
- return !1;
46
- const n = e, r = Array.isArray(n.expressions) && Array.isArray(n.quasis);
47
- return u(n, "TemplateLiteral") && r;
29
+ function n(e) {
30
+ return typeof e == "object" && !!e;
48
31
  }
49
- function x(e) {
50
- return u(e, "JSXExpressionContainer") && "expression" in e;
32
+ function r(e) {
33
+ return n(e) && typeof e.type == "string";
51
34
  }
52
- function $(e) {
53
- if (!l(e))
54
- return !1;
55
- const n = e, r = Array.isArray(n.arguments) && "callee" in n;
56
- return u(n, "CallExpression") && r;
35
+ function i(e, t) {
36
+ return r(e) && e.type === t;
57
37
  }
58
- function C(e) {
59
- return u(e, "ConditionalExpression") && "consequent" in e && "alternate" in e;
38
+ function a(e) {
39
+ return i(e, "Literal");
60
40
  }
61
- function k(e) {
62
- return u(e, "LogicalExpression") && "left" in e && "right" in e;
41
+ function o(e) {
42
+ if (!n(e)) return !1;
43
+ let t = e, r = Array.isArray(t.expressions) && Array.isArray(t.quasis);
44
+ return i(t, "TemplateLiteral") && r;
63
45
  }
64
- function E(e) {
65
- if (!l(e))
66
- return !1;
67
- const n = e, r = Array.isArray(n.elements);
68
- return u(n, "ArrayExpression") && r;
46
+ function s(e) {
47
+ return i(e, "JSXExpressionContainer") && "expression" in e;
69
48
  }
70
- function w(e) {
71
- if (!l(e))
72
- return !1;
73
- const n = e, r = typeof n.name == "string";
74
- return u(n, "JSXIdentifier") && r;
49
+ function c(e) {
50
+ if (!n(e)) return !1;
51
+ let t = e, r = Array.isArray(t.arguments) && "callee" in t;
52
+ return i(t, "CallExpression") && r;
75
53
  }
76
- function J(e) {
77
- return u(e, "JSXAttribute") && "name" in e;
54
+ function l(e) {
55
+ return i(e, "ConditionalExpression") && "consequent" in e && "alternate" in e;
78
56
  }
79
- function T(e) {
80
- if (!l(e))
81
- return !1;
82
- const n = e, r = Array.isArray(n.attributes) && "name" in n;
83
- return u(n, "JSXOpeningElement") && r;
57
+ function u(e) {
58
+ return i(e, "LogicalExpression") && "left" in e && "right" in e;
84
59
  }
85
- function O(e) {
86
- if (!l(e))
87
- return !1;
88
- const n = e, r = Array.isArray(n.specifiers) && "source" in n;
89
- return u(n, "ImportDeclaration") && r;
60
+ function d(e) {
61
+ if (!n(e)) return !1;
62
+ let t = e, r = Array.isArray(t.elements);
63
+ return i(t, "ArrayExpression") && r;
90
64
  }
91
- function I(e) {
92
- return l(e.source) && typeof e.source.value == "string" ? e.source.value : null;
65
+ function f(e) {
66
+ if (!n(e)) return !1;
67
+ let t = e, r = typeof t.name == "string";
68
+ return i(t, "JSXIdentifier") && r;
93
69
  }
94
- function L(e) {
95
- if (!l(e) || !("local" in e))
96
- return null;
97
- const n = e.local;
98
- return l(n) && typeof n.name == "string" ? n.name : null;
70
+ function p(e) {
71
+ return i(e, "JSXAttribute") && "name" in e;
99
72
  }
100
- function j(e) {
101
- return e.trim().split(":").at(-1)?.replace(/!$/, "").replace(/^-/, "");
73
+ function m(e) {
74
+ if (!n(e)) return !1;
75
+ let t = e, r = Array.isArray(t.attributes) && "name" in t;
76
+ return i(t, "JSXOpeningElement") && r;
102
77
  }
103
- function v(e) {
104
- const n = j(e);
105
- return n ? b.some(
106
- (r) => r.test(n)
107
- ) : !1;
78
+ function h(e) {
79
+ if (!n(e)) return !1;
80
+ let t = e, r = Array.isArray(t.specifiers) && "source" in t;
81
+ return i(t, "ImportDeclaration") && r;
108
82
  }
109
83
  function g(e) {
110
- return e.split(/\s+/).map((n) => n.trim()).filter(Boolean);
84
+ return n(e.source) && typeof e.source.value == "string" ? e.source.value : null;
111
85
  }
112
- function S(e) {
113
- return e.value?.cooked ?? "";
86
+ function _(e) {
87
+ if (!n(e) || !("local" in e)) return null;
88
+ let t = e.local;
89
+ return n(t) && typeof t.name == "string" ? t.name : null;
114
90
  }
115
- function m(e) {
116
- return e ? p(e) ? typeof e.value == "string" ? g(e.value) : [] : y(e) ? e.quasis.flatMap(
117
- (n) => g(S(n))
118
- ) : x(e) ? m(e.expression) : $(e) ? e.arguments.flatMap((n) => m(n)) : C(e) ? [
119
- ...m(e.consequent),
120
- ...m(e.alternate)
121
- ] : k(e) ? [
122
- ...m(e.left),
123
- ...m(e.right)
124
- ] : E(e) ? e.elements.flatMap((n) => m(n)) : [] : [];
91
+ function v(e) {
92
+ return e.trim().split(":").at(-1)?.replace(/!$/, "").replace(/^-/, "");
125
93
  }
126
- function V(e) {
127
- return w(e.name) ? e.name.name : null;
94
+ function y(e) {
95
+ let n = v(e);
96
+ return n ? t.some((e) => e.test(n)) : !1;
128
97
  }
129
- function d(e) {
130
- return e.filter(v);
98
+ function b(e) {
99
+ return e.split(/\s+/).map((e) => e.trim()).filter(Boolean);
131
100
  }
132
- function z(e, n) {
133
- return n.range ? e.text.slice(n.range[0], n.range[1]) : null;
101
+ function x(e) {
102
+ return e.value?.cooked ?? "";
134
103
  }
135
- function R({
136
- expressionNode: e,
137
- sourceCode: n,
138
- sanitizedTokens: r,
139
- valueNode: o
140
- }) {
141
- const t = r.join(" ");
142
- if (p(o))
143
- return t === "" ? null : `"${t}"`;
144
- if (!x(o) || !e)
145
- return null;
146
- if (p(e))
147
- return t === "" ? null : `{${JSON.stringify(t)}}`;
148
- if (y(e) && e.expressions.length === 0)
149
- return t === "" ? null : `{${JSON.stringify(t)}}`;
150
- if (!$(e) || !l(e.callee) || (typeof e.callee.name == "string" ? e.callee.name : null) !== "cn")
151
- return null;
152
- const i = [];
153
- for (const s of e.arguments) {
154
- if (p(s) && typeof s.value == "string") {
155
- const a = d(
156
- g(s.value)
157
- ).join(" ");
158
- a && i.push(JSON.stringify(a));
159
- continue;
160
- }
161
- if (y(s) && s.expressions.length === 0) {
162
- const a = S(s.quasis[0] ?? {}), A = d(
163
- g(a)
164
- ).join(" ");
165
- A && i.push(JSON.stringify(A));
166
- continue;
167
- }
168
- if (!h(s))
169
- return null;
170
- const c = z(n, s);
171
- if (c === null)
172
- return null;
173
- i.push(c);
174
- }
175
- return i.length === 0 ? null : `{cn(${i.join(", ")})}`;
104
+ function S(e) {
105
+ return e ? a(e) ? typeof e.value == "string" ? b(e.value) : [] : o(e) ? e.quasis.flatMap((e) => b(x(e))) : s(e) ? S(e.expression) : c(e) ? e.arguments.flatMap((e) => S(e)) : l(e) ? [...S(e.consequent), ...S(e.alternate)] : u(e) ? [...S(e.left), ...S(e.right)] : d(e) ? e.elements.flatMap((e) => S(e)) : [] : [];
176
106
  }
177
- function q({
178
- classNameAttribute: e,
179
- disallowedTokens: n,
180
- sourceCode: r,
181
- tokens: o
182
- }) {
183
- if (n.length === 0)
184
- return null;
185
- const t = e.value;
186
- if (!t)
187
- return null;
188
- const f = x(t) ? t.expression : null, i = d(o), s = R({
189
- expressionNode: f,
190
- sanitizedTokens: i,
191
- sourceCode: r,
192
- valueNode: t
193
- }), c = e.range;
194
- return c ? (a) => s === null ? a.removeRange([c[0] - 1, c[1]]) : !h(t) || !t.range ? null : a.replaceTextRange(t.range, s) : null;
107
+ function C(e) {
108
+ return f(e.name) ? e.name.name : null;
195
109
  }
196
- const X = {
197
- meta: {
198
- type: "suggestion",
199
- fixable: "code",
200
- hasSuggestions: !0,
201
- docs: {
202
- description: "Warn when consumers visually override Aura component styles via className"
203
- },
204
- schema: [],
205
- messages: {
206
- overridingAuraStyles: "Overriding Aura styles: only layout and sizing utilities should be passed via className. Move visual styling into Aura variants, props, or composition instead. Offending classes: {{classes}}.",
207
- removeOverridingAuraStyles: "Remove disallowed Aura styling classes and keep only layout-safe utilities."
208
- }
209
- },
210
- create(e) {
211
- const n = /* @__PURE__ */ new Set(), r = e.sourceCode;
212
- return {
213
- ImportDeclaration(o) {
214
- if (!O(o))
215
- return;
216
- const t = I(o);
217
- if (!(!t || !N.has(t)))
218
- for (const f of o.specifiers) {
219
- const i = L(f);
220
- i && n.add(i);
221
- }
222
- },
223
- JSXOpeningElement(o) {
224
- if (!T(o))
225
- return;
226
- const t = V(o);
227
- if (!t || !n.has(t))
228
- return;
229
- const f = o.attributes.find(
230
- (a) => J(a) && w(a.name) && a.name.name === "className"
231
- );
232
- if (!f?.value)
233
- return;
234
- const i = m(f.value), s = [...new Set(i)].filter(
235
- (a) => !v(a)
236
- ), c = q({
237
- classNameAttribute: f,
238
- disallowedTokens: s,
239
- sourceCode: r,
240
- tokens: i
241
- });
242
- s.length !== 0 && e.report({
243
- node: f,
244
- messageId: "overridingAuraStyles",
245
- data: {
246
- classes: s.join(", ")
247
- },
248
- fix: c,
249
- suggest: c ? [
250
- {
251
- messageId: "removeOverridingAuraStyles",
252
- fix: c
253
- }
254
- ] : void 0
255
- });
256
- }
257
- };
258
- }
259
- };
260
- export {
261
- X as auraNoOverridingStylesRule
110
+ function w(e) {
111
+ return e.filter(y);
112
+ }
113
+ function T(e, t) {
114
+ return t.range ? e.text.slice(t.range[0], t.range[1]) : null;
115
+ }
116
+ function E({ expressionNode: e, sourceCode: t, sanitizedTokens: i, valueNode: l }) {
117
+ let u = i.join(" ");
118
+ if (a(l)) return u === "" ? null : `"${u}"`;
119
+ if (!s(l) || !e) return null;
120
+ if (a(e) || o(e) && e.expressions.length === 0) return u === "" ? null : `{${JSON.stringify(u)}}`;
121
+ if (!c(e) || !n(e.callee) || (typeof e.callee.name == "string" ? e.callee.name : null) !== "cn") return null;
122
+ let d = [];
123
+ for (let n of e.arguments) {
124
+ if (a(n) && typeof n.value == "string") {
125
+ let e = w(b(n.value)).join(" ");
126
+ e && d.push(JSON.stringify(e));
127
+ continue;
128
+ }
129
+ if (o(n) && n.expressions.length === 0) {
130
+ let e = w(b(x(n.quasis[0] ?? {}))).join(" ");
131
+ e && d.push(JSON.stringify(e));
132
+ continue;
133
+ }
134
+ if (!r(n)) return null;
135
+ let e = T(t, n);
136
+ if (e === null) return null;
137
+ d.push(e);
138
+ }
139
+ return d.length === 0 ? null : `{cn(${d.join(", ")})}`;
140
+ }
141
+ function D({ classNameAttribute: e, disallowedTokens: t, sourceCode: n, tokens: i }) {
142
+ if (t.length === 0) return null;
143
+ let a = e.value;
144
+ if (!a) return null;
145
+ let o = E({
146
+ expressionNode: s(a) ? a.expression : null,
147
+ sanitizedTokens: w(i),
148
+ sourceCode: n,
149
+ valueNode: a
150
+ }), c = e.range;
151
+ return c ? (e) => o === null ? e.removeRange([c[0] - 1, c[1]]) : !r(a) || !a.range ? null : e.replaceTextRange(a.range, o) : null;
152
+ }
153
+ var O = {
154
+ meta: {
155
+ type: "suggestion",
156
+ fixable: "code",
157
+ hasSuggestions: !0,
158
+ docs: { description: "Warn when consumers visually override Aura component styles via className" },
159
+ schema: [],
160
+ messages: {
161
+ overridingAuraStyles: "Overriding Aura styles: only layout and sizing utilities should be passed via className. Move visual styling into Aura variants, props, or composition instead. Offending classes: {{classes}}.",
162
+ removeOverridingAuraStyles: "Remove disallowed Aura styling classes and keep only layout-safe utilities."
163
+ }
164
+ },
165
+ create(t) {
166
+ let n = /* @__PURE__ */ new Set(), r = t.sourceCode;
167
+ return {
168
+ ImportDeclaration(t) {
169
+ if (!h(t)) return;
170
+ let r = g(t);
171
+ if (!(!r || !e.has(r))) for (let e of t.specifiers) {
172
+ let t = _(e);
173
+ t && n.add(t);
174
+ }
175
+ },
176
+ JSXOpeningElement(e) {
177
+ if (!m(e)) return;
178
+ let i = C(e);
179
+ if (!i || !n.has(i)) return;
180
+ let a = e.attributes.find((e) => p(e) && f(e.name) && e.name.name === "className");
181
+ if (!a?.value) return;
182
+ let o = S(a.value), s = [...new Set(o)].filter((e) => !y(e)), c = D({
183
+ classNameAttribute: a,
184
+ disallowedTokens: s,
185
+ sourceCode: r,
186
+ tokens: o
187
+ });
188
+ s.length !== 0 && t.report({
189
+ node: a,
190
+ messageId: "overridingAuraStyles",
191
+ data: { classes: s.join(", ") },
192
+ fix: c,
193
+ suggest: c ? [{
194
+ messageId: "removeOverridingAuraStyles",
195
+ fix: c
196
+ }] : void 0
197
+ });
198
+ }
199
+ };
200
+ }
262
201
  };
202
+ //#endregion
203
+ export { O as auraNoOverridingStylesRule };
@@ -0,0 +1 @@
1
+ export * from '@tabler/icons-react';
@@ -0,0 +1 @@
1
+ export * from "@tabler/icons-react";
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionToolbar, ActionToolbarAction, ActionToolbarActionClear, ActionToolbarActions, ActionToolbarPrimaryAction, ActionToolbarSelection, ActionToolbarSelectionSummary, Alert, AlertActions, AlertButton, AlertClose, AlertDescription, AlertTitle, EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, Avatar, AvatarFallback, AvatarIcon, AvatarImage, Badge, Banner, BannerAction, BannerActions, BannerClose, BannerIcon, BannerStatus, BannerTitle, badgeVariants, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, buttonVariants, Card, CardActions, CardContent, CardDescription, CardFooter, CardFooterEnd, CardFooterStart, CardHeader, CardHeaderCenter, CardHeaderEnd, CardHeaderStart, CardTitle, CheckboxGroup, CheckboxItem, CheckboxItemControl, CheckboxItemDescription, CheckboxItemLabel, CheckboxMetadata, CodeBlock, CodeBlockCollapseButton, CodeBlockCopyButton, CodeBlockDownloadButton, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, countVariants, DateRangePicker, DateTimeRangePicker, type DateRangePickerProps, type DateTimeRangePickerProps, type ShortcutItem, type TimeFormat, type ComponentMeta, type ComponentStatusType, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSectionLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HelperText, HoverCard, HoverCardContent, HoverCardTrigger, InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationGroup, InlineCitationLink, type InlineCitationLinkProps, InlineCitationQuote, InlineCitationSource, InlineCitationText, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, Label, Loader, Message, MessageAction, MessageActions, MessageContent, MessageResponse, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PaginationResultsPerPage, PaginationResultsPerPageLabel, PaginationSelectTrigger, PaginationStatus, PaginationTeleport, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverHeaderContent, PopoverSlot, PopoverTitle, PopoverTrigger, PortalContainerContext, PromptInput, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputModelSelect, PromptInputModelSelectContent, PromptInputModelSelectItem, PromptInputModelSelectTrigger, PromptInputModelSelectValue, PromptInputProvider, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, Reasoning, ReasoningContent, ReasoningHeader, ReasoningItem, RadioGroup, RadioGroupItem, RadioGroupItemControl, RadioGroupItemDescription, RadioGroupItemLabel, ScrollArea, ScrollBar, Search, SegmentedControl, SegmentedControlButton, SegmentedControlContent, SegmentedControlList, segmentedControlButtonVariants, segmentedControlListVariants, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Shimmer, Skeleton, Source, Sources, SourcesTitle, toast, Toaster, Tabs, TabsLabel, TabsList, TabsPanel, TabsTrigger, tabsListVariants, tabsTriggerVariants, Textarea, Topbar, TopbarAction, TopbarBreadcrumbs, TopbarCenter, TopbarIcon, TopbarLeft, TopbarMetadata, TopbarRight, type TopbarTheme, TopbarThemeSwitcher, Toggle, toggleVariants, Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, usePromptInputController, } from './components';
1
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionToolbar, ActionToolbarAction, ActionToolbarActionClear, ActionToolbarActions, ActionToolbarPrimaryAction, ActionToolbarSelection, ActionToolbarSelectionSummary, Alert, AlertActions, AlertButton, AlertClose, AlertDescription, AlertTitle, EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, Avatar, AvatarFallback, AvatarIcon, AvatarImage, Badge, Banner, BannerAction, BannerActions, BannerClose, BannerIcon, BannerStatus, BannerTitle, badgeVariants, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, buttonVariants, Card, CardActions, CardContent, CardDescription, CardFooter, CardFooterEnd, CardFooterStart, CardHeader, CardHeaderCenter, CardHeaderEnd, CardHeaderStart, CardTitle, CheckboxGroup, CheckboxItem, CheckboxItemControl, CheckboxItemDescription, CheckboxItemLabel, CheckboxMetadata, CodeBlock, CodeBlockCollapseButton, CodeBlockCopyButton, CodeBlockDownloadButton, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Combobox, Count, countVariants, DatePicker, type DatePickerProps, DateRangePicker, DateTimeRangePicker, type DateRangePickerProps, type DateTimeRangePickerProps, type ShortcutItem, TimePicker, type TimePickerProps, type TimeFormat, type AmPm, type ComponentMeta, type ComponentStatusType, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSectionLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, HelperText, HoverCard, HoverCardContent, HoverCardTrigger, InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationGroup, InlineCitationLink, type InlineCitationLinkProps, InlineCitationQuote, InlineCitationSource, InlineCitationText, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, Label, Loader, Message, MessageAction, MessageActions, MessageContent, MessageResponse, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PaginationResultsPerPage, PaginationResultsPerPageLabel, PaginationSelectTrigger, PaginationStatus, PaginationTeleport, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverHeaderContent, PopoverSlot, PopoverTitle, PopoverTrigger, PortalContainerContext, PromptInput, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputModelSelect, PromptInputModelSelectContent, PromptInputModelSelectItem, PromptInputModelSelectTrigger, PromptInputModelSelectValue, PromptInputProvider, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, Reasoning, ReasoningContent, ReasoningHeader, ReasoningItem, RadioGroup, RadioGroupItem, RadioGroupItemControl, RadioGroupItemDescription, RadioGroupItemLabel, ScrollArea, ScrollBar, Search, SegmentedControl, SegmentedControlButton, SegmentedControlContent, SegmentedControlList, segmentedControlButtonVariants, segmentedControlListVariants, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Shimmer, Skeleton, Slider, Source, Sources, SourcesTitle, Switch, toast, Toaster, Tabs, TabsLabel, TabsList, TabsPanel, TabsTrigger, tabsListVariants, tabsTriggerVariants, Textarea, Topbar, TopbarAction, TopbarBreadcrumbs, TopbarCenter, TopbarIcon, TopbarLeft, TopbarMetadata, TopbarRight, type TopbarTheme, TopbarThemeSwitcher, Toggle, toggleVariants, Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, usePromptInputController, } from './components';
@@ -0,0 +1,9 @@
1
+ import { BundledLanguage } from 'shiki/bundle/web';
2
+ /**
3
+ * Syntax-highlights a snippet for both the light and dark themes.
4
+ *
5
+ * Keeping Shiki in this dedicated module ensures the shared `cn` helper —
6
+ * imported by every component — never drags it into the build graph. See
7
+ * README.md "Package imports".
8
+ */
9
+ export declare function highlightCode(code: string, language: BundledLanguage, showLineNumbers?: boolean): Promise<[string, string]>;
@@ -0,0 +1,42 @@
1
+ import { codeToHtml as e } from "shiki/bundle/web";
2
+ //#region libs/aura/src/lib/highlight-code.ts
3
+ var t = {
4
+ name: "strip-pre-styles",
5
+ pre(e) {
6
+ e.properties.style = void 0;
7
+ }
8
+ }, n = {
9
+ name: "line-numbers",
10
+ line(e, t) {
11
+ e.children.unshift({
12
+ type: "element",
13
+ tagName: "span",
14
+ properties: { className: [
15
+ "inline-block",
16
+ "min-w-10",
17
+ "mr-4",
18
+ "text-right",
19
+ "select-none",
20
+ "text-muted-foreground"
21
+ ] },
22
+ children: [{
23
+ type: "text",
24
+ value: String(t)
25
+ }]
26
+ });
27
+ }
28
+ };
29
+ async function r(r, i, a = !1) {
30
+ let o = [t, ...a ? [n] : []];
31
+ return await Promise.all([e(r, {
32
+ lang: i,
33
+ theme: "one-light",
34
+ transformers: o
35
+ }), e(r, {
36
+ lang: i,
37
+ theme: "one-dark-pro",
38
+ transformers: o
39
+ })]);
40
+ }
41
+ //#endregion
42
+ export { r as highlightCode };
@@ -1,10 +1,9 @@
1
- import { useContext as t, createContext as o } from "react";
2
- import { getPortalContainer as n } from "./utils.js";
3
- const e = o(void 0);
4
- function C() {
5
- return t(e) ?? n();
1
+ import { getPortalContainer as e } from "./utils.js";
2
+ import { createContext as t, useContext as n } from "react";
3
+ //#region libs/aura/src/lib/portal-container-context.ts
4
+ var r = t(void 0);
5
+ function i() {
6
+ return n(r) ?? e();
6
7
  }
7
- export {
8
- e as PortalContainerContext,
9
- C as usePortalContainer
10
- };
8
+ //#endregion
9
+ export { r as PortalContainerContext, i as usePortalContainer };
@@ -1,7 +1,7 @@
1
- const a = {
2
- styleScope: "aura-style-scope",
3
- portalContainer: "aura-portal-container"
4
- };
5
- export {
6
- a as default
1
+ //#region libs/aura/src/lib/style-scope.ts
2
+ var e = {
3
+ styleScope: "aura-style-scope",
4
+ portalContainer: "aura-portal-container"
7
5
  };
6
+ //#endregion
7
+ export { e as default };
@@ -1,32 +1,23 @@
1
- import { useState as v, useRef as V, useEffect as b, useCallback as m } from "react";
2
- function c(e) {
3
- return typeof e == "function";
1
+ import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
+ //#region libs/aura/src/lib/use-controllable-state.ts
3
+ function i(e) {
4
+ return typeof e == "function";
4
5
  }
5
- function R({
6
- prop: e,
7
- defaultProp: l,
8
- onChange: o
9
- }) {
10
- const [f, a] = v(l), r = e !== void 0, i = r ? e : f, u = V(o);
11
- b(() => {
12
- u.current = o;
13
- }, [o]);
14
- const d = m(
15
- (t) => {
16
- if (r) {
17
- const n = c(t) ? t(e) : t;
18
- u.current?.(n);
19
- return;
20
- }
21
- a((n) => {
22
- const s = c(t) ? t(n) : t;
23
- return u.current?.(s), s;
24
- });
25
- },
26
- [r, e]
27
- );
28
- return [i, d];
6
+ function a({ prop: a, defaultProp: o, onChange: s }) {
7
+ let [c, l] = r(o), u = a !== void 0, d = u ? a : c, f = n(s);
8
+ return t(() => {
9
+ f.current = s;
10
+ }, [s]), [d, e((e) => {
11
+ if (u) {
12
+ let t = i(e) ? e(a) : e;
13
+ f.current?.(t);
14
+ return;
15
+ }
16
+ l((t) => {
17
+ let n = i(e) ? e(t) : e;
18
+ return f.current?.(n), n;
19
+ });
20
+ }, [u, a])];
29
21
  }
30
- export {
31
- R as useControllableState
32
- };
22
+ //#endregion
23
+ export { a as useControllableState };
@@ -1,5 +1,4 @@
1
1
  import { ClassValue } from 'clsx';
2
- import { BundledLanguage } from 'shiki';
3
2
  type PortalContainerOptions = {
4
3
  id?: string;
5
4
  className?: string;
@@ -7,7 +6,6 @@ type PortalContainerOptions = {
7
6
  };
8
7
  export declare function cn(...inputs: ClassValue[]): string;
9
8
  export declare const isStorybookTestEnv: boolean;
10
- export declare function highlightCode(code: string, language: BundledLanguage, showLineNumbers?: boolean): Promise<[string, string]>;
11
9
  export declare function getInitials(name: string): string;
12
10
  /**
13
11
  * Focus rings for non-form interactive elements (buttons, etc.).