@serendie/ui 2.1.3 → 2.2.0

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 (122) hide show
  1. package/dist/client.js +79 -74
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Avatar/Avatar.d.ts +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +2 -2
  7. package/dist/components/Button/Button.js +22 -21
  8. package/dist/components/DatePicker/DatePicker.d.ts +13 -0
  9. package/dist/components/DatePicker/DatePicker.js +203 -0
  10. package/dist/components/DatePicker/index.d.ts +2 -0
  11. package/dist/components/DatePicker/index.js +6 -0
  12. package/dist/components/DatePicker/parseDate.d.ts +1 -0
  13. package/dist/components/DatePicker/styles.d.ts +1 -0
  14. package/dist/components/DatePicker/styles.js +224 -0
  15. package/dist/components/IconButton/IconButton.d.ts +3 -3
  16. package/dist/components/List/ListItem.d.ts +1 -1
  17. package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
  18. package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
  19. package/dist/components/Pagination/Pagination.d.ts +1 -1
  20. package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
  21. package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
  22. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
  23. package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
  24. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
  25. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
  26. package/dist/components/ProgressIndicator/index.d.ts +4 -1
  27. package/dist/components/ProgressIndicator/index.js +3 -2
  28. package/dist/components/ProgressIndicator/util.d.ts +1 -0
  29. package/dist/components/ProgressIndicator/util.js +13 -0
  30. package/dist/components/Search/Search.d.ts +1 -1
  31. package/dist/components/Select/Select.d.ts +1 -1
  32. package/dist/components/Switch/Switch.d.ts +1 -1
  33. package/dist/components/Tabs/Tabs.d.ts +1 -1
  34. package/dist/components/TextField/TextField.js +59 -156
  35. package/dist/components/Toast/Toast.d.ts +1 -1
  36. package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +80 -75
  39. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
  40. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
  41. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
  42. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
  43. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
  44. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
  45. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
  47. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
  48. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
  49. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
  50. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
  51. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
  52. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
  53. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
  54. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
  55. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
  56. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
  57. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
  58. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
  59. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
  60. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
  61. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
  62. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
  63. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
  64. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
  65. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
  66. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
  67. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
  68. package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
  69. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
  70. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
  71. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
  72. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
  73. package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
  74. package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
  75. package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
  76. package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
  77. package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
  78. package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
  79. package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
  80. package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
  81. package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
  82. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
  83. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
  84. package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
  85. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
  86. package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
  87. package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
  88. package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
  89. package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
  90. package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
  91. package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
  92. package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
  93. package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
  94. package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
  98. package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
  99. package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
  100. package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
  101. package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
  102. package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
  103. package/dist/preset.d.ts +11 -1
  104. package/dist/recipes/index.d.ts +3 -2
  105. package/dist/recipes/index.js +5 -2
  106. package/dist/recipes/textFieldRecipe.d.ts +6 -0
  107. package/dist/recipes/textFieldRecipe.js +107 -0
  108. package/dist/styled-system/css/cva.js +43 -38
  109. package/dist/styled-system/recipes/create-recipe.js +37 -0
  110. package/dist/styled-system/recipes/text-field-recipe.js +61 -0
  111. package/dist/styles.css +1 -1
  112. package/dist/tokens/keyframes/index.d.ts +8 -0
  113. package/dist/tokens/keyframes/index.js +6 -2
  114. package/package.json +3 -3
  115. package/styled-system/recipes/create-recipe.js +82 -0
  116. package/styled-system/recipes/index.d.ts +2 -0
  117. package/styled-system/recipes/index.js +1 -0
  118. package/styled-system/recipes/text-field-recipe.d.ts +28 -0
  119. package/styled-system/recipes/text-field-recipe.js +72 -0
  120. package/styled-system/types/prop-type.d.ts +1 -1
  121. package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
  122. package/dist/node_modules/proxy-compare/dist/index.js +0 -7
@@ -1,131 +1,136 @@
1
1
  function c() {
2
2
  return typeof window < "u";
3
3
  }
