@cognite/aura 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/DESIGN.md +134 -5
  2. package/README.md +24 -3
  3. package/dist/components/index.d.ts +2 -0
  4. package/dist/components/index.js +58 -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/card/card.js +102 -185
  15. package/dist/components/ui/core/chart/chart.js +116 -206
  16. package/dist/components/ui/core/chart/index.js +2 -8
  17. package/dist/components/ui/core/checkbox/checkbox.js +67 -132
  18. package/dist/components/ui/core/checkbox/checkbox.metadata.js +7 -7
  19. package/dist/components/ui/core/code-block/code-block.d.ts +1 -1
  20. package/dist/components/ui/core/code-block/code-block.js +179 -267
  21. package/dist/components/ui/core/collapsible/collapsible.js +29 -49
  22. package/dist/components/ui/core/combobox/combobox.js +41 -0
  23. package/dist/components/ui/core/command/command.js +85 -150
  24. package/dist/components/ui/core/count/count.js +21 -32
  25. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +60 -72
  26. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +36 -51
  27. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +63 -87
  28. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +60 -68
  29. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +118 -174
  30. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +104 -145
  31. package/dist/components/ui/core/date-time-pickers/index.js +5 -10
  32. package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +42 -56
  33. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +66 -117
  34. package/dist/components/ui/core/date-time-pickers/shared/calendar-header/calendar-header.js +63 -93
  35. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +64 -98
  36. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +38 -67
  37. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +23 -23
  38. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +52 -62
  39. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +18 -18
  40. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +24 -31
  41. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +24 -33
  42. package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +4 -7
  43. package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +17 -31
  44. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +40 -40
  45. package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +33 -50
  46. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +78 -99
  47. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +41 -63
  48. package/dist/components/ui/core/date-time-pickers/utils/calendar-utils.js +39 -52
  49. package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +7 -15
  50. package/dist/components/ui/core/dialog/dialog.js +82 -155
  51. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +2 -2
  52. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +150 -248
  53. package/dist/components/ui/core/empty-state/empty-state.context.js +5 -8
  54. package/dist/components/ui/core/empty-state/empty-state.js +86 -138
  55. package/dist/components/ui/core/helper-text/helper-text.js +37 -65
  56. package/dist/components/ui/core/hover-card/hover-card.js +54 -80
  57. package/dist/components/ui/core/inline-citation/inline-citation.js +98 -181
  58. package/dist/components/ui/core/input/input.js +12 -27
  59. package/dist/components/ui/core/input-group/input-group.js +76 -173
  60. package/dist/components/ui/core/kbd/kbd.js +20 -36
  61. package/dist/components/ui/core/label/label.js +26 -43
  62. package/dist/components/ui/core/loader/loader.js +80 -117
  63. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +12 -12
  64. package/dist/components/ui/core/message/message.d.ts +2 -2
  65. package/dist/components/ui/core/message/message.js +316 -542
  66. package/dist/components/ui/core/pagination/pagination-size-context.js +5 -6
  67. package/dist/components/ui/core/pagination/pagination-teleport.js +86 -106
  68. package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
  69. package/dist/components/ui/core/pagination/pagination.js +231 -334
  70. package/dist/components/ui/core/popover/popover.js +90 -157
  71. package/dist/components/ui/core/progress/progress.js +36 -61
  72. package/dist/components/ui/core/prompt-input/prompt-input.js +274 -413
  73. package/dist/components/ui/core/radio-group/radio-group.js +58 -113
  74. package/dist/components/ui/core/reasoning/reasoning.js +55 -86
  75. package/dist/components/ui/core/scroll-area/scroll-area.js +41 -71
  76. package/dist/components/ui/core/search/search.js +77 -99
  77. package/dist/components/ui/core/segmented-control/segmented-control.js +110 -167
  78. package/dist/components/ui/core/select/select.js +168 -293
  79. package/dist/components/ui/core/separator/separator.js +13 -23
  80. package/dist/components/ui/core/shimmer/shimmer.d.ts +2 -4
  81. package/dist/components/ui/core/shimmer/shimmer.js +40 -107
  82. package/dist/components/ui/core/skeleton/skeleton.js +13 -18
  83. package/dist/components/ui/core/sonner-toast/sonner-toast.js +54 -47
  84. package/dist/components/ui/core/sources/sources.d.ts +5 -1
  85. package/dist/components/ui/core/sources/sources.js +58 -79
  86. package/dist/components/ui/core/switch/switch.js +62 -0
  87. package/dist/components/ui/core/tabs/tabs.js +149 -223
  88. package/dist/components/ui/core/tabs/tabs.utils.js +6 -8
  89. package/dist/components/ui/core/textarea/textarea.js +13 -27
  90. package/dist/components/ui/core/toggle/toggle.js +55 -74
  91. package/dist/components/ui/core/tool/tool.js +127 -163
  92. package/dist/components/ui/core/tooltip/tooltip.js +47 -86
  93. package/dist/components/ui/core/topbar/topbar.js +106 -190
  94. package/dist/eslint/index.js +5 -10
  95. package/dist/eslint/no-overriding-styles.js +178 -237
  96. package/dist/icons/index.d.ts +1 -0
  97. package/dist/icons/index.js +1 -0
  98. package/dist/lib/highlight-code.d.ts +9 -0
  99. package/dist/lib/highlight-code.js +42 -0
  100. package/dist/lib/portal-container-context.js +8 -9
  101. package/dist/lib/style-scope.js +6 -6
  102. package/dist/lib/use-controllable-state.js +21 -30
  103. package/dist/lib/utils.d.ts +0 -2
  104. package/dist/lib/utils.js +32 -112
  105. package/dist/styles.css +1 -1
  106. package/dist/styles.source.css +23 -0
  107. package/package.json +23 -7
  108. package/dist/components/ui/core/date-time-pickers/shared/constants.js +0 -14
