@stokelp/ui 1.11.0 → 1.11.1

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.
package/dist/ui.js CHANGED
@@ -2,56 +2,56 @@
2
2
  import { jsx as e, jsxs as d, Fragment as ae } from "react/jsx-runtime";
3
3
  import { Accordion as B, Checkbox as S, Dialog as k, ark as T, Portal as Q, Switch as P, Tabs as I, Select as b, DatePicker as l, RadioGroup as _, switchAnatomy as ie, dialogAnatomy as ne, accordionAnatomy as le, checkboxAnatomy as se, tabsAnatomy as de, selectAnatomy as ce, datePickerAnatomy as pe, radioGroupAnatomy as ue } from "@ark-ui/react";
4
4
  import { styled as r, splitCssProps as L, Circle as me } from "@stokelp/styled-system/jsx";
5
- import { accordion as ge, button as he, checkbox as Y, drawer as be, formControl as ve, formLabel as W, formHelperText as xe, heading as ye, switchRecipe as Z, text as fe, textarea as we, tabs as Ce, select as ke, input as Se, inputAddon as _e, inputGroup as Te, datepicker as Ie, tag as X, radioButtonGroup as ze } from "@stokelp/styled-system/recipes";
6
- import { createContext as Re, forwardRef as f, useContext as Pe, createElement as Fe, useMemo as $ } from "react";
5
+ import { accordion as ge, button as he, checkbox as Y, drawer as be, formControl as ve, formLabel as V, formHelperText as xe, heading as ye, switchRecipe as Z, text as fe, textarea as we, tabs as Ce, select as ke, input as Se, inputAddon as _e, inputGroup as Te, datepicker as Ie, tag as X, radioButtonGroup as Re } from "@stokelp/styled-system/recipes";
6
+ import { createContext as ze, forwardRef as f, useContext as Pe, createElement as Fe, useMemo as $ } from "react";
7
7
  import { cx as F, css as A } from "@stokelp/styled-system/css";
8
8
  import { defineKeyframes as Be, defineRecipe as w, defineSlotRecipe as v, defineSemanticTokens as De, defineTextStyles as Le, defineTokens as u, defineUtility as Ae, definePreset as Ne } from "@pandacss/dev";
