@pibit.ai/cure-design-system 0.6.23 → 0.6.25

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 (44) hide show
  1. package/dist/index.d.ts +5 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +403 -388
  4. package/dist/patterns/sub-sidebar/sub-sidebar.js +2 -2
  5. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +19 -19
  6. package/dist/patterns/table/toolbar/TableViewsDropdown.js +1 -1
  7. package/dist/primitives/button-group/button-group.d.ts +45 -0
  8. package/dist/primitives/button-group/button-group.d.ts.map +1 -0
  9. package/dist/primitives/button-group/button-group.js +73 -0
  10. package/dist/primitives/button-group/index.d.ts +2 -0
  11. package/dist/primitives/button-group/index.d.ts.map +1 -0
  12. package/dist/primitives/checkbox/checkbox.js +1 -1
  13. package/dist/primitives/input/hint-text.js +5 -5
  14. package/dist/primitives/input/index.d.ts +1 -0
  15. package/dist/primitives/input/index.d.ts.map +1 -1
  16. package/dist/primitives/input/input-group.d.ts +31 -0
  17. package/dist/primitives/input/input-group.d.ts.map +1 -0
  18. package/dist/primitives/input/input-group.js +116 -0
  19. package/dist/primitives/progress-bar/index.d.ts +2 -0
  20. package/dist/primitives/progress-bar/index.d.ts.map +1 -0
  21. package/dist/primitives/progress-bar/progress-bar.d.ts +52 -0
  22. package/dist/primitives/progress-bar/progress-bar.d.ts.map +1 -0
  23. package/dist/primitives/progress-bar/progress-bar.js +96 -0
  24. package/dist/primitives/segmented-control/index.d.ts +2 -0
  25. package/dist/primitives/segmented-control/index.d.ts.map +1 -0
  26. package/dist/primitives/segmented-control/segmented-control.d.ts +21 -0
  27. package/dist/primitives/segmented-control/segmented-control.d.ts.map +1 -0
  28. package/dist/primitives/segmented-control/segmented-control.js +43 -0
  29. package/dist/primitives/select/multi-select.js +20 -20
  30. package/dist/primitives/slider/index.d.ts +3 -0
  31. package/dist/primitives/slider/index.d.ts.map +1 -0
  32. package/dist/primitives/slider/range-slider.d.ts +24 -0
  33. package/dist/primitives/slider/range-slider.d.ts.map +1 -0
  34. package/dist/primitives/slider/range-slider.js +115 -0
  35. package/dist/primitives/slider/slider.d.ts +13 -0
  36. package/dist/primitives/slider/slider.d.ts.map +1 -0
  37. package/dist/primitives/slider/slider.js +55 -0
  38. package/dist/styles/components.css +1 -1
  39. package/dist/styles/theme.css +1 -1
  40. package/dist/utils/cn.d.ts.map +1 -1
  41. package/dist/utils/cn.js +12 -10
  42. package/dist/utils/cn.test.d.ts +2 -0
  43. package/dist/utils/cn.test.d.ts.map +1 -0
  44. package/package.json +1 -1