@@ -1,224 +1,150 @@
1
- import { jsx as i, jsxs as b } from "react/jsx-runtime";
2
- import { forwardRef as n, createContext as v, useContext as x } from "react";
3
- import { Tabs as u } from "@base-ui/react/tabs";
4
- import { cva as f } from "class-variance-authority";
5
- import { cn as l } from "../../../../lib/utils.js";
6
- import { Badge as z } from "../badge/badge.js";
7
- import { resolveTabLabelTitle as T } from "./tabs.utils.js";
8
- const w = f("relative isolate inline-flex", {
9
- variants: {
10
- orientation: {
11
- horizontal: "flex-row",
12
- vertical: "flex-col"
13
- },
14
- size: {
15
- small: "",
16
- default: ""
17
- },
18
- fullWidth: {
19
- true: "w-full",
20
- false: "w-fit"
21
- }
22
- },
23
- compoundVariants: [
24
- {
25
- orientation: "horizontal",
26
- size: "small",
27
- className: "items-center gap-1"
28
- },
29
- {
30
- orientation: "horizontal",
31
- size: "default",
32
- className: "items-center gap-2"
33
- },
34
- {
35
- orientation: "vertical",
36
- size: "small",
37
- className: "items-stretch gap-1"
38
- },
39
- {
40
- orientation: "vertical",
41
- size: "default",
42
- className: "items-stretch gap-2"
43
- }
44
- ],
45
- defaultVariants: {
46
- orientation: "horizontal",
47
- size: "small",
48
- fullWidth: !1
49
- }
50
- }), N = f(
51
- "pointer-events-none absolute top-(--active-tab-top) left-(--active-tab-left) z-0 h-(--active-tab-height) w-(--active-tab-width) bg-active-muted-background motion-safe:transition-[top,left,width,height] motion-safe:duration-200 motion-safe:ease-out data-[activation-direction=none]:transition-none",
52
- {
53
- variants: {
54
- size: {
55
- small: "rounded-md",
56
- default: "rounded-lg"
57
- }
58
- },
59
- defaultVariants: {
60
- size: "small"
61
- }
62
- }
63
- ), y = f(
64
- "group relative z-10 inline-flex min-w-0 max-w-full items-center justify-start outline-none transition-[color,box-shadow] duration-200 ease-out shrink-0 font-medium tracking-normal text-sm cursor-pointer focus-visible:border-ring focus-visible:ring-ring-shadow focus-visible:ring data-[disabled]:pointer-events-none data-[disabled]:cursor-default [&_[data-slot=tabs-label]]:min-w-0 [&_[data-slot=tabs-label]]:truncate",
65
- {
66
- variants: {
67
- size: {
68
- small: "h-7 px-2 gap-1.5 leading-4.5 rounded-md",
69
- default: "h-9 px-3 gap-2 leading-4.5 rounded-lg"
70
- },
71
- fullWidth: {
72
- true: "min-w-px justify-center [&_[data-slot=tabs-label]]:flex-none [&_[data-slot=tabs-label]]:text-center",
73
- false: ""
74
- },
75
- stateTone: {
76
- default: "text-muted-foreground hover:text-foreground data-active:text-foreground data-active:hover:text-foreground data-[disabled]:text-disabled-foreground"
77
- }
78
- },
79
- defaultVariants: {
80
- size: "small",
81
- fullWidth: !1,
82
- stateTone: "default"
83
- }
84
- }
85
- ), _ = n(
86
- ({ className: e, ...t }, a) => /* @__PURE__ */ i(
87
- u.Root,
88
- {
89
- ref: a,
90
- "data-slot": "tabs",
91
- className: l(e),
92
- ...t
93
- }
94
- )
95
- );
96
- _.displayName = "Tabs";
97
- const g = v(void 0), h = n(({ className: e, size: t = "small", ...a }, s) => /* @__PURE__ */ i(
98
- u.Indicator,
99
- {
100
- ref: s,
101
- "data-slot": "tabs-indicator",
102
- className: l(N({ size: t }), e),
103
- ...a
104
- }
105
- ));
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { Badge as t } from "../badge/badge.js";
3
+ import { resolveTabLabelTitle as n } from "./tabs.utils.js";
4
+ import { createContext as r, forwardRef as i, useContext as a } from "react";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { cva as c } from "class-variance-authority";
7
+ import { Tabs as l } from "@base-ui/react/tabs";
8
+ //#region libs/aura/src/components/ui/core/tabs/tabs.tsx
9
+ var u = c("relative isolate inline-flex", {
10
+ variants: {
11
+ orientation: {
12
+ horizontal: "flex-row",
13
+ vertical: "flex-col"
14
+ },
15
+ size: {
16
+ small: "",
17
+ default: ""
18
+ },
19
+ fullWidth: {
20
+ true: "w-full",
21
+ false: "w-fit"
22
+ }
23
+ },
24
+ compoundVariants: [
25
+ {
26
+ orientation: "horizontal",
27
+ size: "small",
28
+ className: "items-center gap-1"
29
+ },
30
+ {
31
+ orientation: "horizontal",
32
+ size: "default",
33
+ className: "items-center gap-2"
34
+ },
35
+ {
36
+ orientation: "vertical",
37
+ size: "small",
38
+ className: "items-stretch gap-1"
39
+ },
40
+ {
41
+ orientation: "vertical",
42
+ size: "default",
43
+ className: "items-stretch gap-2"
44
+ }
45
+ ],
46
+ defaultVariants: {
47
+ orientation: "horizontal",
48
+ size: "small",
49
+ fullWidth: !1
50
+ }
51
+ }), d = c("pointer-events-none absolute top-(--active-tab-top) left-(--active-tab-left) z-0 h-(--active-tab-height) w-(--active-tab-width) bg-active-muted-background motion-safe:transition-[top,left,width,height] motion-safe:duration-200 motion-safe:ease-out data-[activation-direction=none]:transition-none", {
52
+ variants: { size: {
53
+ small: "rounded-md",
54
+ default: "rounded-lg"
55
+ } },
56
+ defaultVariants: { size: "small" }
57
+ }), f = c("group relative z-10 inline-flex min-w-0 max-w-full items-center justify-start outline-none transition-[color,box-shadow] duration-200 ease-out shrink-0 font-medium tracking-normal text-sm cursor-pointer focus-visible:border-ring focus-visible:ring-ring-shadow focus-visible:ring data-[disabled]:pointer-events-none data-[disabled]:cursor-default [&_[data-slot=tabs-label]]:min-w-0 [&_[data-slot=tabs-label]]:truncate", {
58
+ variants: {
59
+ size: {
60
+ small: "h-7 px-2 gap-1.5 leading-4.5 rounded-md",
61
+ default: "h-9 px-3 gap-2 leading-4.5 rounded-lg"
62
+ },
63
+ fullWidth: {
64
+ true: "min-w-px justify-center [&_[data-slot=tabs-label]]:flex-none [&_[data-slot=tabs-label]]:text-center",
65
+ false: ""
66
+ },
67
+ stateTone: { default: "text-muted-foreground hover:text-foreground data-active:text-foreground data-active:hover:text-foreground data-[disabled]:text-disabled-foreground" }
68
+ },
69
+ defaultVariants: {
70
+ size: "small",
71
+ fullWidth: !1,
72
+ stateTone: "default"
73
+ }
74
+ }), p = i(({ className: t, ...n }, r) => /* @__PURE__ */ o(l.Root, {
75
+ ref: r,
76
+ "data-slot": "tabs",
77
+ className: e(t),
78
+ ...n
79
+ }));
80
+ p.displayName = "Tabs";
81
+ var m = r(void 0), h = i(({ className: t, size: n = "small", ...r }, i) => /* @__PURE__ */ o(l.Indicator, {
82
+ ref: i,
83
+ "data-slot": "tabs-indicator",
84
+ className: e(d({ size: n }), t),
85
+ ...r
86
+ }));
106
87
  h.displayName = "TabsIndicator";