9
- const O = (...t) => t.filter(Boolean).join(" "), z = (t, o) => {
10
- const a = Re(null);
9
+ const O = (...t) => t.filter(Boolean).join(" "), R = (t, o) => {
10
+ const a = ze(null);
11
11
  return {
12
- withContext: (c, n, m) => n ? f((s, M) => {
13
- const R = Pe(a);
12
+ withContext: (c, n, m) => n ? f((s, E) => {
13
+ const z = Pe(a);
14
14
  return Fe(c, {
15
15
  ...!1,
16
16
  ...s,
17
17
  ...m == null ? void 0 : m.defaultProps,
18
- className: O(R == null ? void 0 : R[n ?? ""], s.className),
19
- ref: M
18
+ className: O(z == null ? void 0 : z[n ?? ""], s.className),
19
+ ref: E
20
20
  });
21
21
  }) : c,
22
- withProvider: (c, n, m) => f((s, M) => {
23
- const [R, V] = t.splitVariantProps({
22
+ withProvider: (c, n, m) => f((s, E) => {
23
+ const [z, M] = t.splitVariantProps({
24
24
  ...s,
25
25
  ...m == null ? void 0 : m.defaultProps
26
- }), G = t(R);
26
+ }), G = t(z);
27
27
  return /* @__PURE__ */ e(a.Provider, { value: G, children: /* @__PURE__ */ e(
28
28
  c,
29
29
  {
30
- ref: M,
30
+ ref: E,
31
31
  ...!1,
32
- ...V,
33
- className: O(G[n ?? ""], V.className)
32
+ ...M,
33
+ className: O(G[n ?? ""], M.className)
34
34
  }
35
35
  ) });
36
36
  })
37
37
  };
38
- }, { withProvider: He, withContext: N } = z(ge), Yr = He(r(B.Root), "root"), Zr = N(r(B.Item), "item"), Xr = N(r(B.ItemContent), "itemContent"), Or = N(r(B.ItemIndicator), "itemIndicator", {
38
+ }, { withProvider: We, withContext: N } = R(ge), Yr = We(r(B.Root), "root"), Zr = N(r(B.Item), "item"), Xr = N(r(B.ItemContent), "itemContent"), Or = N(r(B.ItemIndicator), "itemIndicator", {
39
39
  defaultProps: {
40
40
  children: /* @__PURE__ */ e("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M4.94 6.03L8 9.08333L11.06 6.03L12 6.97L8 10.97L4 6.97L4.94 6.03Z", fill: "currentColor" }) })
41
41
  }
42
- }), Ur = N(r(B.ItemTrigger), "itemTrigger"), j = r("button", he), Ee = f((t, o) => {
42
+ }), Ur = N(r(B.ItemTrigger), "itemTrigger"), j = r("button", he), He = f((t, o) => {
43
43
  const [a, i] = Y.splitVariantProps(t), [g, c] = L(i), { children: n, className: m, ...y } = c, s = Y(a);
44
44
  return /* @__PURE__ */ d(S.Root, { ref: o, className: F(s.root, A(g), m), ...y, children: [
45
45
  /* @__PURE__ */ d(S.Control, { className: s.control, children: [
46
- /* @__PURE__ */ e(S.Indicator, { children: /* @__PURE__ */ e(Me, {}) }),
47
- /* @__PURE__ */ e(S.Indicator, { indeterminate: !0, children: /* @__PURE__ */ e(Ve, {}) })
46
+ /* @__PURE__ */ e(S.Indicator, { children: /* @__PURE__ */ e(Ee, {}) }),
47
+ /* @__PURE__ */ e(S.Indicator, { indeterminate: !0, children: /* @__PURE__ */ e(Me, {}) })
48
48
  ] }),
49
49
  n && /* @__PURE__ */ e(S.Label, { className: s.label, children: n }),
50
50
  /* @__PURE__ */ e(S.HiddenInput, {})
51
51
  ] });
52
52
  });
53
- Ee.displayName = "Checkbox";
54
- const Me = () => /* @__PURE__ */ d("svg", { viewBox: "0 0 12 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
53
+ He.displayName = "Checkbox";
54
+ const Ee = () => /* @__PURE__ */ d("svg", { viewBox: "0 0 12 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
55
55
  /* @__PURE__ */ e("title", { children: "Check Icon" }),
56
56
  /* @__PURE__ */ e(
57
57
  "path",
@@ -60,10 +60,10 @@ const Me = () => /* @__PURE__ */ d("svg", { viewBox: "0 0 12 13", fill: "none",
60
60
  fill: "white"
61
61
  }
62
62
  )
63
- ] }), Ve = () => /* @__PURE__ */ d("svg", { width: "12", height: "13", viewBox: "0 0 12 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
63
+ ] }), Me = () => /* @__PURE__ */ d("svg", { width: "12", height: "13", viewBox: "0 0 12 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
64
64
  /* @__PURE__ */ e("title", { children: "Minus Icon" }),
65
65
  /* @__PURE__ */ e("path", { d: "M3 6H9V7H3V6Z", fill: "white" })
66
- ] }), { withProvider: We, withContext: C } = z(be), qr = We(k.Root, void 0, {
66
+ ] }), { withProvider: Ve, withContext: C } = R(be), qr = Ve(k.Root, void 0, {
67
67
  defaultProps: {
68
68
  unmountOnExit: !0,
69
69
  lazyMount: !0
@@ -98,8 +98,8 @@ const ro = C(r(K), "content"), Ye = r("div", ve, {
98
98
  ...o ? { "aria-required": !0 } : {}
99
99
  };
100
100
  return /* @__PURE__ */ e(Ye, { ...i, ...a });
101
- }, Ze = r("label", W), ao = (t) => {
102
- const [o, a] = W.splitVariantProps(t), [i, g] = L(a), { children: c, className: n, addon: m, ...y } = g, s = W(o);
101
+ }, Ze = r("label", V), ao = (t) => {
102
+ const [o, a] = V.splitVariantProps(t), [i, g] = L(a), { children: c, className: n, addon: m, ...y } = g, s = V(o);
103
103
  return /* @__PURE__ */ d(Ze, { className: F(s.root, A(i), n), ...y, children: [
104
104
  c,
105
105
  m ? /* @__PURE__ */ e(r.span, { className: s.addon, children: m }) : null
@@ -121,18 +121,18 @@ Xe.displayName = "Switch";
121
121
  const Oe = (t) => {
122
122
  const { as: o = "p", ...a } = t, i = $(() => r(o, fe), [o]);
123
123
  return /* @__PURE__ */ e(i, { ...a });
124
- }, lo = r(T.textarea, we), { withProvider: Ue, withContext: H } = z(Ce), so = Ue(r(I.Root), "root", {
124
+ }, lo = r(T.textarea, we), { withProvider: Ue, withContext: W } = R(Ce), so = Ue(r(I.Root), "root", {
125
125
  defaultProps: {
126
126
  lazyMount: !0
127
127
  }
128
- }), co = H(r(I.Content), "content"), po = H(r(I.Trigger), "trigger"), qe = H(r(I.Indicator), "indicator"), ee = f(
128
+ }), co = W(r(I.Content), "content"), po = W(r(I.Trigger), "trigger"), qe = W(r(I.Indicator), "indicator"), ee = f(
129
129
  ({ children: t, ...o }, a) => /* @__PURE__ */ d(I.List, { ref: a, ...o, children: [
130
130
  t,
131
131
  /* @__PURE__ */ e(qe, {})
132
132
  ] })
133
133
  );
134
134
  ee.displayName = I.List.displayName;
135
- const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o === !0 ? a(t) : t, { withProvider: Je, withContext: x } = z(ke), Ke = Je(r(b.Root), "root", {
135
+ const uo = W(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o === !0 ? a(t) : t, { withProvider: Je, withContext: x } = R(ke), Ke = Je(r(b.Root), "root", {
136
136
  defaultProps: {
137
137
  loopFocus: !0
138
138
  }
@@ -186,7 +186,7 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
186
186
  }), go = (t) => {
187
187
  const { as: o = "div", ...a } = t, i = $(() => r(o), [o]);
188
188
  return /* @__PURE__ */ e(i, { ...a });
189
- }, { withProvider: mt, withContext: p } = z(Ie), gt = mt(l.Root, "root", {
189
+ }, { withProvider: mt, withContext: p } = R(Ie), gt = mt(l.Root, "root", {
190
190
  defaultProps: {
191
191
  positioning: {
192
192
  placement: "bottom-start"
@@ -197,7 +197,7 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
197
197
  lazyMount: !0,
198
198
  startOfWeek: 6
199
199
  }
200
- }), ht = p(l.Content, "content"), bt = p(l.Control, "control"), vt = p(l.Input, "input"), xt = p(l.MonthSelect, "monthSelect"), yt = p(l.NextTrigger, "nextTrigger"), ft = p(l.Positioner, "positioner"), wt = p(l.PrevTrigger, "prevTrigger"), Ct = p(l.TableBody, "tableBody"), kt = p(l.TableCell, "tableCell"), St = p(l.TableCellTrigger, "tableCellTrigger"), _t = p(l.TableHead, "tableHead"), Tt = p(l.TableHeader, "tableHeader"), It = p(l.Table, "table"), U = p(l.TableRow, "tableRow"), zt = p(l.Trigger, "trigger"), Rt = p(l.ViewControl, "viewControl"), Pt = p(l.View, "view"), Ft = p(l.YearSelect, "yearSelect"), Bt = () => /* @__PURE__ */ e("svg", { width: "23", height: "24", viewBox: "0 0 23 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
200
+ }), ht = p(l.Content, "content"), bt = p(l.Control, "control"), vt = p(l.Input, "input"), xt = p(l.MonthSelect, "monthSelect"), yt = p(l.NextTrigger, "nextTrigger"), ft = p(l.Positioner, "positioner"), wt = p(l.PrevTrigger, "prevTrigger"), Ct = p(l.TableBody, "tableBody"), kt = p(l.TableCell, "tableCell"), St = p(l.TableCellTrigger, "tableCellTrigger"), _t = p(l.TableHead, "tableHead"), Tt = p(l.TableHeader, "tableHeader"), It = p(l.Table, "table"), U = p(l.TableRow, "tableRow"), Rt = p(l.Trigger, "trigger"), zt = p(l.ViewControl, "viewControl"), Pt = p(l.View, "view"), Ft = p(l.YearSelect, "yearSelect"), Bt = () => /* @__PURE__ */ e("svg", { width: "23", height: "24", viewBox: "0 0 23 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
201
201
  "path",
202
202
  {
203
203
  d: "M18.2083 4H17.25V2H15.3333V4H7.66667V2H5.75V4H4.79167C3.72792 4 2.88458 4.9 2.88458 6L2.875 20C2.875 21.1 3.72792 22 4.79167 22H18.2083C19.2625 22 20.125 21.1 20.125 20V6C20.125 4.9 19.2625 4 18.2083 4ZM18.2083 20H4.79167V10H18.2083V20ZM18.2083 8H4.79167V6H18.2083V8ZM8.625 14H6.70833V12H8.625V14ZM12.4583 14H10.5417V12H12.4583V14ZM16.2917 14H14.375V12H16.2917V14ZM8.625 18H6.70833V16H8.625V18ZM12.4583 18H10.5417V16H12.4583V18ZM16.2917 18H14.375V16H16.2917V18Z",
@@ -206,10 +206,10 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
206
206
  ) }), Dt = () => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M10.4698 4.94L9.52979 4L5.52979 8L9.52979 12L10.4698 11.06L7.41645 8L10.4698 4.94Z", fill: "currentColor" }) }), Lt = () => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M6.46979 4L5.52979 4.94L8.58312 8L5.52979 11.06L6.46979 12L10.4698 8L6.46979 4Z", fill: "currentColor" }) }), ho = ({ placeholder: t, ...o }) => /* @__PURE__ */ d(gt, { ...o, children: [
207
207
  /* @__PURE__ */ e(bt, { asChild: !0, children: /* @__PURE__ */ d(ut, { children: [
208
208
  /* @__PURE__ */ e(vt, { asChild: !0, index: 0, placeholder: t, children: /* @__PURE__ */ e(ct, {}) }),
209
- /* @__PURE__ */ e(pt, { children: /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(Bt, {}) }) })
209
+ /* @__PURE__ */ e(pt, { children: /* @__PURE__ */ e(Rt, { children: /* @__PURE__ */ e(Bt, {}) }) })
210
210
  ] }) }),
211
211
  /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(ht, { children: /* @__PURE__ */ e(Pt, { view: "day", children: /* @__PURE__ */ e(l.Context, { children: (a) => /* @__PURE__ */ d(ae, { children: [
212
- /* @__PURE__ */ d(Rt, { children: [
212
+ /* @__PURE__ */ d(zt, { children: [
213
213
  /* @__PURE__ */ e(wt, { asChild: !0, children: /* @__PURE__ */ e(j, { p: "space-8", variant: "secondary", size: "sm", children: /* @__PURE__ */ e(Dt, {}) }) }),
214
214
  /* @__PURE__ */ e(xt, {}),
215
215
  /* @__PURE__ */ e(Ft, {}),
@@ -226,18 +226,22 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
226
226
  n,
227
227
  /* @__PURE__ */ e(me, { className: F(s.badge) })
228
228
  ] });
229
- }), { withProvider: At, withContext: E } = z(ze), Nt = E(r(_.ItemControl), "itemControl"), Ht = E(r(_.ItemText), "itemText"), Et = f(
229
+ }), { withProvider: At, withContext: H } = R(Re), Nt = H(r(_.ItemControl), "itemControl"), Wt = H(r(_.ItemText), "itemText"), Ht = f(
230
230
  ({ children: t, ...o }, a) => /* @__PURE__ */ d(_.Item, { ref: a, ...o, children: [
231
- /* @__PURE__ */ e(Ht, { children: t }),
231
+ /* @__PURE__ */ e(Wt, { children: t }),
232
232
  /* @__PURE__ */ e(Nt, {}),
233
233
  /* @__PURE__ */ e(_.ItemHiddenInput, {})
234
234
  ] })
235
- ), vo = At(r(_.Root), "root"), xo = E(r(Et), "item"), yo = E(r(_.Label), "label"), Mt = {
235
+ ), vo = At(r(_.Root), "root", {
236
+ defaultProps: {
237
+ orientation: "horizontal"
238
+ }
239
+ }), xo = H(r(Ht), "item"), yo = H(r(_.Label), "label"), Et = {
236
240
  xl: "1536px",
237
241
  lg: "1200px",
238
242
  md: "900px",
239
243
  sm: "600px"
240
- }, Vt = {
244
+ }, Mt = {
241
245
  extend: {
242
246
  checked: "&:where(:checked, [data-checked], [aria-checked=true], [data-state=checked])",
243
247
  closed: "&:where([data-state=closed])",
@@ -255,7 +259,7 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
255
259
  today: "&:where([data-today])",
256
260
  underValue: '&:where([data-state="under-value"])'
257
261
  }
258
- }, Wt = {
262
+ }, Vt = {
259
263
  "2xl": "672px",
260
264
  "3xl": "768px",
261
265
  "4xl": "896px",
@@ -1767,17 +1771,14 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
1767
1771
  base: {
1768
1772
  root: {
1769
1773
  display: "inline-flex",
1770
- borderRadius: "radius-8",
1771
- overflow: "hidden",
1772
- border: "1px solid {colors.grey.100}"
1774
+ height: "size-40"
1773
1775
  },
1774
1776
  item: {
1775
1777
  width: "size-64",
1776
- alignItems: "center",
1778
+ minWidth: "size-64",
1777
1779
  appearance: "none",
1778
1780
  cursor: "pointer",
1779
1781
  display: "inline-flex",
1780
- justifyContent: "center",
1781
1782
  outline: "none",
1782
1783
  transitionDuration: "normal",
1783
1784
  transitionProperty: "background, border-color, color, box-shadow",
@@ -1787,9 +1788,21 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
1787
1788
  px: "14px",
1788
1789
  py: "space-10",
1789
1790
  whiteSpace: "nowrap",
1790
- borderRight: {
1791
- base: "1px solid {colors.grey.100}",
1792
- _lastOfType: "none"
1791
+ borderColor: "grey.100",
1792
+ borderTopWidth: 1,
1793
+ borderBottomWidth: 1,
1794
+ borderRightWidth: 1,
1795
+ borderLeftWidth: 1,
1796
+ "& + &": {
1797
+ borderLeftWidth: 0
1798
+ },
1799
+ _firstOfType: {
1800
+ borderTopLeftRadius: "radius-8",
1801
+ borderBottomLeftRadius: "radius-8"
1802
+ },
1803
+ _lastOfType: {
1804
+ borderTopRightRadius: "radius-8",
1805
+ borderBottomRightRadius: "radius-8"
1793
1806
  },
1794
1807
  background: {
1795
1808
  base: "white",
@@ -1801,11 +1814,13 @@ const uo = H(r(ee), "list"), Qe = ({ children: t, when: o, wrapper: a }) => o ==
1801
1814
  }
1802
1815
  },
1803
1816
  itemText: {
1817
+ flex: 1,
1804
1818
  fontFamily: "satoshi",
1805
1819
  textStyle: "body.md",
1806
1820
  fontWeight: "bold",
1807
1821
  display: "inline-flex",
1808
1822
  alignItems: "center",
1823
+ justifyContent: "center",
1809
1824
  color: {
1810
1825
  base: "primary.500",
1811
1826
  _checked: "white",
@@ -2564,7 +2579,7 @@ function h(t = "") {
2564
2579
  if (o === re)
2565
2580
  return `${parseFloat(t) / Tr}${D}`;
2566
2581
  }
2567
- const zr = u.fontSizes({
2582
+ const Rr = u.fontSizes({
2568
2583
  body: {
2569
2584
  lg: { value: h("16px") },
2570
2585
  md: { value: h("14px") },
@@ -2586,7 +2601,7 @@ const zr = u.fontSizes({
2586
2601
  xs: { value: h("18px") }
2587
2602
  }
2588
2603
  }
2589
- }), Rr = u.fontWeights({
2604
+ }), zr = u.fontWeights({
2590
2605
  black: { value: "900" },
2591
2606
  bold: { value: "700" },
2592
2607
  extrabold: { value: "800" },
@@ -2684,8 +2699,8 @@ const zr = u.fontSizes({
2684
2699
  colors: vr,
2685
2700
  durations: xr,
2686
2701
  easings: yr,
2687
- fontSizes: zr,
2688
- fontWeights: Rr,
2702
+ fontSizes: Rr,
2703
+ fontWeights: zr,
2689
2704
  fonts: Br,
2690
2705
  letterSpacings: Pr,
2691
2706
  lineHeights: Fr,
@@ -2709,8 +2724,8 @@ const zr = u.fontSizes({
2709
2724
  recipes: "*"
2710
2725
  },
2711
2726
  theme: {
2712
- breakpoints: Mt,
2713
- containerSizes: Wt,
2727
+ breakpoints: Et,
2728
+ containerSizes: Vt,
2714
2729
  keyframes: jt,
2715
2730
  recipes: sr,
2716
2731
  semanticTokens: pr,
@@ -2719,7 +2734,7 @@ const zr = u.fontSizes({
2719
2734
  tokens: Lr
2720
2735
  },
2721
2736
  utilities: Nr,
2722
- conditions: Vt
2737
+ conditions: Mt
2723
2738
  });
2724
2739
  export {
2725
2740
  Yr as Accordion,
@@ -2729,7 +2744,7 @@ export {
2729
2744
  Ur as AccordionItemTrigger,
2730
2745
  go as Box,
2731
2746
  j as Button,
2732
- Ee as Checkbox,
2747
+ He as Checkbox,
2733
2748
  ho as DatePicker,
2734
2749
  qr as Drawer,
2735
2750
  Qr as DrawerBody,