@@ -102,7 +102,7 @@ const T = ({
102
102
  /* @__PURE__ */ r("nav", { className: "flex-1 pb-4 pr-2 overflow-y-auto overflow-x-hidden", children: i.sections.map((a) => /* @__PURE__ */ r(u, { children: h(
103
103
  (a == null ? void 0 : a.permissions) || [],
104
104
  /* @__PURE__ */ o("div", { className: n("mb-6"), children: [
105
- /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-[10px] text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
105
+ /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
106
106
  /* @__PURE__ */ r("ul", { className: "space-y-1", children: a.items.map((e) => {
107
107
  const t = e.href || e.label, l = E.has(t), N = e.items && e.items.length > 0, p = v(e);
108
108
  return N ? /* @__PURE__ */ r(u, { children: h(
@@ -255,7 +255,7 @@ const T = ({
255
255
  }) })
256
256
  ] }),
257
257
  a.showDisabled ? /* @__PURE__ */ o("div", { className: n("mb-6"), children: [
258
- /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-[10px] text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
258
+ /* @__PURE__ */ r("div", { className: "py-0.5 px-2", children: /* @__PURE__ */ r("p", { className: "font-medium text-3xs text-[var(--color-text-tertiary)] uppercase tracking-[1.3px] whitespace-nowrap", children: a.label }) }),
259
259
  /* @__PURE__ */ r("ul", { className: "", children: a.items.map((e) => {
260
260
  const t = e.href || e.label, l = v(e);
261
261
  return /* @__PURE__ */ r(
@@ -4,10 +4,10 @@ import { AlignLeft as Z, AlignCenter as B, AlignRight as G, ChevronDown as K, Ey
4
4
  import { Button as j } from "react-aria-components";
5
5
  import { cx as m } from "../../../utils/cn.js";
6
6
  import { Dropdown as N } from "../../../primitives/dropdown/dropdown.js";
7
- const a = ({
7
+ const s = ({
8
8
  icon: o,
9
9
  label: c,
10
- danger: s,
10
+ danger: a,
11
11
  submenu: f,
12
12
  selected: p,
13
13
  disabled: r,
@@ -25,7 +25,7 @@ const a = ({
25
25
  "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium transition-colors w-full text-left",
26
26
  r ? "cursor-not-allowed text-disabled" : m(
27
27
  "cursor-pointer",
28
- s ? "text-error-primary hover:bg-error-primary" : p ? "bg-utility-brand-25 text-secondary" : "text-secondary hover:bg-primary_hover"
28
+ a ? "text-error-primary hover:bg-error-primary" : p ? "bg-utility-brand-25 text-secondary" : "text-secondary hover:bg-primary_hover"
29
29
  )
30
30
  ),
31
31
  children: [
@@ -35,7 +35,7 @@ const a = ({
35
35
  size: 16,
36
36
  className: m(
37
37
  "shrink-0",
38
- r ? "text-fg-disabled" : s ? "text-error-primary" : "text-fg-quaternary"
38
+ r ? "text-fg-disabled" : a ? "text-error-primary" : "text-fg-quaternary"
39
39
  )
40
40
  }
41
41
  ),
@@ -44,7 +44,7 @@ const a = ({
44
44
  f && /* @__PURE__ */ e(E, { size: 14, className: "shrink-0 text-fg-quaternary" })
45
45
  ]
46
46
  }
47
- ), i = () => /* @__PURE__ */ e("div", { className: "my-1 h-px w-full bg-secondary" }), M = ({ children: o }) => /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-wider text-tertiary", children: o }), le = ({ label: o, suffix: c }) => /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5 rounded-md border border-secondary bg-primary px-1.5 py-0.5", children: [
47
+ ), i = () => /* @__PURE__ */ e("div", { className: "my-1 h-px w-full bg-secondary" }), M = ({ children: o }) => /* @__PURE__ */ e("span", { className: "text-3xs font-medium uppercase tracking-wider text-tertiary", children: o }), le = ({ label: o, suffix: c }) => /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1.5 rounded-md border border-secondary bg-primary px-1.5 py-0.5", children: [
48
48
  /* @__PURE__ */ e("span", { className: "flex h-4 w-4 items-center justify-center rounded-sm border border-secondary text-[9px] font-semibold text-tertiary", children: "T" }),
49
49
  /* @__PURE__ */ e("span", { className: "text-xs font-semibold text-primary", children: o }),
50
50
  c && /* @__PURE__ */ e("span", { className: "text-xs text-tertiary", children: c })
@@ -55,7 +55,7 @@ const a = ({
55
55
  ], pe = ({
56
56
  column: o,
57
57
  columnLabel: c,
58
- fieldDef: s,
58
+ fieldDef: a,
59
59
  currentAlignment: f,
60
60
  textWrapped: p = !1,
61
61
  capabilities: r,
@@ -66,7 +66,7 @@ const a = ({
66
66
  isHeaderHovered: H = !1
67
67
  }) => {
68
68
  var _, q;
69
- const F = (s == null ? void 0 : s.data_type) ?? o.dataType, y = F === "LOOKUP" || o.variant === "lookup", L = F === "DERIVED" || o.variant === "derived", I = y ? "Hide field" : "Hide column", x = (r == null ? void 0 : r.sort) ?? !0, v = (r == null ? void 0 : r.align) ?? !0, k = (r == null ? void 0 : r.textWrap) ?? !1, w = (r == null ? void 0 : r.filter) ?? !0, b = (r == null ? void 0 : r.hide) ?? !0, [P, R] = z(!1), [U, A] = z(!1), V = !T || P || H, l = (t) => {
69
+ const F = (a == null ? void 0 : a.data_type) ?? o.dataType, y = F === "LOOKUP" || o.variant === "lookup", L = F === "DERIVED" || o.variant === "derived", I = y ? "Hide field" : "Hide column", x = (r == null ? void 0 : r.sort) ?? !0, v = (r == null ? void 0 : r.align) ?? !0, k = (r == null ? void 0 : r.textWrap) ?? !1, w = (r == null ? void 0 : r.filter) ?? !0, b = (r == null ? void 0 : r.hide) ?? !0, [P, R] = z(!1), [U, A] = z(!1), V = !T || P || H, l = (t) => {
70
70
  u(t), A(!1), R(!1);
71
71
  }, S = O.find((t) => t.id === f) ?? O[0], W = S.icon, C = h == null ? void 0 : h(o);
72
72
  return /* @__PURE__ */ n(
@@ -104,11 +104,11 @@ const a = ({
104
104
  /* @__PURE__ */ e(le, { label: c, suffix: "Object name" })
105
105
  ] }),
106
106
  /* @__PURE__ */ e(i, {}),
107
- /* @__PURE__ */ e(a, { icon: $, label: "View Field", onClick: () => l({ type: "lookup-view" }) }),
108
- /* @__PURE__ */ e(a, { icon: J, label: "Edit field", onClick: () => l({ type: "lookup-edit" }) }),
107
+ /* @__PURE__ */ e(s, { icon: $, label: "View Field", onClick: () => l({ type: "lookup-view" }) }),
108
+ /* @__PURE__ */ e(s, { icon: J, label: "Edit field", onClick: () => l({ type: "lookup-edit" }) }),
109
109
  /* @__PURE__ */ e(i, {}),
110
110
  /* @__PURE__ */ e(
111
- a,
111
+ s,
112
112
  {
113
113
  icon: Q,
114
114
  label: "Add field to right",
@@ -116,7 +116,7 @@ const a = ({
116
116
  }
117
117
  ),
118
118
  /* @__PURE__ */ e(
119
- a,
119
+ s,
120
120
  {
121
121
  icon: X,
122
122
  label: "Add field to left",
@@ -128,7 +128,7 @@ const a = ({
128
128
  L && /* @__PURE__ */ n(d, { children: [
129
129
  /* @__PURE__ */ n("div", { className: "flex flex-col gap-1.5 px-2 py-2", children: [
130
130
  /* @__PURE__ */ e(M, { children: "Formula" }),
131
- /* @__PURE__ */ e("div", { className: "text-xs font-medium text-secondary break-words", children: ((_ = s == null ? void 0 : s.formula) == null ? void 0 : _.trim()) || ((q = o.formula) == null ? void 0 : q.trim()) || c })
131
+ /* @__PURE__ */ e("div", { className: "text-xs font-medium text-secondary break-words", children: ((_ = a == null ? void 0 : a.formula) == null ? void 0 : _.trim()) || ((q = o.formula) == null ? void 0 : q.trim()) || c })
132
132
  ] }),
133
133
  /* @__PURE__ */ e(i, {})
134
134
  ] }),
@@ -139,7 +139,7 @@ const a = ({
139
139
  C && (x || v || k || w || b) && /* @__PURE__ */ e(i, {}),
140
140
  x && /* @__PURE__ */ n(d, { children: [
141
141
  /* @__PURE__ */ e(
142
- a,
142
+ s,
143
143
  {
144
144
  icon: Y,
145
145
  label: "Sort A to Z",
@@ -147,7 +147,7 @@ const a = ({
147
147
  }
148
148
  ),
149
149
  /* @__PURE__ */ e(
150
- a,
150
+ s,
151
151
  {
152
152
  icon: D,
153
153
  label: "Sort Z to A",
@@ -180,7 +180,7 @@ const a = ({
180
180
  placement: "right top",
181
181
  className: "w-44",
182
182
  children: /* @__PURE__ */ e("div", { className: "flex flex-col py-1 px-1.5", children: O.map((t) => /* @__PURE__ */ e(
183
- a,
183
+ s,
184
184
  {
185
185
  icon: t.icon,
186
186
  label: t.label,
@@ -196,7 +196,7 @@ const a = ({
196
196
  k && /* @__PURE__ */ n(d, { children: [
197
197
  (x || v) && /* @__PURE__ */ e(i, {}),
198
198
  /* @__PURE__ */ e(
199
- a,
199
+ s,
200
200
  {
201
201
  icon: ee,
202
202
  label: "Text wrap",
@@ -207,9 +207,9 @@ const a = ({
207
207
  ] }),
208
208
  (w || b) && /* @__PURE__ */ n(d, { children: [
209
209
  (x || v) && !k && /* @__PURE__ */ e(i, {}),
210
- w && /* @__PURE__ */ e(a, { icon: re, label: "Filter by", onClick: () => l({ type: "filter" }) }),
210
+ w && /* @__PURE__ */ e(s, { icon: re, label: "Filter by", onClick: () => l({ type: "filter" }) }),
211
211
  b && /* @__PURE__ */ e(
212
- a,
212
+ s,
213
213
  {
214
214
  icon: te,
215
215
  label: I,
@@ -222,7 +222,7 @@ const a = ({
222
222
  y && /* @__PURE__ */ n(d, { children: [
223
223
  /* @__PURE__ */ e(i, {}),
224
224
  /* @__PURE__ */ e(
225
- a,
225
+ s,
226
226
  {
227
227
  icon: ne,
228
228
  label: "Delete fields",
@@ -180,7 +180,7 @@ const L = ({ config: e, isDisabled: r }) => {
180
180
  o.id
181
181
  )),
182
182
  d.length > 0 && /* @__PURE__ */ s(f, { children: [
183
- /* @__PURE__ */ t("div", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold tracking-wide text-tertiary uppercase", children: "Shared with me" }),
183
+ /* @__PURE__ */ t("div", { className: "px-2.5 pb-1 pt-2 text-3xs font-semibold tracking-wide text-tertiary uppercase", children: "Shared with me" }),
184
184
  d.map((o) => /* @__PURE__ */ t(
185
185
  h,
186
186
  {
@@ -0,0 +1,45 @@
1
+ import { FC, PropsWithChildren, ReactNode, RefAttributes } from 'react';
2
+ import { ToggleButtonGroupProps, ToggleButtonProps } from 'react-aria-components';
3
+ declare const styles: {
4
+ common: {
5
+ root: string;
6
+ icon: string;
7
+ };
8
+ sizes: {
9
+ xs: {
10
+ root: string;
11
+ icon: string;
12
+ };
13
+ sm: {
14
+ root: string;
15
+ icon: string;
16
+ };
17
+ md: {
18
+ root: string;
19
+ icon: string;
20
+ };
21
+ lg: {
22
+ root: string;
23
+ icon: string;
24
+ };
25
+ };
26
+ };
27
+ type ButtonSize = keyof typeof styles.sizes;
28
+ export interface ButtonGroupItemProps extends ToggleButtonProps, RefAttributes<HTMLButtonElement> {
29
+ iconLeading?: FC<{
30
+ className?: string;
31
+ }> | ReactNode;
32
+ iconTrailing?: FC<{
33
+ className?: string;
34
+ }> | ReactNode;
35
+ onClick?: () => void;
36
+ className?: string;
37
+ }
38
+ export declare const ButtonGroupItem: ({ iconLeading: IconLeading, iconTrailing: IconTrailing, children, className, ...otherProps }: PropsWithChildren<ButtonGroupItemProps>) => import("react/jsx-runtime").JSX.Element;
39
+ export interface ButtonGroupProps extends Omit<ToggleButtonGroupProps, "orientation">, RefAttributes<HTMLDivElement> {
40
+ size?: ButtonSize;
41
+ className?: string;
42
+ }
43
+ export declare const ButtonGroup: ({ children, size, className, ...otherProps }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
44
+ export {};
45
+ //# sourceMappingURL=button-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-group/button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAAE,EACP,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,aAAa,EAIrB,MAAM,OAAO,CAAC;AACf,OAAO,EAGH,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACzB,MAAM,uBAAuB,CAAC;AAI/B,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAgCV,CAAC;AAEH,KAAK,UAAU,GAAG,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC;AAI5C,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB,EAAE,aAAa,CAAC,iBAAiB,CAAC;IAC7F,WAAW,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IACrD,YAAY,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IACtD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,GAAI,8FAM7B,iBAAiB,CAAC,oBAAoB,CAAC,4CAyBzC,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,aAAa,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC;IAChH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,GAAI,8CAAqD,gBAAgB,4CAYhG,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
+ import { createContext as m, useContext as x, isValidElement as l } from "react";
3
+ import { ToggleButtonGroup as g, ToggleButton as b } from "react-aria-components";
4
+ import { cx as s, sortCx as v } from "../../utils/cn.js";
5
+ import { isReactComponent as d } from "../../utils/is-react-component.js";
6
+ const t = v({
7
+ common: {
8
+ root: [
9
+ "group/button-group inline-flex h-max cursor-pointer items-center bg-primary font-semibold whitespace-nowrap text-secondary shadow-skeumorphic ring-1 ring-[var(--border-color-secondary)] outline-[var(--border-color-secondary)] transition duration-100 ease-linear ring-inset",
10
+ // Hover and focus styles
11
+ "hover:bg-primary_hover hover:text-secondary_hover focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2",
12
+ // Disabled styles
13
+ "disabled:cursor-not-allowed disabled:bg-primary disabled:text-disabled",
14
+ // Selected styles
15
+ "selected:bg-active selected:text-secondary_hover selected:disabled:bg-disabled_subtle"
16
+ ].join(" "),
17
+ icon: "pointer-events-none text-fg-quaternary transition-[inherit] group-hover/button-group:text-fg-quaternary_hover group-disabled/button-group:text-fg-disabled_subtle"
18
+ },
19
+ sizes: {
20
+ xs: {
21
+ root: "gap-1.5 px-2 py-1.5 text-[12px] first:rounded-l-md last:rounded-r-md data-icon-leading:pl-1.5 data-icon-only:p-1.5 ",
22
+ icon: "size-4.5"
23
+ },
24
+ sm: {
25
+ root: "gap-1.5 px-3.5 py-2 text-sm not-last:pr-[calc(calc(var(--spacing)*3.5)+1px)] first:rounded-l-lg last:rounded-r-lg data-icon-leading:pl-3 data-icon-only:p-2",
26
+ icon: "size-5"
27
+ },
28
+ md: {
29
+ root: "gap-1.5 px-4 py-2.5 text-sm not-last:pr-[calc(calc(var(--spacing)*4)+1px)] first:rounded-l-lg last:rounded-r-lg data-icon-leading:pl-3.5 data-icon-only:px-3",
30
+ icon: "size-5"
31
+ },
32
+ lg: {
33
+ root: "gap-2 px-4.5 py-2.5 text-md not-last:pr-[calc(calc(var(--spacing)*4.5)+1px)] first:rounded-l-lg last:rounded-r-lg data-icon-leading:pl-4 data-icon-only:p-3",
34
+ icon: "size-5"
35
+ }
36
+ }
37
+ }), c = m({ size: "md" }), B = ({
38
+ iconLeading: o,
39
+ iconTrailing: e,
40
+ children: r,
41
+ className: i,
42
+ ...p
43
+ }) => {
44
+ const { size: a } = x(c);
45
+ return /* @__PURE__ */ u(
46
+ b,
47
+ {
48
+ ...p,
49
+ "data-icon-only": (o || e) && !r ? !0 : void 0,
50
+ "data-icon-leading": o ? !0 : void 0,
51
+ className: s(t.common.root, t.sizes[a].root, i),
52
+ children: [
53
+ d(o) && /* @__PURE__ */ n(o, { className: s(t.common.icon, t.sizes[a].icon) }),
54
+ l(o) && o,
55
+ r,
56
+ d(e) && /* @__PURE__ */ n(e, { className: s(t.common.icon, t.sizes[a].icon) }),
57
+ l(e) && e
58
+ ]
59
+ }
60
+ );
61
+ }, C = ({ children: o, size: e = "md", className: r, ...i }) => /* @__PURE__ */ n(c.Provider, { value: { size: e }, children: /* @__PURE__ */ n(
62
+ g,
63
+ {
64
+ selectionMode: "single",
65
+ className: s("relative z-0 inline-flex w-max -space-x-px rounded-lg shadow-xs", r),
66
+ ...i,
67
+ children: o
68
+ }
69
+ ) });
70
+ export {
71
+ C as ButtonGroup,
72
+ B as ButtonGroupItem
73
+ };
@@ -0,0 +1,2 @@
1
+ export { ButtonGroup, ButtonGroupItem, type ButtonGroupProps, type ButtonGroupItemProps } from './button-group';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/button-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -113,7 +113,7 @@ const H = ({
113
113
  root: "gap-2",
114
114
  textWrapper: c,
115
115
  label: e("text-xs font-medium", o),
116
- hint: "text-[11px]"
116
+ hint: "text-2xs"
117
117
  },
118
118
  md: {
119
119
  root: "gap-3",
@@ -1,8 +1,8 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { cx as m } from "../../utils/cn.js";
3
- import { Text as s } from "react-aria-components";
2
+ import { cx as s } from "../../utils/cn.js";
3
+ import { Text as m } from "react-aria-components";
4
4
  const i = {
5
- sm: "text-[11px]",
5
+ sm: "text-2xs",
6
6
  md: "text-xs",
7
7
  lg: "text-xs"
8
8
  }, p = ({
@@ -11,11 +11,11 @@ const i = {
11
11
  className: e,
12
12
  ...x
13
13
  }) => /* @__PURE__ */ o(
14
- s,
14
+ m,
15
15
  {
16
16
  ...x,
17
17
  slot: t ? "errorMessage" : "description",
18
- className: m(
18
+ className: s(
19
19
  "text-tertiary",
20
20
  i[r],
21
21
  // Invalid state
@@ -1,4 +1,5 @@
1
1
  export { Input, InputBase, TextField, type InputProps, type InputBaseProps, type TextFieldProps } from './input';
2
2
  export { Label, type LabelProps } from './label';
3
3
  export { HintText, type HintTextProps } from './hint-text';
4
+ export { InputGroup, InputPrefix, type InputGroupProps, type InputPrefixProps } from './input-group';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { InputBaseProps } from './input';
3
+ export interface InputPrefixProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** The position of the prefix. */
5
+ position?: "leading" | "trailing";
6
+ /** The size of the prefix. */
7
+ size?: "sm" | "md";
8
+ /** Indicates that the prefix is disabled. */
9
+ isDisabled?: boolean;
10
+ }
11
+ export declare const InputPrefix: ({ isDisabled, children, ...props }: InputPrefixProps) => import("react/jsx-runtime").JSX.Element;
12
+ export interface InputGroupProps extends Omit<InputBaseProps, "type" | "icon" | "placeholder" | "tooltip" | "shortcut" | `${string}ClassName`> {
13
+ /** A prefix text that is displayed in the same box as the input.*/
14
+ prefix?: string;
15
+ /** A leading addon that is displayed with visual separation from the input. */
16
+ leadingAddon?: ReactNode;
17
+ /** A trailing addon that is displayed with visual separation from the input. */
18
+ trailingAddon?: ReactNode;
19
+ /** The class name to apply to the input group. */
20
+ className?: string;
21
+ /** The children of the input group (i.e `<InputBase />`) */
22
+ children: ReactNode;
23
+ /** The class name to apply to the input. */
24
+ inputClassName?: string;
25
+ }
26
+ export declare const InputGroup: {
27
+ ({ size, isReadOnly, prefix, leadingAddon, trailingAddon, label, hint, children, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
28
+ Prefix: ({ isDisabled, children, ...props }: InputPrefixProps) => import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
30
+ };
31
+ //# sourceMappingURL=input-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/primitives/input/input-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5D,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,SAAS,CAAC;AAGzD,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,kCAAkC;IAClC,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAClC,8BAA8B;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,GAAI,oCAAoC,gBAAgB,4CAmB/E,CAAC;AAGF,MAAM,WAAW,eAAgB,SAAQ,IAAI,CACzC,cAAc,EACd,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,GAAG,MAAM,WAAW,CAClF;IACG,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gFAAgF;IAChF,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU;iGAUpB,eAAe;iDAlD8C,gBAAgB;;CAmJ/E,CAAC"}
@@ -0,0 +1,116 @@
1
+ import { jsx as a, jsxs as x, Fragment as y } from "react/jsx-runtime";
2
+ import { sortCx as T, cx as e } from "../../utils/cn.js";
3
+ import { HintText as C } from "./hint-text.js";
4
+ import { TextField as v } from "./input.js";
5
+ import { Label as z } from "./label.js";
6
+ const _ = ({ isDisabled: t, children: s, ...r }) => /* @__PURE__ */ a(
7
+ "span",
8
+ {
9
+ ...r,
10
+ className: e(
11
+ "flex text-md text-tertiary",
12
+ // Styles when the prefix is within an `InputGroup`
13
+ "in-data-input-wrapper:in-data-leading:-mr-px in-data-input-wrapper:in-data-leading:rounded-l-lg",
14
+ "in-data-input-wrapper:in-data-trailing:-ml-px in-data-input-wrapper:in-data-trailing:rounded-r-lg",
15
+ // Size styles based on size when within an `InputGroup`
16
+ "in-data-input-wrapper:in-data-[input-size=md]:py-2.5 in-data-input-wrapper:in-data-[input-size=md]:pr-3 in-data-input-wrapper:in-data-[input-size=md]:pl-3.5 in-data-input-wrapper:in-data-[input-size=sm]:px-3 in-data-input-wrapper:in-data-[input-size=sm]:py-2",
17
+ // Disabled styles
18
+ t && "border-disabled bg-disabled_subtle text-tertiary",
19
+ "in-data-input-wrapper:group-disabled:bg-disabled_subtle in-data-input-wrapper:group-disabled:text-disabled in-data-input-wrapper:group-disabled:ring-border-disabled",
20
+ r.className
21
+ ),
22
+ children: s
23
+ }
24
+ ), w = ({
25
+ size: t = "sm",
26
+ isReadOnly: s,
27
+ prefix: r,
28
+ leadingAddon: n,
29
+ trailingAddon: l,
30
+ label: d,
31
+ hint: o,
32
+ children: f,
33
+ ...u
34
+ }) => {
35
+ var g;
36
+ const i = !!n, p = !!l, c = T({
37
+ sm: {
38
+ input: e(
39
+ // Apply padding styles when select element is passed as a child
40
+ i && "group-has-[&>select]:px-2.5 group-has-[&>select]:pl-2.5",
41
+ p && (r ? "group-has-[&>select]:pr-6 group-has-[&>select]:pl-0" : "group-has-[&>select]:pr-6 group-has-[&>select]:pl-3")
42
+ ),
43
+ leadingText: "pl-3"
44
+ },
45
+ md: {
46
+ input: e(
47
+ // Apply padding styles when select element is passed as a child
48
+ i && "group-has-[&>select]:px-3 group-has-[&>select]:pl-3",
49
+ p && (r ? "group-has-[&>select]:pr-6 group-has-[&>select]:pl-0" : "group-has-[&>select]:pr-6 group-has-[&>select]:pl-3")
50
+ ),
51
+ leadingText: "pl-3.5"
52
+ }
53
+ });
54
+ return /* @__PURE__ */ a(
55
+ v,
56
+ {
57
+ size: t,
58
+ isReadOnly: s,
59
+ "aria-label": d || void 0,
60
+ inputClassName: e((g = c[t]) == null ? void 0 : g.input),
61
+ tooltipClassName: e(p && !i && "group-has-[&>select]:right-0"),
62
+ wrapperClassName: e(
63
+ "z-10",
64
+ // Apply styles based on the presence of leading or trailing elements
65
+ i && "rounded-l-none",
66
+ p && "rounded-r-none",
67
+ // When select element is passed as a child
68
+ "group-has-[&>select]:bg-transparent group-has-[&>select]:shadow-none group-has-[&>select]:ring-0 group-has-[&>select]:focus-within:ring-0",
69
+ // In `Input` component, there is "group-disabled" class so here we need to use "group-disabled:group-has-[&>select]" to avoid conflict
70
+ "group-disabled:group-has-[&>select]:bg-transparent",
71
+ u.inputClassName
72
+ ),
73
+ ...u,
74
+ children: ({ isDisabled: h, isInvalid: m, isRequired: N }) => {
75
+ var b;
76
+ return /* @__PURE__ */ x(y, { children: [
77
+ d && /* @__PURE__ */ a(z, { isRequired: N, className: "text-xs", children: d }),
78
+ /* @__PURE__ */ x(
79
+ "div",
80
+ {
81
+ "data-input-size": t,
82
+ className: e(
83
+ "group relative flex h-max w-full flex-row justify-center rounded-lg bg-primary border border-secondary transition-all duration-100 ease-linear",
84
+ // Only apply focus ring when child is select and input is focused (not read-only)
85
+ "has-[&>select]:shadow-xs has-[&>select]:ring-1 has-[&>select]:ring-border-primary has-[&>select]:ring-inset",
86
+ !s && "has-[&>select]:has-[input:focus]:ring-2 has-[&>select]:has-[input:focus]:ring-border-brand",
87
+ s && "cursor-default has-[&>select]:has-[input:focus]:ring-1 has-[&>select]:has-[input:focus]:ring-border-primary",
88
+ h && "cursor-not-allowed has-[&>select]:bg-disabled_subtle has-[&>select]:ring-border-disabled",
89
+ m && !s && "has-[&>select]:ring-border-error_subtle has-[&>select]:has-[input:focus]:ring-border-error"
90
+ ),
91
+ children: [
92
+ n && /* @__PURE__ */ a("section", { "data-leading": i || void 0, children: n }),
93
+ r && /* @__PURE__ */ a(
94
+ "span",
95
+ {
96
+ className: e("my-auto grow pr-2", (b = c[t]) == null ? void 0 : b.leadingText),
97
+ children: /* @__PURE__ */ a("p", { className: e("text-md text-tertiary", h && "text-disabled"), children: r })
98
+ }
99
+ ),
100
+ f,
101
+ l && /* @__PURE__ */ a("section", { "data-trailing": p || void 0, children: l })
102
+ ]
103
+ }
104
+ ),
105
+ o && /* @__PURE__ */ a(C, { isInvalid: m, children: o })
106
+ ] });
107
+ }
108
+ }
109
+ );
110
+ };
111
+ w.Prefix = _;
112
+ w.displayName = "InputGroup";
113
+ export {
114
+ w as InputGroup,
115
+ _ as InputPrefix
116
+ };
@@ -0,0 +1,2 @@
1
+ export { ProgressBar, ProgressBarBase, type ProgressBarProps, type ProgressIndicatorWithTextProps } from './progress-bar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/progress-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,8BAA8B,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,52 @@
1
+ export interface ProgressBarProps {
2
+ /**
3
+ * The current value of the progress bar.
4
+ */
5
+ value: number;
6
+ /**
7
+ * The minimum value of the progress bar.
8
+ * @default 0
9
+ */
10
+ min?: number;
11
+ /**
12
+ * The maximum value of the progress bar.
13
+ * @default 100
14
+ */
15
+ max?: number;
16
+ /**
17
+ * Optional additional CSS class names for the progress bar container.
18
+ */
19
+ className?: string;
20
+ /**
21
+ * Optional additional CSS class names for the progress bar indicator element.
22
+ */
23
+ progressClassName?: string;
24
+ /**
25
+ * Optional function to format the displayed value.
26
+ * It receives the raw value and the calculated percentage.
27
+ */
28
+ valueFormatter?: (value: number, valueInPercentage: number) => string | number;
29
+ /** Accessible name for the progress bar. */
30
+ "aria-label"?: string;
31
+ }
32
+ /**
33
+ * A basic progress bar component.
34
+ */
35
+ export declare const ProgressBarBase: ({ value, min, max, className, progressClassName, "aria-label": ariaLabel, }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
36
+ type ProgressBarLabelPosition = "right" | "bottom" | "top-floating" | "bottom-floating";
37
+ export interface ProgressIndicatorWithTextProps extends ProgressBarProps {
38
+ /**
39
+ * Specifies the layout of the text relative to the progress bar.
40
+ * - `right`: Text is displayed to the right of the progress bar.
41
+ * - `bottom`: Text is displayed below the progress bar, aligned to the right.
42
+ * - `top-floating`: Text is displayed in a floating tooltip above the progress indicator.
43
+ * - `bottom-floating`: Text is displayed in a floating tooltip below the progress indicator.
44
+ */
45
+ labelPosition?: ProgressBarLabelPosition;
46
+ }
47
+ /**
48
+ * A progress bar component that displays the value text in various configurable layouts.
49
+ */
50
+ export declare const ProgressBar: ({ value, min, max, valueFormatter, labelPosition, className, progressClassName, "aria-label": ariaLabel, }: ProgressIndicatorWithTextProps) => import("react/jsx-runtime").JSX.Element;
51
+ export {};
52
+ //# sourceMappingURL=progress-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../../../src/primitives/progress-bar/progress-bar.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;IAC/E,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,6EAO7B,gBAAgB,4CAsBlB,CAAC;AAEF,KAAK,wBAAwB,GAAG,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAExF,MAAM,WAAW,8BAA+B,SAAQ,gBAAgB;IACpE;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC5C;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,4GASzB,8BAA8B,4CA0DhC,CAAC"}