@stokelp/ui 1.12.1 → 1.13.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
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as l, Fragment as ne } from "react/jsx-runtime";
3
- import { Accordion as B, Checkbox as T, Dialog as S, ark as I, Portal as J, Switch as P, Tabs as R, Select as v, DatePicker as s, RadioGroup as b, switchAnatomy as le, dialogAnatomy as se, accordionAnatomy as de, checkboxAnatomy as ce, tabsAnatomy as pe, selectAnatomy as ue, datePickerAnatomy as me, radioGroupAnatomy as K } from "@ark-ui/react";
3
+ import { Accordion as B, Checkbox as T, Dialog as S, ark as I, Portal as $, Switch as P, Tabs as R, Select as v, DatePicker as s, RadioGroup as b, switchAnatomy as le, dialogAnatomy as se, accordionAnatomy as de, checkboxAnatomy as ce, tabsAnatomy as pe, selectAnatomy as ue, datePickerAnatomy as me, radioGroupAnatomy as K } from "@ark-ui/react";
4
4
  import { styled as t, splitCssProps as D, Circle as he } from "@stokelp/styled-system/jsx";
5
- import { accordion as ge, button as be, checkbox as Z, drawer as ve, formControl as xe, formLabel as j, formHelperText as ye, heading as fe, switchRecipe as X, text as we, textarea as Ce, tabs as ke, select as Se, input as _e, inputAddon as Te, inputGroup as Ie, datepicker as Re, tag as O, radioButtonGroup as ze, radioGroup as Pe } from "@stokelp/styled-system/recipes";
6
- import { createContext as Fe, forwardRef as y, useContext as Be, createElement as Le, useMemo as $ } from "react";
5
+ import { accordion as ge, button as be, checkbox as X, drawer as ve, formControl as xe, formLabel as j, formHelperText as ye, heading as fe, switchRecipe as O, text as we, textarea as Ce, tabs as ke, select as Se, input as _e, inputAddon as Te, inputGroup as Ie, datepicker as Re, tag as U, radioButtonGroup as ze, radioGroup as Pe } from "@stokelp/styled-system/recipes";
6
+ import { createContext as Fe, forwardRef as y, useContext as Be, createElement as Le, useMemo as Y } from "react";
7
7
  import { cx as F, css as A } from "@stokelp/styled-system/css";
8
8
  import { defineKeyframes as De, defineRecipe as C, defineSlotRecipe as x, defineSemanticTokens as Ae, defineTextStyles as Ne, defineTokens as u, defineUtility as We, definePreset as He } from "@pandacss/dev";
