@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,200 +1,105 @@
1
- import { jsx as a, jsxs as u, Fragment as c } from "react/jsx-runtime";
2
- import { forwardRef as o } from "react";
3
- import { mergeProps as m } from "@base-ui/react/merge-props";
4
- import { useRender as l } from "@base-ui/react/use-render";
5
- import { IconDots as i, IconSlash as p } from "@tabler/icons-react";
6
- import { cn as n } from "../../../../lib/utils.js";
7
- const b = o(
8
- ({ ...e }, t) => /* @__PURE__ */ a(
9
- "nav",
10
- {
11
- ref: t,
12
- "aria-label": "breadcrumb",
13
- "data-slot": "breadcrumb",
14
- ...e
15
- }
16
- )
17
- );
18
- b.displayName = "Breadcrumb";
19
- const g = o(
20
- ({ className: e, ...t }, r) => /* @__PURE__ */ a(
21
- "ol",
22
- {
23
- ref: r,
24
- "data-slot": "breadcrumb-list",
25
- className: n(
26
- "flex items-center text-sm tracking-tight flex-wrap wrap-break-word",
27
- e
28
- ),
29
- ...t
30
- }
31
- )
32
- );
33
- g.displayName = "BreadcrumbList";
34
- const f = o(
35
- ({ className: e, ...t }, r) => /* @__PURE__ */ a(
36
- "li",
37
- {
38
- ref: r,
39
- "data-slot": "breadcrumb-item",
40
- className: n(
41
- "inline-flex items-center text-muted-foreground text-sm tracking-tight",
42
- "has-[button[data-popup-open]]:bg-accent-background has-[button[data-popup-open]]:text-foreground has-[button[data-popup-open]]:rounded-sm",
43
- e
44
- ),
45
- ...t
46
- }
47
- )
48
- );
49
- f.displayName = "BreadcrumbItem";
50
- const x = o(
51
- ({ className: e, render: t, children: r, ...s }, d) => l({
52
- defaultTagName: "a",
53
- ref: d,
54
- props: m(
55
- {
56
- ...{
57
- "data-slot": "breadcrumb-link"
58
- },
59
- className: n(
60
- "inline-flex h-7 items-center justify-center gap-2 rounded-md px-[6px] py-1",
61
- "text-muted-foreground text-sm leading-[18px] tracking-tight font-normal",
62
- "transition-colors hover:bg-accent-background hover:text-foreground",
63
- "aria-[current=page]:font-medium aria-[current=page]:text-foreground",
64
- e
65
- )
66
- },
67
- { ...s, children: r }
68
- ),
69
- render: t,
70
- state: {
71
- slot: "breadcrumb-link"
72
- }
73
- })
74
- );
75
- x.displayName = "BreadcrumbLink";
76
- const h = o(
77
- ({ className: e, ...t }, r) => /* @__PURE__ */ a(
78
- "span",
79
- {
80
- ref: r,
81
- "data-slot": "breadcrumb-page",
82
- role: "link",
83
- "aria-disabled": "true",
84
- "aria-current": "page",
85
- tabIndex: -1,
86
- className: n(
87
- "inline-flex h-7 items-center justify-center gap-2 rounded-md px-[6px] py-1",
88
- "cursor-default hover:bg-transparent dark:hover:bg-transparent",
89
- "text-sm leading-[18px] tracking-tight font-medium text-foreground",
90
- e
91
- ),
92
- ...t
93
- }
94
- )
95
- );
96
- h.displayName = "BreadcrumbPage";
97
- const N = o(
98
- ({ className: e, ...t }, r) => /* @__PURE__ */ a(
99
- "button",
100
- {
101
- ref: r,
102
- "data-slot": "breadcrumb-page-button",
103
- type: "button",
104
- "aria-current": "page",
105
- className: n(
106
- "inline-flex h-7 items-center justify-center gap-2 rounded-md px-[6px] py-1",
107
- "text-sm leading-[18px] tracking-tight font-medium text-foreground",
108
- "transition-colors hover:bg-accent-background",
109
- e
110
- ),
111
- ...t
112
- }
113
- )
114
- );
115
- N.displayName = "BreadcrumbPageButton";
116
- const y = o(
117
- ({ className: e, children: t, ...r }, s) => /* @__PURE__ */ a(
118
- "button",
119
- {
120
- ref: s,
121
- "data-slot": "breadcrumb-ellipsis-button",
122
- type: "button",
123
- className: n(
124
- "flex size-7 items-center justify-center rounded-md",
125
- "text-muted-foreground transition-colors hover:bg-accent-background hover:text-foreground",
126
- "data-[popup-open]:bg-accent-background data-[popup-open]:text-foreground",
127
- e
128
- ),
129
- ...r,
130
- children: t ?? /* @__PURE__ */ u(c, { children: [
131
- /* @__PURE__ */ a(i, { className: "size-3" }),
132
- /* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
133
- ] })
134
- }
135
- )
136
- );
137
- y.displayName = "BreadcrumbEllipsisButton";
138
- const B = o(
139
- ({ children: e, className: t, ...r }, s) => /* @__PURE__ */ a(
140
- "li",
141
- {
142
- ref: s,
143
- "data-slot": "breadcrumb-separator",
144
- role: "presentation",
145
- "aria-hidden": "true",
146
- className: n(
147
- "flex size-4 items-center justify-center [&>svg]:size-4",
148
- t
149
- ),
150
- ...r,
151
- children: e ?? /* @__PURE__ */ a(p, { className: "size-4 text-muted-foreground" })
152
- }
153
- )
154
- );
155
- B.displayName = "BreadcrumbSeparator";
156
- const k = o(
157
- ({ children: e, className: t, ...r }, s) => {
158
- const d = e != null;
159
- return /* @__PURE__ */ a(
160
- "li",
161
- {
162
- ref: s,
163
- "data-slot": "breadcrumb-ellipsis",
164
- role: d ? void 0 : "presentation",
165
- "aria-hidden": d ? void 0 : !0,
166
- className: n(
167
- "inline-flex items-center",
168
- "has-[button[data-popup-open]]:bg-accent-background has-[button[data-popup-open]]:text-foreground has-[button[data-popup-open]]:rounded-sm",
169
- t
170
- ),
171
- ...r,
172
- children: e ?? /* @__PURE__ */ u(
173
- "span",
174
- {
175
- className: n(
176
- "flex size-7 items-center justify-center rounded-md",
177
- "cursor-default text-muted-foreground hover:bg-transparent dark:hover:bg-transparent"
178
- ),
179
- children: [
180
- /* @__PURE__ */ a(i, { className: "size-3" }),
181
- /* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
182
- ]
183
- }
184
- )
185
- }
186
- );
187
- }
188
- );
189
- k.displayName = "BreadcrumbEllipsis";
190
- export {
191
- b as Breadcrumb,
192
- k as BreadcrumbEllipsis,
193
- y as BreadcrumbEllipsisButton,
194
- f as BreadcrumbItem,
195
- x as BreadcrumbLink,
196
- g as BreadcrumbList,
197
- h as BreadcrumbPage,
198
- N as BreadcrumbPageButton,
199
- B as BreadcrumbSeparator
200
- };
1
+ import { cn as e } from "../../../../lib/utils.js";
2
+ import { forwardRef as t } from "react";
3
+ import { IconDots as n, IconSlash as r } from "@tabler/icons-react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { mergeProps as s } from "@base-ui/react/merge-props";
6
+ import { useRender as c } from "@base-ui/react/use-render";
7
+ //#region libs/aura/src/components/ui/core/breadcrumb/breadcrumb.tsx
8
+ var l = t(({ ...e }, t) => /* @__PURE__ */ a("nav", {
9
+ ref: t,
10
+ "aria-label": "breadcrumb",
11
+ "data-slot": "breadcrumb",
12
+ ...e
13
+ }));
14
+ l.displayName = "Breadcrumb";
15
+ var u = t(({ className: t, ...n }, r) => /* @__PURE__ */ a("ol", {
16
+ ref: r,
17
+ "data-slot": "breadcrumb-list",
18
+ className: e("flex items-center text-sm tracking-tight flex-wrap wrap-break-word", t),
19
+ ...n
20
+ }));
21
+ u.displayName = "BreadcrumbList";
22
+ var d = t(({ className: t, ...n }, r) => /* @__PURE__ */ a("li", {
23
+ ref: r,
24
+ "data-slot": "breadcrumb-item",
25
+ className: e("inline-flex items-center text-muted-foreground text-sm tracking-tight", "has-[button[data-popup-open]]:bg-accent-background has-[button[data-popup-open]]:text-foreground has-[button[data-popup-open]]:rounded-sm", t),
26
+ ...n
27
+ }));
28
+ d.displayName = "BreadcrumbItem";
29
+ var f = t(({ className: t, render: n, children: r, ...i }, a) => c({
30
+ defaultTagName: "a",
31
+ ref: a,
32
+ props: s({
33
+ "data-slot": "breadcrumb-link",
34
+ className: e("inline-flex h-7 items-center justify-center gap-2 rounded-md px-[6px] py-1", "text-muted-foreground text-sm leading-[18px] tracking-tight font-normal", "transition-colors hover:bg-accent-background hover:text-foreground", "aria-[current=page]:font-medium aria-[current=page]:text-foreground", t)
35
+ }, {
36
+ ...i,
37
+ children: r
38
+ }),
39
+ render: n,
40
+ state: { slot: "breadcrumb-link" }
41
+ }));
42
+ f.displayName = "BreadcrumbLink";
43
+ var p = t(({ className: t, ...n }, r) => /* @__PURE__ */ a("span", {
44
+ ref: r,
45
+ "data-slot": "breadcrumb-page",
46
+ role: "link",
47
+ "aria-disabled": "true",
48
+ "aria-current": "page",
49
+ tabIndex: -1,
50
+ className: e("inline-flex h-7 items-center justify-center gap-2 rounded-md px-[6px] py-1", "cursor-default hover:bg-transparent dark:hover:bg-transparent", "text-sm leading-[18px] tracking-tight font-medium text-foreground", t),
51
+ ...n
52
+ }));
53
+ p.displayName = "BreadcrumbPage";
54
+ var m = t(({ className: t, ...n }, r) => /* @__PURE__ */ a("button", {
55
+ ref: r,
56
+ "data-slot": "breadcrumb-page-button",
57
+ type: "button",
58
+ "aria-current": "page",
59
+ className: e("inline-flex h-7 items-center justify-center gap-2 rounded-md px-[6px] py-1", "text-sm leading-[18px] tracking-tight font-medium text-foreground", "transition-colors hover:bg-accent-background", t),
60
+ ...n
61
+ }));
62
+ m.displayName = "BreadcrumbPageButton";
63
+ var h = t(({ className: t, children: r, ...s }, c) => /* @__PURE__ */ a("button", {
64
+ ref: c,
65
+ "data-slot": "breadcrumb-ellipsis-button",
66
+ type: "button",
67
+ className: e("flex size-7 items-center justify-center rounded-md", "text-muted-foreground transition-colors hover:bg-accent-background hover:text-foreground", "data-[popup-open]:bg-accent-background data-[popup-open]:text-foreground", t),
68
+ ...s,
69
+ children: r ?? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, { className: "size-3" }), /* @__PURE__ */ a("span", {
70
+ className: "sr-only",
71
+ children: "More"
72
+ })] })
73
+ }));
74
+ h.displayName = "BreadcrumbEllipsisButton";
75
+ var g = t(({ children: t, className: n, ...i }, o) => /* @__PURE__ */ a("li", {
76
+ ref: o,
77
+ "data-slot": "breadcrumb-separator",
78
+ role: "presentation",
79
+ "aria-hidden": "true",
80
+ className: e("flex size-4 items-center justify-center [&>svg]:size-4", n),
81
+ ...i,
82
+ children: t ?? /* @__PURE__ */ a(r, { className: "size-4 text-muted-foreground" })
83
+ }));
84
+ g.displayName = "BreadcrumbSeparator";
85
+ var _ = t(({ children: t, className: r, ...i }, s) => {
86
+ let c = t != null;
87
+ return /* @__PURE__ */ a("li", {
88
+ ref: s,
89
+ "data-slot": "breadcrumb-ellipsis",
90
+ role: c ? void 0 : "presentation",
91
+ "aria-hidden": !c || void 0,
92
+ className: e("inline-flex items-center", "has-[button[data-popup-open]]:bg-accent-background has-[button[data-popup-open]]:text-foreground has-[button[data-popup-open]]:rounded-sm", r),
93
+ ...i,
94
+ children: t ?? /* @__PURE__ */ o("span", {
95
+ className: e("flex size-7 items-center justify-center rounded-md", "cursor-default text-muted-foreground hover:bg-transparent dark:hover:bg-transparent"),
96
+ children: [/* @__PURE__ */ a(n, { className: "size-3" }), /* @__PURE__ */ a("span", {
97
+ className: "sr-only",
98
+ children: "More"
99
+ })]
100
+ })
101
+ });
102
+ });
103
+ _.displayName = "BreadcrumbEllipsis";
104
+ //#endregion
105
+ export { l as Breadcrumb, _ as BreadcrumbEllipsis, h as BreadcrumbEllipsisButton, d as BreadcrumbItem, f as BreadcrumbLink, u as BreadcrumbList, p as BreadcrumbPage, m as BreadcrumbPageButton, g as BreadcrumbSeparator };
@@ -1,52 +1,47 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as g } from "react";
3
- import { Button as b } from "@base-ui/react/button";
4
- import { cva as c } from "class-variance-authority";
5
- import { focusRing as u, focusRingDestructive as f, cn as l } from "../../../../lib/utils.js";
6
- const v = c(
7
- `inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm leading-4.5 tracking-normal font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 ${u} aria-invalid:focus-visible:shadow-focus-ring-destructive`,
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-primary-background text-foreground-on-primary hover:bg-primary-background-hover",
12
- defaultOnDark: "bg-primary-background-fixed-dark text-foreground-fixed-dark hover:bg-primary-background-fixed-dark-hover disabled:opacity-100 disabled:bg-disabled-background-fixed-dark disabled:text-disabled-foreground-fixed-dark",
13
- secondary: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover",
14
- secondaryOnDark: "bg-secondary-background-fixed-dark text-foreground-fixed-light hover:bg-secondary-background-fixed-dark-hover disabled:opacity-100 disabled:bg-disabled-background-fixed-dark disabled:text-disabled-foreground-fixed-dark",
15
- outline: "border border-border-emphasized bg-background text-foreground hover:bg-accent-background disabled:border-transparent disabled:bg-disabled-background",
16
- ghost: "hover:bg-accent-background",
17
- ghostOnDark: "text-foreground-fixed-light hover:bg-secondary-background-fixed-dark disabled:opacity-100 disabled:text-disabled-foreground-fixed-dark",
18
- destructive: `bg-destructive-background text-destructive-foreground-on-critical hover:bg-destructive-background-hover ${f}`
19
- },
20
- size: {
21
- default: "h-9 px-3 has-[>svg]:px-3",
22
- sm: "h-7 rounded-md gap-1.5 px-2 has-[>svg]:px-2",
23
- lg: "h-10 px-4 has-[>svg]:px-4",
24
- icon: "size-9",
25
- "icon-sm": "size-7",
26
- "icon-lg": "size-10"
27
- }
28
- },
29
- defaultVariants: {
30
- variant: "default",
31
- size: "default"
32
- }
33
- }
34
- ), k = g(
35
- ({ className: r, variant: d, size: a, children: o, render: e, nativeButton: t, ...i }, n) => /* @__PURE__ */ s(
36
- b,
37
- {
38
- ref: n,
39
- "data-slot": "button",
40
- render: e,
41
- nativeButton: t ?? (e ? !1 : void 0),
42
- className: l(v({ variant: d, size: a, className: r })),
43
- ...i,
44
- children: o
45
- }
46
- )
47
- );
48
- k.displayName = "Button";
49
- export {
50
- k as Button,
51
- v as buttonVariants
52
- };
1
+ import { cn as e, focusRing as t, focusRingDestructive as n } from "../../../../lib/utils.js";
2
+ import { forwardRef as r } from "react";
3
+ import { jsx as i } from "react/jsx-runtime";
4
+ import { cva as a } from "class-variance-authority";
5
+ import { Button as o } from "@base-ui/react/button";
6
+ //#region libs/aura/src/components/ui/core/button/button.tsx
7
+ var s = a(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm leading-4.5 tracking-normal font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 ${t} aria-invalid:focus-visible:shadow-focus-ring-destructive`, {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-primary-background text-foreground-on-primary hover:bg-primary-background-hover",
11
+ defaultOnDark: "bg-primary-background-fixed-dark text-foreground-fixed-dark hover:bg-primary-background-fixed-dark-hover disabled:opacity-100 disabled:bg-disabled-background-fixed-dark disabled:text-disabled-foreground-fixed-dark",
12
+ secondary: "bg-secondary-background text-secondary-foreground hover:bg-secondary-background-hover",
13
+ secondaryOnDark: "bg-secondary-background-fixed-dark text-foreground-fixed-light hover:bg-secondary-background-fixed-dark-hover disabled:opacity-100 disabled:bg-disabled-background-fixed-dark disabled:text-disabled-foreground-fixed-dark",
14
+ outline: "border border-border-emphasized bg-background text-foreground hover:bg-accent-background disabled:border-transparent disabled:bg-disabled-background",
15
+ ghost: "hover:bg-accent-background",
16
+ ghostOnDark: "text-foreground-fixed-light hover:bg-secondary-background-fixed-dark disabled:opacity-100 disabled:text-disabled-foreground-fixed-dark",
17
+ destructive: `bg-destructive-background text-destructive-foreground-on-critical hover:bg-destructive-background-hover ${n}`
18
+ },
19
+ size: {
20
+ default: "h-9 px-3 has-[>svg]:px-3",
21
+ sm: "h-7 rounded-md gap-1.5 px-2 has-[>svg]:px-2",
22
+ lg: "h-10 px-4 has-[>svg]:px-4",
23
+ icon: "size-9",
24
+ "icon-sm": "size-7",
25
+ "icon-lg": "size-10"
26
+ }
27
+ },
28
+ defaultVariants: {
29
+ variant: "default",
30
+ size: "default"
31
+ }
32
+ }), c = r(({ className: t, variant: n, size: r, children: a, render: c, nativeButton: l, ...u }, d) => /* @__PURE__ */ i(o, {
33
+ ref: d,
34
+ "data-slot": "button",
35
+ render: c,
36
+ nativeButton: l ?? (!c && void 0),
37
+ className: e(s({
38
+ variant: n,
39
+ size: r,
40
+ className: t
41
+ })),
42
+ ...u,
43
+ children: a
44
+ }));
45
+ c.displayName = "Button";
46
+ //#endregion
47
+ export { c as Button, s as buttonVariants };
@@ -1,83 +1,44 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { mergeProps as s } from "@base-ui/react/merge-props";
3
- import { useRender as i } from "@base-ui/react/use-render";
4
- import { cva as l } from "class-variance-authority";
5
1
  import { cn as e } from "../../../../lib/utils.js";
6
- import { Separator as d } from "../separator/separator.js";
7
- const u = l(
8
- "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
9
- {
10
- variants: {
11
- orientation: {
12
- horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
13
- vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
14
- }
15
- },
16
- defaultVariants: {
17
- orientation: "horizontal"
18
- }
19
- }
20
- );
21
- function b({
22
- className: o,
23
- orientation: t,
24
- ...r
25
- }) {
26
- return /* @__PURE__ */ a(
27
- "div",
28
- {
29
- role: "group",
30
- "data-slot": "button-group",
31
- "data-orientation": t,
32
- className: e(u({ orientation: t }), o),
33
- ...r
34
- }
35
- );
2
+ import { Separator as t } from "../separator/separator.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { cva as r } from "class-variance-authority";
5
+ import { mergeProps as i } from "@base-ui/react/merge-props";
6
+ import { useRender as a } from "@base-ui/react/use-render";
7
+ //#region libs/aura/src/components/ui/core/button-group/button-group.tsx
8
+ var o = r("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2", {
9
+ variants: { orientation: {
10
+ horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
11
+ vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
12
+ } },
13
+ defaultVariants: { orientation: "horizontal" }
14
+ });
15
+ function s({ className: t, orientation: r, ...i }) {
16
+ return /* @__PURE__ */ n("div", {
17
+ role: "group",
18
+ "data-slot": "button-group",
19
+ "data-orientation": r,
20
+ className: e(o({ orientation: r }), t),
21
+ ...i
22
+ });
36
23
  }
37
- function v({
38
- className: o,
39
- render: t,
40
- children: r,
41
- ...n
42
- }) {
43
- return i({
44
- defaultTagName: "div",
45
- props: s(
46
- {
47
- className: e(
48
- "bg-muted-background flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
49
- o
50
- )
51
- },
52
- { ...n, children: r }
53
- ),
54
- render: t,
55
- state: {
56
- slot: "button-group-text"
57
- }
58
- });
24
+ function c({ className: t, render: n, children: r, ...o }) {
25
+ return a({
26
+ defaultTagName: "div",
27
+ props: i({ className: e("bg-muted-background flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", t) }, {
28
+ ...o,
29
+ children: r
30
+ }),
31
+ render: n,
32
+ state: { slot: "button-group-text" }
33
+ });
59
34
  }
60
- function x({
61
- className: o,
62
- orientation: t = "vertical",
63
- ...r
64
- }) {
65
- return /* @__PURE__ */ a(
66
- d,
67
- {
68
- "data-slot": "button-group-separator",
69
- orientation: t,
70
- className: e(
71
- "bg-muted-background relative m-0 self-stretch data-[orientation=vertical]:h-auto",
72
- o
73
- ),
74
- ...r
75
- }
76
- );
35
+ function l({ className: r, orientation: i = "vertical", ...a }) {
36
+ return /* @__PURE__ */ n(t, {
37
+ "data-slot": "button-group-separator",
38
+ orientation: i,
39
+ className: e("bg-muted-background relative m-0 self-stretch data-[orientation=vertical]:h-auto", r),
40
+ ...a
41
+ });
77
42
  }
78
- export {
79
- b as ButtonGroup,
80
- x as ButtonGroupSeparator,
81
- v as ButtonGroupText,
82
- u as buttonGroupVariants
83
- };
43
+ //#endregion
44
+ export { s as ButtonGroup, l as ButtonGroupSeparator, c as ButtonGroupText, o as buttonGroupVariants };