107
- const L = n(
108
- ({
109
- className: e,
110
- orientation: t = "horizontal",
111
- size: a = "small",
112
- fullWidth: s = !1,
113
- children: o,
114
- ...d
115
- }, c) => {
116
- const r = a ?? "small";
117
- return /* @__PURE__ */ i(
118
- u.List,
119
- {
120
- ref: c,
121
- "data-slot": "tabs-list",
122
- "data-size": r,
123
- "data-orientation": t,
124
- "data-full-width": s ? "true" : "false",
125
- className: l(
126
- "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-trigger]]:flex-1",
127
- "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-trigger]]:justify-center",
128
- "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-label]]:flex-none",
129
- "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-label]]:text-center",
130
- "[&[data-orientation=vertical][data-full-width=true]_[data-slot=tabs-trigger]]:w-full",
131
- w({ orientation: t, size: r, fullWidth: s }),
132
- e
133
- ),
134
- ...d,
135
- children: /* @__PURE__ */ b(g.Provider, { value: r, children: [
136
- /* @__PURE__ */ i(h, { size: r }),
137
- o
138
- ] })
139
- }
140
- );
141
- }
142
- );
143
- L.displayName = "TabsList";
144
- const V = n(
145
- ({
146
- className: e,
147
- size: t,
148
- fullWidth: a = !1,
149
- badge: s,
150
- disabled: o = !1,
151
- children: d,
152
- ...c
153
- }, r) => {
154
- const p = x(g), m = t ?? p ?? "small";
155
- return /* @__PURE__ */ b(
156
- u.Tab,
157
- {
158
- ref: r,
159
- "data-slot": "tabs-trigger",
160
- "data-size": m,
161
- "data-full-width": a ? "true" : "false",
162
- disabled: o,
163
- className: l(
164
- y({ size: m, fullWidth: a }),
165
- e
166
- ),
167
- ...c,
168
- children: [
169
- d,
170
- s == null ? null : /* @__PURE__ */ i(
171
- z,
172
- {
173
- variant: "mountain",
174
- className: l(
175
- "h-4 min-w-4 rounded-sm px-0.5 text-xs leading-3.5 tracking-tighter gap-0",
176
- o && "bg-disabled-background text-disabled-foreground border-transparent"
177
- ),
178
- children: s
179
- }
180
- )
181
- ]
182
- }
183
- );
184
- }
185
- );
186
- V.displayName = "TabsTrigger";
187
- const k = n(
188
- ({ className: e, children: t, title: a, ...s }, o) => {
189
- const d = T(a, t);
190
- return /* @__PURE__ */ i(
191
- "span",
192
- {
193
- ref: o,
194
- "data-slot": "tabs-label",
195
- className: l("block min-w-0 flex-1 truncate text-left", e),
196
- title: d,
197
- ...s,
198
- children: t
199
- }
200
- );
201
- }
202
- );
203
- k.displayName = "TabsLabel";
204
- const j = n(
205
- ({ className: e, ...t }, a) => /* @__PURE__ */ i(
206
- u.Panel,
207
- {
208
- ref: a,
209
- "data-slot": "tabs-panel",
210
- className: l("outline-none", e),
211
- ...t
212
- }
213
- )
214
- );
215
- j.displayName = "TabsPanel";
216
- export {
217
- _ as Tabs,
218
- k as TabsLabel,
219
- L as TabsList,
220
- j as TabsPanel,
221
- V as TabsTrigger,
222
- w as tabsListVariants,
223
- y as tabsTriggerVariants
224
- };
88
+ var g = i(({ className: t, orientation: n = "horizontal", size: r = "small", fullWidth: i = !1, children: a, ...c }, d) => {
89
+ let f = r ?? "small";
90
+ return /* @__PURE__ */ o(l.List, {
91
+ ref: d,
92
+ "data-slot": "tabs-list",
93
+ "data-size": f,
94
+ "data-orientation": n,
95
+ "data-full-width": i ? "true" : "false",
96
+ className: e("[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-trigger]]:flex-1", "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-trigger]]:justify-center", "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-label]]:flex-none", "[&[data-orientation=horizontal][data-full-width=true]_[data-slot=tabs-label]]:text-center", "[&[data-orientation=vertical][data-full-width=true]_[data-slot=tabs-trigger]]:w-full", u({
97
+ orientation: n,
98
+ size: f,
99
+ fullWidth: i
100
+ }), t),
101
+ ...c,
102
+ children: /* @__PURE__ */ s(m.Provider, {
103
+ value: f,
104
+ children: [/* @__PURE__ */ o(h, { size: f }), a]
105
+ })
106
+ });
107
+ });
108
+ g.displayName = "TabsList";
109
+ var _ = i(({ className: n, size: r, fullWidth: i = !1, badge: c, disabled: u = !1, children: d, ...p }, h) => {
110
+ let g = a(m), _ = r ?? g ?? "small";
111
+ return /* @__PURE__ */ s(l.Tab, {
112
+ ref: h,
113
+ "data-slot": "tabs-trigger",
114
+ "data-size": _,
115
+ "data-full-width": i ? "true" : "false",
116
+ disabled: u,
117
+ className: e(f({
118
+ size: _,
119
+ fullWidth: i
120
+ }), n),
121
+ ...p,
122
+ children: [d, c == null ? null : /* @__PURE__ */ o(t, {
123
+ variant: "mountain",
124
+ className: e("h-4 min-w-4 rounded-sm px-0.5 text-xs leading-3.5 tracking-tighter gap-0", u && "bg-disabled-background text-disabled-foreground border-transparent"),
125
+ children: c
126
+ })]
127
+ });
128
+ });
129
+ _.displayName = "TabsTrigger";
130
+ var v = i(({ className: t, children: r, title: i, ...a }, s) => {
131
+ let c = n(i, r);
132
+ return /* @__PURE__ */ o("span", {
133
+ ref: s,
134
+ "data-slot": "tabs-label",
135
+ className: e("block min-w-0 flex-1 truncate text-left", t),
136
+ title: c,
137
+ ...a,
138
+ children: r
139
+ });
140
+ });
141
+ v.displayName = "TabsLabel";
142
+ var y = i(({ className: t, ...n }, r) => /* @__PURE__ */ o(l.Panel, {
143
+ ref: r,
144
+ "data-slot": "tabs-panel",
145
+ className: e("outline-none", t),
146
+ ...n
147
+ }));
148
+ y.displayName = "TabsPanel";
149
+ //#endregion
150
+ export { p as Tabs, v as TabsLabel, g as TabsList, y as TabsPanel, _ as TabsTrigger, u as tabsListVariants, f as tabsTriggerVariants };
@@ -1,9 +1,7 @@
1
- function t(e, r) {
2
- if (e != null)
3
- return e;
4
- if (typeof r == "string" || typeof r == "number")
5
- return String(r);
1
+ //#region libs/aura/src/components/ui/core/tabs/tabs.utils.ts
2
+ function e(e, t) {
3
+ if (e != null) return e;
4
+ if (typeof t == "string" || typeof t == "number") return String(t);
6
5
  }
7
- export {
8
- t as resolveTabLabelTitle
9
- };
6
+ //#endregion
7
+ export { e as resolveTabLabelTitle };
@@ -1,27 +1,13 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as r } from "react";
3
- import { cn as i, disabledState as l, invalidState as n, focusState as s, filledState as d, hoverState as f, formElementBase as m } from "../../../../lib/utils.js";
4
- const c = r(
5
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
6
- "textarea",
7
- {
8
- ref: a,
9
- "data-slot": "textarea",
10
- className: i(
11
- "flex field-sizing-content h-auto min-h-20 w-full transition-[color,background-color,border-color,box-shadow] resize-none",
12
- m,
13
- f,
14
- d,
15
- s,
16
- n,
17
- l,
18
- e
19
- ),
20
- ...t
21
- }
22
- )
23
- );
24
- c.displayName = "Textarea";
25
- export {
26
- c as Textarea
27
- };
1
+ import { cn as e, disabledState as t, filledState as n, focusState as r, formElementBase as i, hoverState as a, invalidState as o } from "../../../../lib/utils.js";
2
+ import { forwardRef as s } from "react";
3
+ import { jsx as c } from "react/jsx-runtime";
4
+ //#region libs/aura/src/components/ui/core/textarea/textarea.tsx
5
+ var l = s(({ className: s, ...l }, u) => /* @__PURE__ */ c("textarea", {
6
+ ref: u,
7
+ "data-slot": "textarea",
8
+ className: e("flex field-sizing-content h-auto min-h-20 w-full transition-[color,background-color,border-color,box-shadow] resize-none", i, a, n, r, o, t, s),
9
+ ...l
10
+ }));
11
+ l.displayName = "Textarea";
12
+ //#endregion
13
+ export { l as Textarea };
@@ -1,74 +1,55 @@
1
- import { jsx as o, jsxs as m, Fragment as f } from "react/jsx-runtime";
2
- import { forwardRef as v } from "react";
3
- import { Toggle as b } from "@base-ui/react/toggle";
4
- import { cva as p } from "class-variance-authority";
5
- import { cn as s } from "../../../../lib/utils.js";
6
- const x = p(
7
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-muted-foreground hover:bg-accent-background hover:text-foreground disabled:pointer-events-none disabled:text-disabled-foreground aria-pressed:bg-active-muted-background aria-pressed:text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring outline-none transition-[color,box-shadow] aria-invalid:ring-destructive-background/20 dark:aria-invalid:ring-destructive-background/40 aria-invalid:border-destructive-background whitespace-nowrap",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-transparent",
12
- outline: "border border-muted-background bg-transparent shadow-xs hover:bg-accent-background hover:text-foreground"
13
- },
14
- size: {
15
- default: "h-9 px-2 min-w-9",
16
- sm: "h-7 px-1.5 min-w-7",
17
- lg: "h-8 px-2.5 min-w-8"
18
- }
19
- },
20
- defaultVariants: {
21
- variant: "default",
22
- size: "default"
23
- }
24
- }
25
- ), h = (e, r) => {
26
- if (e == null || e === "")
27
- return null;
28
- const t = String(e);
29
- return /* @__PURE__ */ o(
30
- "span",
31
- {
32
- "data-slot": "toggle-count",
33
- className: s(
34
- "inline-flex h-4 min-w-4 items-center justify-center rounded-sm px-0.5 text-xs font-medium leading-3.5 tracking-tightest",
35
- r ? "bg-disabled-background text-disabled-foreground" : "bg-decorative-background-mountain text-decorative-foreground-mountain"
36
- ),
37
- children: t
38
- }
39
- );
40
- }, k = v(
41
- ({
42
- className: e,
43
- variant: r,
44
- size: t,
45
- icon: i,
46
- label: n,
47
- count: a,
48
- children: g,
49
- disabled: d,
50
- ...u
51
- }, l) => {
52
- const c = i !== void 0 || n !== void 0 || a !== void 0;
53
- return /* @__PURE__ */ o(
54
- b,
55
- {
56
- ref: l,
57
- "data-slot": "toggle",
58
- disabled: d,
59
- className: s(x({ variant: r, size: t, className: e })),
60
- ...u,
61
- children: g ?? (c && /* @__PURE__ */ m(f, { children: [
62
- i,
63
- n && /* @__PURE__ */ o("span", { "data-slot": "toggle-label", children: n }),
64
- h(a, d)
65
- ] }))
66
- }
67
- );
68
- }
69
- );
70
- k.displayName = "Toggle";
71
- export {
72
- k as Toggle,
73
- x as toggleVariants
74
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import { cva as a } from "class-variance-authority";
5
+ import { Toggle as o } from "@base-ui/react/toggle";
6
+ //#region libs/aura/src/components/ui/core/toggle/toggle.tsx
7
+ var s = a("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium text-muted-foreground hover:bg-accent-background hover:text-foreground disabled:pointer-events-none disabled:text-disabled-foreground aria-pressed:bg-active-muted-background aria-pressed:text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring-muted focus-visible:ring outline-none transition-[color,box-shadow] aria-invalid:ring-destructive-background/20 dark:aria-invalid:ring-destructive-background/40 aria-invalid:border-destructive-background whitespace-nowrap", {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-transparent",
11
+ outline: "border border-muted-background bg-transparent shadow-xs hover:bg-accent-background hover:text-foreground"
12
+ },
13
+ size: {
14
+ default: "h-9 px-2 min-w-9",
15
+ sm: "h-7 px-1.5 min-w-7",
16
+ lg: "h-8 px-2.5 min-w-8"
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "default",
21
+ size: "default"
22
+ }
23
+ }), c = (t, n) => {
24
+ if (t == null || t === "") return null;
25
+ let i = String(t);
26
+ return /* @__PURE__ */ r("span", {
27
+ "data-slot": "toggle-count",
28
+ className: e("inline-flex h-4 min-w-4 items-center justify-center rounded-sm px-0.5 text-xs font-medium leading-3.5 tracking-tightest", n ? "bg-disabled-background text-disabled-foreground" : "bg-decorative-background-mountain text-decorative-foreground-mountain"),
29
+ children: i
30
+ });
31
+ }, l = t(({ className: t, variant: a, size: l, icon: u, label: d, count: f, children: p, disabled: m, ...h }, g) => {
32
+ let _ = u !== void 0 || d !== void 0 || f !== void 0;
33
+ return /* @__PURE__ */ r(o, {
34
+ ref: g,
35
+ "data-slot": "toggle",
36
+ disabled: m,
37
+ className: e(s({
38
+ variant: a,
39
+ size: l,
40
+ className: t
41
+ })),
42
+ ...h,
43
+ children: p ?? (_ && /* @__PURE__ */ i(n, { children: [
44
+ u,
45
+ d && /* @__PURE__ */ r("span", {
46
+ "data-slot": "toggle-label",
47
+ children: d
48
+ }),
49
+ c(f, m)
50
+ ] }))
51
+ });
52
+ });
53
+ l.displayName = "Toggle";
54
+ //#endregion
55
+ export { l as Toggle, s as toggleVariants };