9
- const U = (...r) => r.filter(Boolean).join(" "), _ = (r, o) => {
9
+ const q = (...r) => r.filter(Boolean).join(" "), _ = (r, o) => {
10
10
  const a = Fe(null);
11
11
  return {
12
12
  withContext: (c, n, m) => n ? y((d, V) => {
@@ -15,7 +15,7 @@ const U = (...r) => r.filter(Boolean).join(" "), _ = (r, o) => {
15
15
  ...!1,
16
16
  ...d,
17
17
  ...m == null ? void 0 : m.defaultProps,
18
- className: U(z == null ? void 0 : z[n ?? ""], d.className),
18
+ className: q(z == null ? void 0 : z[n ?? ""], d.className),
19
19
  ref: V
20
20
  });
21
21
  }) : c,
@@ -23,14 +23,14 @@ const U = (...r) => r.filter(Boolean).join(" "), _ = (r, o) => {
23
23
  const [z, M] = r.splitVariantProps({
24
24
  ...d,
25
25
  ...m == null ? void 0 : m.defaultProps
26
- }), Y = r(z);
27
- return /* @__PURE__ */ e(a.Provider, { value: Y, children: /* @__PURE__ */ e(
26
+ }), Z = r(z);
27
+ return /* @__PURE__ */ e(a.Provider, { value: Z, children: /* @__PURE__ */ e(
28
28
  c,
29
29
  {
30
30
  ref: V,
31
31
  ...!1,
32
32
  ...M,
33
- className: U(Y[n ?? ""], M.className)
33
+ className: q(Z[n ?? ""], M.className)
34
34
  }
35
35
  ) });
36
36
  })
@@ -40,7 +40,7 @@ const U = (...r) => r.filter(Boolean).join(" "), _ = (r, o) => {
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
42
  }), ro = N(t(B.ItemTrigger), "itemTrigger"), G = t("button", be), Ve = y((r, o) => {
43
- const [a, i] = Z.splitVariantProps(r), [h, c] = D(i), { children: n, className: m, ...w } = c, d = Z(a);
43
+ const [a, i] = X.splitVariantProps(r), [h, c] = D(i), { children: n, className: m, ...w } = c, d = X(a);
44
44
  return /* @__PURE__ */ l(T.Root, { ref: o, className: F(d.root, A(h), m), ...w, children: [
45
45
  /* @__PURE__ */ l(T.Control, { className: d.control, children: [
46
46
  /* @__PURE__ */ e(T.Indicator, { children: /* @__PURE__ */ e(Me, {}) }),
@@ -82,7 +82,7 @@ const Me = () => /* @__PURE__ */ l("svg", { viewBox: "0 0 12 13", fill: "none",
82
82
  );
83
83
  ee.displayName = "DrawerHeader";
84
84
  const no = k(ee, "header"), lo = k(t(S.Title), "title"), so = k(t(S.Trigger), "trigger"), Ye = k(t(S.Positioner), "positioner"), Ze = k(t(S.Backdrop), "backdrop"), te = y(
85
- ({ children: r, ...o }, a) => /* @__PURE__ */ l(J, { children: [
85
+ ({ children: r, ...o }, a) => /* @__PURE__ */ l($, { children: [
86
86
  /* @__PURE__ */ e(Ze, {}),
87
87
  /* @__PURE__ */ e(Ye, { children: /* @__PURE__ */ e(S.Content, { ref: a, ...o, children: r }) })
88
88
  ] })
@@ -107,10 +107,10 @@ const co = k(t(te), "content"), Xe = t("div", xe, {
107
107
  }, mo = t("p", ye, {
108
108
  dataAttr: !0
109
109
  }), ho = (r) => {
110
- const { as: o = "h2", ...a } = r, i = $(() => t(o, fe), [o]);
110
+ const { as: o = "h2", ...a } = r, i = Y(() => t(o, fe), [o]);
111
111
  return /* @__PURE__ */ e(i, { size: o, ...a });
112
112
  }, Ue = y((r, o) => {
113
- const [a, i] = X.splitVariantProps(r), [h, c] = D(i), { children: n, className: m, ...w } = c, d = X(a);
113
+ const [a, i] = O.splitVariantProps(r), [h, c] = D(i), { children: n, className: m, ...w } = c, d = O(a);
114
114
  return /* @__PURE__ */ l(P.Root, { ref: o, className: F(d.root, A(h), m), ...w, children: [
115
115
  /* @__PURE__ */ e(P.Control, { className: d.control, children: /* @__PURE__ */ e(P.Thumb, { className: d.thumb }) }),
116
116
  n ? /* @__PURE__ */ e(P.Label, { className: d.label, children: n }) : null,
@@ -119,7 +119,7 @@ const co = k(t(te), "content"), Xe = t("div", xe, {
119
119
  });
120
120
  Ue.displayName = "Switch";
121
121
  const qe = (r) => {
122
- const { as: o = "p", ...a } = r, i = $(() => t(o, we), [o]);
122
+ const { as: o = "p", ...a } = r, i = Y(() => t(o, we), [o]);
123
123
  return /* @__PURE__ */ e(i, { ...a });
124
124
  }, go = t(I.textarea, Ce), { withProvider: Qe, withContext: W } = _(ke), bo = Qe(t(R.Root), "root", {
125
125
  defaultProps: {
@@ -170,7 +170,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
170
170
  }
171
171
  ) }) })
172
172
  ] }) }),
173
- /* @__PURE__ */ e(Ke, { when: i, wrapper: (n) => /* @__PURE__ */ e(J, { children: n }), children: /* @__PURE__ */ e(dt, { children: /* @__PURE__ */ e(ot, { children: r.length === 0 ? /* @__PURE__ */ e(qe, { px: "space-8", textAlign: "center", children: a ?? "Aucun résultat" }) : r.map((n) => /* @__PURE__ */ l(nt, { item: n, children: [
173
+ /* @__PURE__ */ e(Ke, { when: i, wrapper: (n) => /* @__PURE__ */ e($, { children: n }), children: /* @__PURE__ */ e(dt, { children: /* @__PURE__ */ e(ot, { children: r.length === 0 ? /* @__PURE__ */ e(qe, { px: "space-8", textAlign: "center", children: a ?? "Aucun résultat" }) : r.map((n) => /* @__PURE__ */ l(nt, { item: n, children: [
174
174
  /* @__PURE__ */ e(st, { truncate: !0, children: n.label }),
175
175
  c.multiple ? /* @__PURE__ */ e(lt, { children: "✓" }) : null
176
176
  ] }, n.value)) }) }) }),
@@ -184,7 +184,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
184
184
  }), ht = t("div", Ie, {
185
185
  dataAttr: !0
186
186
  }), wo = (r) => {
187
- const { as: o = "div", ...a } = r, i = $(() => t(o), [o]);
187
+ const { as: o = "div", ...a } = r, i = Y(() => t(o), [o]);
188
188
  return /* @__PURE__ */ e(i, { ...a });
189
189
  }, { withProvider: gt, withContext: p } = _(Re), bt = gt(s.Root, "root", {
190
190
  defaultProps: {
@@ -197,7 +197,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
197
197
  lazyMount: !0,
198
198
  startOfWeek: 6
199
199
  }
200
- }), vt = p(s.Content, "content"), xt = p(s.Control, "control"), yt = p(s.Input, "input"), ft = p(s.MonthSelect, "monthSelect"), wt = p(s.NextTrigger, "nextTrigger"), Ct = p(s.Positioner, "positioner"), kt = p(s.PrevTrigger, "prevTrigger"), St = p(s.TableBody, "tableBody"), _t = p(s.TableCell, "tableCell"), Tt = p(s.TableCellTrigger, "tableCellTrigger"), It = p(s.TableHead, "tableHead"), Rt = p(s.TableHeader, "tableHeader"), zt = p(s.Table, "table"), q = p(s.TableRow, "tableRow"), Pt = p(s.Trigger, "trigger"), Ft = p(s.ViewControl, "viewControl"), Bt = p(s.View, "view"), Lt = p(s.YearSelect, "yearSelect"), Dt = () => /* @__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
+ }), vt = p(s.Content, "content"), xt = p(s.Control, "control"), yt = p(s.Input, "input"), ft = p(s.MonthSelect, "monthSelect"), wt = p(s.NextTrigger, "nextTrigger"), Ct = p(s.Positioner, "positioner"), kt = p(s.PrevTrigger, "prevTrigger"), St = p(s.TableBody, "tableBody"), _t = p(s.TableCell, "tableCell"), Tt = p(s.TableCellTrigger, "tableCellTrigger"), It = p(s.TableHead, "tableHead"), Rt = p(s.TableHeader, "tableHeader"), zt = p(s.Table, "table"), Q = p(s.TableRow, "tableRow"), Pt = p(s.Trigger, "trigger"), Ft = p(s.ViewControl, "viewControl"), Bt = p(s.View, "view"), Lt = p(s.YearSelect, "yearSelect"), Dt = () => /* @__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",
@@ -208,7 +208,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
208
208
  /* @__PURE__ */ e(yt, { asChild: !0, index: 0, placeholder: r, children: /* @__PURE__ */ e(ut, {}) }),
209
209
  /* @__PURE__ */ e(mt, { children: /* @__PURE__ */ e(Pt, { children: /* @__PURE__ */ e(Dt, {}) }) })
210
210
  ] }) }),
211
- /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e(Bt, { view: "day", children: /* @__PURE__ */ e(s.Context, { children: (a) => /* @__PURE__ */ l(ne, { children: [
211
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ e(Bt, { view: "day", children: /* @__PURE__ */ e(s.Context, { children: (a) => /* @__PURE__ */ l(ne, { children: [
212
212
  /* @__PURE__ */ l(Ft, { children: [
213
213
  /* @__PURE__ */ e(kt, { asChild: !0, children: /* @__PURE__ */ e(G, { p: "space-8", variant: "secondary", size: "sm", children: /* @__PURE__ */ e(At, {}) }) }),
214
214
  /* @__PURE__ */ e(ft, {}),
@@ -216,12 +216,12 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
216
216
  /* @__PURE__ */ e(wt, { asChild: !0, children: /* @__PURE__ */ e(G, { p: "space-8", variant: "secondary", size: "sm", children: /* @__PURE__ */ e(Nt, {}) }) })
217
217
  ] }),
218
218
  /* @__PURE__ */ l(zt, { children: [
219
- /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(q, { children: a.weekDays.map((i, h) => /* @__PURE__ */ e(Rt, { children: i.short }, h)) }) }),
220
- /* @__PURE__ */ e(St, { children: a.weeks.map((i, h) => /* @__PURE__ */ e(q, { children: i.map((c, n) => /* @__PURE__ */ e(_t, { value: c, children: /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e("button", { children: c.day }) }) }, n)) }, h)) })
219
+ /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(Q, { children: a.weekDays.map((i, h) => /* @__PURE__ */ e(Rt, { children: i.short }, h)) }) }),
220
+ /* @__PURE__ */ e(St, { children: a.weeks.map((i, h) => /* @__PURE__ */ e(Q, { children: i.map((c, n) => /* @__PURE__ */ e(_t, { value: c, children: /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e("button", { children: c.day }) }) }, n)) }, h)) })
221
221
  ] })
222
- ] }) }) }) }) })
222
+ ] }) }) }) }) }) })
223
223
  ] }), ko = y((r, o) => {
224
- const [a, i] = O.splitVariantProps(r), [h, c] = D(i), { children: n, className: m, ...w } = c, d = O(a);
224
+ const [a, i] = U.splitVariantProps(r), [h, c] = D(i), { children: n, className: m, ...w } = c, d = U(a);
225
225
  return /* @__PURE__ */ l(I.div, { ref: o, className: F(d.root, A(h), m), ...w, children: [
226
226
  n,
227
227
  /* @__PURE__ */ e(he, { className: F(d.badge) })
@@ -1514,7 +1514,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
1514
1514
  className: "input-group",
1515
1515
  description: "The styles for the InputGroup component",
1516
1516
  jsx: ["InputGroup"]
1517
- }), Q = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMC45NCAwLjUyOTk5OUw0IDMuNTgzMzNMNy4wNiAwLjUyOTk5OUw4IDEuNDdMNCA1LjQ3TDAgMS40N0wwLjk0IDAuNTI5OTk5WiIgZmlsbD0iIzFFM0E3NiIvPgo8L3N2Zz4K", pr = x({
1517
+ }), J = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI2IiB2aWV3Qm94PSIwIDAgOCA2IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMC45NCAwLjUyOTk5OUw0IDMuNTgzMzNMNy4wNiAwLjUyOTk5OUw4IDEuNDdMNCA1LjQ3TDAgMS40N0wwLjk0IDAuNTI5OTk5WiIgZmlsbD0iIzFFM0E3NiIvPgo8L3N2Zz4K", pr = x({
1518
1518
  className: "datepicker",
1519
1519
  slots: me.keys(),
1520
1520
  jsx: ["DatePicker"],
@@ -1557,7 +1557,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
1557
1557
  px: "space-4",
1558
1558
  appearance: "none",
1559
1559
  paddingRight: "30px",
1560
- background: `url('${Q}') no-repeat right 10px center`
1560
+ background: `url('${J}') no-repeat right 10px center`
1561
1561
  },
1562
1562
  yearSelect: {
1563
1563
  textTransform: "capitalize",
@@ -1569,7 +1569,7 @@ const yo = W(t(re), "list"), Ke = ({ children: r, when: o, wrapper: a }) => o ==
1569
1569
  px: "space-4",
1570
1570
  appearance: "none",
1571
1571
  paddingRight: "30px",
1572
- background: `url('${Q}') no-repeat right 10px center`
1572
+ background: `url('${J}') no-repeat right 10px center`
1573
1573
  },
1574
1574
  prevTrigger: {
1575
1575
  cursor: "pointer",