4
- function s(n) {
5
- return p(n) ? (n.nodeName || "").toLowerCase() : "#document";
4
+ function u(t) {
5
+ return p(t) ? (t.nodeName || "").toLowerCase() : "#document";
6
6
  }
7
- function i(n) {
8
- var t;
9
- return (n == null || (t = n.ownerDocument) == null ? void 0 : t.defaultView) || window;
7
+ function i(t) {
8
+ var e;
9
+ return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
10
10
  }
11
- function E(n) {
12
- var t;
13
- return (t = (p(n) ? n.ownerDocument : n.document) || window.document) == null ? void 0 : t.documentElement;
11
+ function N(t) {
12
+ var e;
13
+ return (e = (p(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
14
14
  }
15
- function p(n) {
16
- return c() ? n instanceof Node || n instanceof i(n).Node : !1;
15
+ function p(t) {
16
+ return c() ? t instanceof Node || t instanceof i(t).Node : !1;
17
17
  }
18
- function m(n) {
19
- return c() ? n instanceof Element || n instanceof i(n).Element : !1;
18
+ function m(t) {
19
+ return c() ? t instanceof Element || t instanceof i(t).Element : !1;
20
20
  }
21
- function w(n) {
22
- return c() ? n instanceof HTMLElement || n instanceof i(n).HTMLElement : !1;
21
+ function w(t) {
22
+ return c() ? t instanceof HTMLElement || t instanceof i(t).HTMLElement : !1;
23
23
  }
24
- function a(n) {
25
- return !c() || typeof ShadowRoot > "u" ? !1 : n instanceof ShadowRoot || n instanceof i(n).ShadowRoot;
24
+ function f(t) {
25
+ return !c() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof i(t).ShadowRoot;
26
26
  }
27
- function y(n) {
27
+ const E = /* @__PURE__ */ new Set(["inline", "contents"]);
28
+ function y(t) {
28
29
  const {
29
- overflow: t,
30
- overflowX: e,
30
+ overflow: e,
31
+ overflowX: n,
31
32
  overflowY: o,
32
33
  display: r
33
- } = b(n);
34
- return /auto|scroll|overlay|hidden|clip/.test(t + o + e) && !["inline", "contents"].includes(r);
34
+ } = S(t);
35
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !E.has(r);
35
36
  }
36
- function D(n) {
37
- return ["table", "td", "th"].includes(s(n));
37
+ const T = /* @__PURE__ */ new Set(["table", "td", "th"]);
38
+ function A(t) {
39
+ return T.has(u(t));
38
40
  }
39
- function N(n) {
40
- return [":popover-open", ":modal"].some((t) => {
41
+ const v = [":popover-open", ":modal"];
42
+ function L(t) {
43
+ return v.some((e) => {
41
44
  try {
42
- return n.matches(t);
45
+ return t.matches(e);
43
46
  } catch {
44
47
  return !1;
45
48
  }
46
49
  });
47
50
  }
48
- function T(n) {
49
- const t = L(), e = m(n) ? b(n) : n;
50
- return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => e[o] ? e[o] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (e.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (e.contain || "").includes(o));
51
- }
52
- function k(n) {
53
- let t = u(n);
54
- for (; w(t) && !g(t); ) {
55
- if (T(t))
56
- return t;
57
- if (N(t))
51
+ const D = ["transform", "translate", "scale", "rotate", "perspective"], C = ["transform", "translate", "scale", "rotate", "perspective", "filter"], k = ["paint", "layout", "strict", "content"];
52
+ function V(t) {
53
+ const e = O(), n = m(t) ? S(t) : t;
54
+ return D.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || C.some((o) => (n.willChange || "").includes(o)) || k.some((o) => (n.contain || "").includes(o));
55
+ }
56
+ function B(t) {
57
+ let e = s(t);
58
+ for (; w(e) && !h(e); ) {
59
+ if (V(e))
60
+ return e;
61
+ if (L(e))
58
62
  return null;
59
- t = u(t);
63
+ e = s(e);
60
64
  }
61
65
  return null;
62
66
  }
63
- function L() {
67
+ function O() {
64
68
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
65
69
  }
66
- function g(n) {
67
- return ["html", "body", "#document"].includes(s(n));
70
+ const R = /* @__PURE__ */ new Set(["html", "body", "#document"]);
71
+ function h(t) {
72
+ return R.has(u(t));
68
73
  }
69
- function b(n) {
70
- return i(n).getComputedStyle(n);
74
+ function S(t) {
75
+ return i(t).getComputedStyle(t);
71
76
  }
72
- function C(n) {
73
- return m(n) ? {
74
- scrollLeft: n.scrollLeft,
75
- scrollTop: n.scrollTop
77
+ function F(t) {
78
+ return m(t) ? {
79
+ scrollLeft: t.scrollLeft,
80
+ scrollTop: t.scrollTop
76
81
  } : {
77
- scrollLeft: n.scrollX,
78
- scrollTop: n.scrollY
82
+ scrollLeft: t.scrollX,
83
+ scrollTop: t.scrollY
79
84
  };
80
85
  }
81
- function u(n) {
82
- if (s(n) === "html")
83
- return n;
84
- const t = (
86
+ function s(t) {
87
+ if (u(t) === "html")
88
+ return t;
89
+ const e = (
85
90
  // Step into the shadow DOM of the parent of a slotted node.
86
- n.assignedSlot || // DOM Element detected.
87
- n.parentNode || // ShadowRoot detected.
88
- a(n) && n.host || // Fallback.
89
- E(n)
91
+ t.assignedSlot || // DOM Element detected.
92
+ t.parentNode || // ShadowRoot detected.
93
+ f(t) && t.host || // Fallback.
94
+ N(t)
90
95
  );
91
- return a(t) ? t.host : t;
96
+ return f(e) ? e.host : e;
92
97
  }
93
- function h(n) {
94
- const t = u(n);
95
- return g(t) ? n.ownerDocument ? n.ownerDocument.body : n.body : w(t) && y(t) ? t : h(t);
98
+ function b(t) {
99
+ const e = s(t);
100
+ return h(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : w(e) && y(e) ? e : b(e);
96
101
  }
97
- function d(n, t, e) {
102
+ function d(t, e, n) {
98
103
  var o;
99
- t === void 0 && (t = []), e === void 0 && (e = !0);
100
- const r = h(n), S = r === ((o = n.ownerDocument) == null ? void 0 : o.body), l = i(r);
101
- if (S) {
102
- const f = v(l);
103
- return t.concat(l, l.visualViewport || [], y(r) ? r : [], f && e ? d(f) : []);
104
+ e === void 0 && (e = []), n === void 0 && (n = !0);
105
+ const r = b(t), g = r === ((o = t.ownerDocument) == null ? void 0 : o.body), l = i(r);
106
+ if (g) {
107
+ const a = _(l);
108
+ return e.concat(l, l.visualViewport || [], y(r) ? r : [], a && n ? d(a) : []);
104
109
  }
105
- return t.concat(r, d(r, [], e));
110
+ return e.concat(r, d(r, [], n));
106
111
  }
107
- function v(n) {
108
- return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null;
112
+ function _(t) {
113
+ return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
109
114
  }
110
115
  export {
111
- b as getComputedStyle,
112
- k as getContainingBlock,
113
- E as getDocumentElement,
114
- v as getFrameElement,
115
- h as getNearestOverflowAncestor,
116
- s as getNodeName,
117
- C as getNodeScroll,
116
+ S as getComputedStyle,
117
+ B as getContainingBlock,
118
+ N as getDocumentElement,
119
+ _ as getFrameElement,
120
+ b as getNearestOverflowAncestor,
121
+ u as getNodeName,
122
+ F as getNodeScroll,
118
123
  d as getOverflowAncestors,
119
- u as getParentNode,
124
+ s as getParentNode,
120
125
  i as getWindow,
121
- T as isContainingBlock,
126
+ V as isContainingBlock,
122
127
  m as isElement,
123
128
  w as isHTMLElement,
124
- g as isLastTraversableNode,
129
+ h as isLastTraversableNode,
125
130
  p as isNode,
126
131
  y as isOverflowElement,
127
- a as isShadowRoot,
128
- D as isTableElement,
129
- N as isTopLayer,
130
- L as isWebKit
132
+ f as isShadowRoot,
133
+ A as isTableElement,
134
+ L as isTopLayer,
135
+ O as isWebKit
131
136
  };
@@ -1,74 +1,75 @@
1
- const P = ["top", "right", "bottom", "left"], l = Math.min, m = Math.max, M = Math.round, O = Math.floor, S = (t) => ({
1
+ const j = ["top", "right", "bottom", "left"], m = Math.min, p = Math.max, C = Math.round, L = Math.floor, E = (t) => ({
2
2
  x: t,
3
3
  y: t
4
- }), p = {
4
+ }), h = {
5
5
  left: "right",
6
6
  right: "left",
7
7
  bottom: "top",
8
8
  top: "bottom"
9
- }, a = {
9
+ }, x = {
10
10
  start: "end",
11
11
  end: "start"
12
12
  };
13
- function w(t, n, e) {
14
- return m(t, l(n, e));
13
+ function R(t, e, n) {
14
+ return p(t, m(e, n));
15
15
  }
16
- function j(t, n) {
17
- return typeof t == "function" ? t(n) : t;
16
+ function T(t, e) {
17
+ return typeof t == "function" ? t(e) : t;
18
18
  }
19
- function u(t) {
19
+ function g(t) {
20
20
  return t.split("-")[0];
21
21
  }
22
- function g(t) {
22
+ function a(t) {
23
23
  return t.split("-")[1];
24
24
  }
25
- function h(t) {
25
+ function b(t) {
26
26
  return t === "x" ? "y" : "x";
27
27
  }
28
- function b(t) {
28
+ function d(t) {
29
29
  return t === "y" ? "height" : "width";
30
30
  }
31
- function x(t) {
32
- return ["top", "bottom"].includes(u(t)) ? "y" : "x";
31
+ const A = /* @__PURE__ */ new Set(["top", "bottom"]);
32
+ function P(t) {
33
+ return A.has(g(t)) ? "y" : "x";
33
34
  }
34
- function d(t) {
35
- return h(x(t));
35
+ function y(t) {
36
+ return b(P(t));
36
37
  }
37
- function C(t, n, e) {
38
- e === void 0 && (e = !1);
39
- const r = g(t), o = d(t), i = b(o);
40
- let c = o === "x" ? r === (e ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
41
- return n.reference[i] > n.floating[i] && (c = f(c)), [c, f(c)];
38
+ function k(t, e, n) {
39
+ n === void 0 && (n = !1);
40
+ const r = a(t), i = y(t), o = d(i);
41
+ let c = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
42
+ return e.reference[o] > e.floating[o] && (c = f(c)), [c, f(c)];
42
43
  }
43
- function L(t) {
44
- const n = f(t);
45
- return [s(t), n, s(n)];
44
+ function q(t) {
45
+ const e = f(t);
46
+ return [s(t), e, s(e)];
46
47
  }
47
48
  function s(t) {
48
- return t.replace(/start|end/g, (n) => a[n]);
49
+ return t.replace(/start|end/g, (e) => x[e]);
49
50
  }
50
- function A(t, n, e) {
51
- const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], c = ["bottom", "top"];
51
+ const u = ["left", "right"], l = ["right", "left"], M = ["top", "bottom"], O = ["bottom", "top"];
52
+ function S(t, e, n) {
52
53
  switch (t) {
53
54
  case "top":
54
55
  case "bottom":
55
- return e ? n ? o : r : n ? r : o;
56
+ return n ? e ? l : u : e ? u : l;
56
57
  case "left":
57
58
  case "right":
58
- return n ? i : c;
59
+ return e ? M : O;
59
60
  default:
60
61
  return [];
61
62
  }
62
63
  }
63
- function E(t, n, e, r) {
64
- const o = g(t);
65
- let i = A(u(t), e === "start", r);
66
- return o && (i = i.map((c) => c + "-" + o), n && (i = i.concat(i.map(s)))), i;
64
+ function z(t, e, n, r) {
65
+ const i = a(t);
66
+ let o = S(g(t), n === "start", r);
67
+ return i && (o = o.map((c) => c + "-" + i), e && (o = o.concat(o.map(s)))), o;
67
68
  }
68
69
  function f(t) {
69
- return t.replace(/left|right|bottom|top/g, (n) => p[n]);
70
+ return t.replace(/left|right|bottom|top/g, (e) => h[e]);
70
71
  }
71
- function y(t) {
72
+ function w(t) {
72
73
  return {
73
74
  top: 0,
74
75
  right: 0,
@@ -77,53 +78,53 @@ function y(t) {
77
78
  ...t
78
79
  };
79
80
  }
80
- function R(t) {
81
- return typeof t != "number" ? y(t) : {
81
+ function B(t) {
82
+ return typeof t != "number" ? w(t) : {
82
83
  top: t,
83
84
  right: t,
84
85
  bottom: t,
85
86
  left: t
86
87
  };
87
88
  }
88
- function T(t) {
89
+ function D(t) {
89
90
  const {
90
- x: n,
91
- y: e,
91
+ x: e,
92
+ y: n,
92
93
  width: r,
93
- height: o
94
+ height: i
94
95
  } = t;
95
96
  return {
96
97
  width: r,
97
- height: o,
98
- top: e,
99
- left: n,
100
- right: n + r,
101
- bottom: e + o,
102
- x: n,
103
- y: e
98
+ height: i,
99
+ top: n,
100
+ left: e,
101
+ right: e + r,
102
+ bottom: n + i,
103
+ x: e,
104
+ y: n
104
105
  };
105
106
  }
106
107
  export {
107
- w as clamp,
108
- S as createCoords,
109
- j as evaluate,
110
- y as expandPaddingObject,
111
- O as floor,
112
- g as getAlignment,
113
- d as getAlignmentAxis,
114
- C as getAlignmentSides,
115
- b as getAxisLength,
116
- L as getExpandedPlacements,
108
+ R as clamp,
109
+ E as createCoords,
110
+ T as evaluate,
111
+ w as expandPaddingObject,
112
+ L as floor,
113
+ a as getAlignment,
114
+ y as getAlignmentAxis,
115
+ k as getAlignmentSides,
116
+ d as getAxisLength,
117
+ q as getExpandedPlacements,
117
118
  s as getOppositeAlignmentPlacement,
118
- h as getOppositeAxis,
119
- E as getOppositeAxisPlacements,
119
+ b as getOppositeAxis,
120
+ z as getOppositeAxisPlacements,
120
121
  f as getOppositePlacement,
121
- R as getPaddingObject,
122
- u as getSide,
123
- x as getSideAxis,
124
- m as max,
125
- l as min,
126
- T as rectToClientRect,
127
- M as round,
128
- P as sides
122
+ B as getPaddingObject,
123
+ g as getSide,
124
+ P as getSideAxis,
125
+ p as max,
126
+ m as min,
127
+ D as rectToClientRect,
128
+ C as round,
129
+ j as sides
129
130
  };
@@ -0,0 +1,178 @@
1
+ import { add as l, subtract as u, set as m, cycleDate as y, constrain as c, setTime as v, cycleTime as w, addZoned as T, subtractZoned as Z, setZoned as S, cycleZoned as C } from "./manipulation.js";
2
+ import { compareDate as p, compareTime as k } from "./queries.js";
3
+ import { dateToString as M, dateTimeToString as W, zonedDateTimeToString as z } from "./string.js";
4
+ import { GregorianCalendar as A } from "./GregorianCalendar.js";
5
+ import { toDate as b, toCalendarDateTime as _, zonedToDate as j, toZoned as E } from "./conversion.js";
6
+ import { _ as f } from "../../../@swc/helpers/esm/_class_private_field_init.js";
7
+ function $(a) {
8
+ let t = typeof a[0] == "object" ? a.shift() : new A(), e;
9
+ if (typeof a[0] == "string") e = a.shift();
10
+ else {
11
+ let s = t.getEras();
12
+ e = s[s.length - 1];
13
+ }
14
+ let i = a.shift(), r = a.shift(), h = a.shift();
15
+ return [
16
+ t,
17
+ e,
18
+ i,
19
+ r,
20
+ h
21
+ ];
22
+ }
23
+ var G = /* @__PURE__ */ new WeakMap();
24
+ class d {
25
+ /** Returns a copy of this date. */
26
+ copy() {
27
+ return this.era ? new d(this.calendar, this.era, this.year, this.month, this.day) : new d(this.calendar, this.year, this.month, this.day);
28
+ }
29
+ /** Returns a new `CalendarDate` with the given duration added to it. */
30
+ add(t) {
31
+ return l(this, t);
32
+ }
33
+ /** Returns a new `CalendarDate` with the given duration subtracted from it. */
34
+ subtract(t) {
35
+ return u(this, t);
36
+ }
37
+ /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
38
+ set(t) {
39
+ return m(this, t);
40
+ }
41
+ /**
42
+ * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
43
+ * When the resulting value reaches the limits of the field, it wraps around.
44
+ */
45
+ cycle(t, e, i) {
46
+ return y(this, t, e, i);
47
+ }
48
+ /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
49
+ toDate(t) {
50
+ return b(this, t);
51
+ }
52
+ /** Converts the date to an ISO 8601 formatted string. */
53
+ toString() {
54
+ return M(this);
55
+ }
56
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
57
+ compare(t) {
58
+ return p(this, t);
59
+ }
60
+ constructor(...t) {
61
+ f(this, G, {
62
+ writable: !0,
63
+ value: void 0
64
+ });
65
+ let [e, i, r, h, s] = $(t);
66
+ this.calendar = e, this.era = i, this.year = r, this.month = h, this.day = s, c(this);
67
+ }
68
+ }
69
+ var I = /* @__PURE__ */ new WeakMap();
70
+ class n {
71
+ /** Returns a copy of this date. */
72
+ copy() {
73
+ return this.era ? new n(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new n(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
74
+ }
75
+ /** Returns a new `CalendarDateTime` with the given duration added to it. */
76
+ add(t) {
77
+ return l(this, t);
78
+ }
79
+ /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
80
+ subtract(t) {
81
+ return u(this, t);
82
+ }
83
+ /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
84
+ set(t) {
85
+ return m(v(this, t), t);
86
+ }
87
+ /**
88
+ * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
89
+ * When the resulting value reaches the limits of the field, it wraps around.
90
+ */
91
+ cycle(t, e, i) {
92
+ switch (t) {
93
+ case "era":
94
+ case "year":
95
+ case "month":
96
+ case "day":
97
+ return y(this, t, e, i);
98
+ default:
99
+ return w(this, t, e, i);
100
+ }
101
+ }
102
+ /** Converts the date to a native JavaScript Date object in the given time zone. */
103
+ toDate(t, e) {
104
+ return b(this, t, e);
105
+ }
106
+ /** Converts the date to an ISO 8601 formatted string. */
107
+ toString() {
108
+ return W(this);
109
+ }
110
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
111
+ compare(t) {
112
+ let e = p(this, t);
113
+ return e === 0 ? k(this, _(t)) : e;
114
+ }
115
+ constructor(...t) {
116
+ f(this, I, {
117
+ writable: !0,
118
+ value: void 0
119
+ });
120
+ let [e, i, r, h, s] = $(t);
121
+ this.calendar = e, this.era = i, this.year = r, this.month = h, this.day = s, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, c(this);
122
+ }
123
+ }
124
+ var O = /* @__PURE__ */ new WeakMap();
125
+ class o {
126
+ /** Returns a copy of this date. */
127
+ copy() {
128
+ return this.era ? new o(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond) : new o(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
129
+ }
130
+ /** Returns a new `ZonedDateTime` with the given duration added to it. */
131
+ add(t) {
132
+ return T(this, t);
133
+ }
134
+ /** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
135
+ subtract(t) {
136
+ return Z(this, t);
137
+ }
138
+ /** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
139
+ set(t, e) {
140
+ return S(this, t, e);
141
+ }
142
+ /**
143
+ * Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
144
+ * When the resulting value reaches the limits of the field, it wraps around.
145
+ */
146
+ cycle(t, e, i) {
147
+ return C(this, t, e, i);
148
+ }
149
+ /** Converts the date to a native JavaScript Date object. */
150
+ toDate() {
151
+ return j(this);
152
+ }
153
+ /** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
154
+ toString() {
155
+ return z(this);
156
+ }
157
+ /** Converts the date to an ISO 8601 formatted string in UTC. */
158
+ toAbsoluteString() {
159
+ return this.toDate().toISOString();
160
+ }
161
+ /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
162
+ compare(t) {
163
+ return this.toDate().getTime() - E(t, this.timeZone).toDate().getTime();
164
+ }
165
+ constructor(...t) {
166
+ f(this, O, {
167
+ writable: !0,
168
+ value: void 0
169
+ });
170
+ let [e, i, r, h, s] = $(t), x = t.shift(), D = t.shift();
171
+ this.calendar = e, this.era = i, this.year = r, this.month = h, this.day = s, this.timeZone = x, this.offset = D, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, c(this);
172
+ }
173
+ }
174
+ export {
175
+ d as CalendarDate,
176
+ n as CalendarDateTime,
177
+ o as ZonedDateTime
178
+ };