welcome-ui 10.4.0 → 10.5.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 (87) hide show
  1. package/dist/{5TKKKQCL-B53p3Vri.js → 5TKKKQCL-rs260p95.js} +2 -2
  2. package/dist/{APVORPDK-DuBDzcfp.js → APVORPDK-i7Z_eBMP.js} +2 -2
  3. package/dist/Accordion.js +4 -4
  4. package/dist/Alert.js +1 -1
  5. package/dist/AspectRatio.js +1 -1
  6. package/dist/Avatar.js +1 -1
  7. package/dist/Badge.js +1 -1
  8. package/dist/Breadcrumb.js +1 -1
  9. package/dist/Button.js +1 -1
  10. package/dist/ButtonGroup.js +1 -1
  11. package/dist/{CVCFNOHX-CeUlkMgT.js → CVCFNOHX-Ck0bUDvo.js} +2 -2
  12. package/dist/Card.js +1 -1
  13. package/dist/Checkbox.js +2 -2
  14. package/dist/CloseButton.js +1 -1
  15. package/dist/DatePicker.js +2 -2
  16. package/dist/DateTimePicker.js +2 -2
  17. package/dist/Drawer.js +5 -5
  18. package/dist/DropdownMenu.js +12 -12
  19. package/dist/{ECBEZ4YM-BlwWRwxN.js → ECBEZ4YM-o09xUuV6.js} +3 -3
  20. package/dist/Field.js +1 -1
  21. package/dist/FieldGroup.js +1 -1
  22. package/dist/FileDrop.js +2 -2
  23. package/dist/FileUpload.js +1 -1
  24. package/dist/FloatingActionBar.js +1 -1
  25. package/dist/Hint.js +1 -1
  26. package/dist/{I7KWAPMF-CuA_ygsc.js → I7KWAPMF-DQWZpGyL.js} +1 -1
  27. package/dist/{IQYAUKXT-CMV5f3NE.js → IQYAUKXT-Cltvp3KN.js} +1 -1
  28. package/dist/Icon.js +1 -1
  29. package/dist/InputText.js +1 -1
  30. package/dist/{JMU4N4M5-BRPvDp3v.js → JMU4N4M5-DnfyqGdJ.js} +1 -1
  31. package/dist/Label.js +1 -1
  32. package/dist/Link.js +1 -1
  33. package/dist/Loader.js +1 -1
  34. package/dist/Logo.js +1 -1
  35. package/dist/Modal.js +5 -5
  36. package/dist/{NDVACHQI-B7drCM9O.js → NDVACHQI-WTOpOfgG.js} +1 -1
  37. package/dist/{OCCHVUS4-SwOpz56L.js → OCCHVUS4-BJVLPRH8.js} +1 -1
  38. package/dist/Pagination.js +1 -1
  39. package/dist/Popover.js +4 -4
  40. package/dist/{Q5W46E73-ClIlNE6g.js → Q5W46E73-5xQblshY.js} +1 -1
  41. package/dist/{RFRKSHIZ-BMv-8lMI.js → RFRKSHIZ-C_FLl4qI.js} +3 -3
  42. package/dist/Radio.js +2 -2
  43. package/dist/RadioGroup.js +3 -3
  44. package/dist/RadioTab.js +2 -2
  45. package/dist/Search.js +2 -2
  46. package/dist/Select.js +2 -2
  47. package/dist/Slider.js +1 -1
  48. package/dist/Stamp.js +1 -1
  49. package/dist/Stepper.js +1 -1
  50. package/dist/StickyNote.js +1 -1
  51. package/dist/Swiper.js +299 -2146
  52. package/dist/Table.js +1 -1
  53. package/dist/Tabs.js +7 -7
  54. package/dist/Tag.js +1 -1
  55. package/dist/Text.js +1 -1
  56. package/dist/Textarea.js +1 -1
  57. package/dist/TimePicker.js +2 -2
  58. package/dist/Toast.js +1 -1
  59. package/dist/Toggle.js +2 -2
  60. package/dist/Tooltip.js +4 -4
  61. package/dist/VariantIcon.js +1 -1
  62. package/dist/VisuallyHidden.js +1 -1
  63. package/dist/{WLZ6H5FH-6NScq2Y6.js → WLZ6H5FH-CuTcX7sR.js} +1 -1
  64. package/dist/{WZWDIE3S-DDipnVYO.js → WZWDIE3S-CGqoM1Fy.js} +1 -1
  65. package/dist/WelcomeLoader.js +1 -1
  66. package/dist/Window.css +1 -1
  67. package/dist/Window.js +78 -76
  68. package/dist/{Z32PU2LQ-7OK4psIK.js → Z32PU2LQ-DMjfxuT9.js} +2 -2
  69. package/dist/{ZMWF7ASR-BGZQn0ZB.js → ZMWF7ASR-Jc8y_k3t.js} +1 -1
  70. package/dist/{downshift.esm-xtYanIDi.js → downshift.esm-BtYj0L0Y.js} +1 -1
  71. package/dist/index-B6iGEm-i.js +1935 -0
  72. package/dist/{tab-panel-BFzjhpJq.js → tab-panel-Cc3MfOBM.js} +4 -4
  73. package/dist/{tslib.es6-C80jYMbM.js → tslib.es6-CKhMT3k3.js} +1 -1
  74. package/dist/types/components/Drawer/index.d.ts +1 -1
  75. package/dist/types/components/Modal/index.d.ts +1 -1
  76. package/dist/types/components/Window/components/Header.d.ts +1 -1
  77. package/dist/types/components/Window/index.d.ts +1 -1
  78. package/dist/types/components/Window/types.d.ts +1 -0
  79. package/dist/types/utils/index.d.ts +3 -0
  80. package/dist/types/utils/use-breakpoint.d.ts +15 -0
  81. package/dist/types/utils/use-breakpoint.test.d.ts +1 -0
  82. package/dist/types/utils/use-viewport.test.d.ts +1 -0
  83. package/dist/use-viewport-GQu4vkby.js +20 -0
  84. package/dist/{utils-BGmdljvh.js → utils-ZE_dEXnJ.js} +1 -1
  85. package/dist/utils.js +25 -14
  86. package/package.json +1 -1
  87. package/dist/index-PAaZGbyz.js +0 -102
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { C as q, a as B, c as V, b as X, d as z } from "./WZWDIE3S-DDipnVYO.js";
3
- import { b as w } from "./Q5W46E73-ClIlNE6g.js";
2
+ import { C as q, a as B, c as V, b as X, d as z } from "./WZWDIE3S-CGqoM1Fy.js";
3
+ import { b as w } from "./Q5W46E73-5xQblshY.js";
4
4
  import { b as G, w as J, f as N, c as k, a as _, i as R, j as H, B as Q, u as L, h as K, a9 as U, q as Y, X as Z } from "./U6HHPQDW-CzxyP5H7.js";
5
5
  import { useCallback as O, useRef as W, useEffect as M, useState as p } from "react";
6
6
  import { jsx as D } from "react/jsx-runtime";
7
- import { u as ee } from "./ZMWF7ASR-BGZQn0ZB.js";
8
- import { u as te, d as ne } from "./WLZ6H5FH-6NScq2Y6.js";
7
+ import { u as ee } from "./ZMWF7ASR-Jc8y_k3t.js";
8
+ import { u as te, d as ne } from "./WLZ6H5FH-CuTcX7sR.js";
9
9
  var A = G(
10
10
  [B],
11
11
  [q]
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { g as Se } from "./index-PAaZGbyz.js";
2
+ import { g as Se } from "./index-B6iGEm-i.js";
3
3
  var V = { exports: {} }, N = { exports: {} }, g = {}, ue;
4
4
  function _e() {
5
5
  if (ue) return g;
@@ -18,7 +18,7 @@ export declare const Drawer: import('react').ForwardRefExoticComponent<Omit<Draw
18
18
  Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
19
19
  children?: import('react').ReactNode | undefined;
20
20
  } & import('react').RefAttributes<HTMLDivElement>> & {
21
- Button: ({ "aria-label": ariaLabel, className, icon, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('../Window/types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
21
+ Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('../Window/types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
22
22
  CloseButton: ({ as, className, onClick, }: import('../../utils').PropsWithAs<import('../../utils').As, Omit<import('../Window/types').ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
23
23
  LeftActions: ({ isExpandable, onExpandChange }: import('../Window/types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
24
24
  RightActions: ({ children, isClosable, onClose }: import('../Window/types').HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -33,7 +33,7 @@ export declare const Modal: import('../../utils').FunctionComponentWithAs<"div",
33
33
  WindowHeader: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
34
34
  children?: import('react').ReactNode | undefined;
35
35
  } & import('react').RefAttributes<HTMLDivElement>> & {
36
- Button: ({ "aria-label": ariaLabel, className, icon, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('../Window/types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
36
+ Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('../Window/types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
37
37
  CloseButton: ({ as, className, onClick, }: import('../../utils').PropsWithAs<import('../../utils').As, Omit<import('../Window/types').ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
38
38
  LeftActions: ({ isExpandable, onExpandChange }: import('../Window/types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
39
39
  RightActions: ({ children, isClosable, onClose }: import('../Window/types').HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ export declare const HeaderComponent: import('react').ForwardRefExoticComponent<
6
6
  export declare const Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
7
7
  children?: import('react').ReactNode | undefined;
8
8
  } & import('react').RefAttributes<HTMLDivElement>> & {
9
- Button: ({ "aria-label": ariaLabel, className, icon, onClick, ...rest }: PropsWithAs<As, ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
9
+ Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: PropsWithAs<As, ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
10
10
  CloseButton: ({ as, className, onClick, }: PropsWithAs<As, Omit<ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
11
11
  LeftActions: ({ isExpandable, onExpandChange }: HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
12
12
  RightActions: ({ children, isClosable, onClose }: HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -11,7 +11,7 @@ export declare const Window: import('../../utils').FunctionComponentWithAs<"div"
11
11
  Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
12
12
  children?: import('react').ReactNode | undefined;
13
13
  } & import('react').RefAttributes<HTMLDivElement>> & {
14
- Button: ({ "aria-label": ariaLabel, className, icon, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('./types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
14
+ Button: ({ "aria-label": ariaLabel, className, icon, isActive, onClick, ...rest }: import('../../utils').PropsWithAs<import('../../utils').As, import('./types').ActionButtonProps>) => import("react/jsx-runtime").JSX.Element;
15
15
  CloseButton: ({ as, className, onClick, }: import('../../utils').PropsWithAs<import('../../utils').As, Omit<import('./types').ActionButtonProps, "icon">>) => import("react/jsx-runtime").JSX.Element;
16
16
  LeftActions: ({ isExpandable, onExpandChange }: import('./types').HeaderLeftActionsProps) => import("react/jsx-runtime").JSX.Element;
17
17
  RightActions: ({ children, isClosable, onClose }: import('./types').HeaderRightActionsProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,7 @@ import { MergeProps, PropsWithAs } from '../../utils';
5
5
  import { IconName } from '../Icon/types';
6
6
  export interface ActionButtonOptions {
7
7
  icon: IconName;
8
+ isActive?: boolean;
8
9
  }
9
10
  export type ActionButtonProps = MergeProps<HTMLAttributes<HTMLButtonElement>, ActionButtonOptions>;
10
11
  export interface BodyOptions {
@@ -1,4 +1,7 @@
1
1
  export * from './classNames';
2
2
  export * from './forwardRefWithAs';
3
3
  export * from './ts-utils';
4
+ export * from './use-breakpoint';
4
5
  export * from './use-copy-text';
6
+ export * from './use-screens';
7
+ export * from './use-viewport';
@@ -0,0 +1,15 @@
1
+ import { ScreenSizes } from '../theme/types';
2
+ export type Breakpoint = Exclude<ScreenSizes, 'xxl'>;
3
+ export type BreakpointBoundary = 'excludeThreshold' | 'includeThreshold';
4
+ /**
5
+ * Reactive current breakpoint name, derived from the theme's screen tokens
6
+ * and the live viewport width.
7
+ *
8
+ * @param boundary - How to resolve a viewport that's exactly at a breakpoint's threshold:
9
+ * - `'includeThreshold'` (default): the breakpoint starts as soon as the viewport reaches its
10
+ * threshold (`width >= threshold`). E.g. at exactly 736px, `useBreakpoint()` returns `'md'`.
11
+ * - `'excludeThreshold'`: the breakpoint only starts once the viewport strictly passes its
12
+ * threshold (`width > threshold`). E.g. at exactly 736px, `useBreakpoint('excludeThreshold')`
13
+ * returns `'sm'` — `'md'` only kicks in at 737px.
14
+ */
15
+ export declare function useBreakpoint(boundary?: BreakpointBoundary): Breakpoint;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { useEffect as s, useLayoutEffect as u, useState as f, useRef as d } from "react";
3
+ const m = typeof window > "u" ? s : u, S = 300;
4
+ function z() {
5
+ const [o, i] = f({ height: void 0, width: void 0 }), e = d();
6
+ return m(() => {
7
+ const t = new ResizeObserver(([n]) => {
8
+ const { blockSize: c, inlineSize: r } = n.contentBoxSize[0];
9
+ clearTimeout(e.current), e.current = setTimeout(() => {
10
+ i({ height: c, width: r });
11
+ }, S);
12
+ });
13
+ return t.observe(document.documentElement), () => {
14
+ clearTimeout(e.current), t.disconnect();
15
+ };
16
+ }, []), o;
17
+ }
18
+ export {
19
+ z as u
20
+ };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { g as J } from "./index-PAaZGbyz.js";
2
+ import { g as J } from "./index-B6iGEm-i.js";
3
3
  const Y = {
4
4
  "custom-header": "_custom-header_1w74t_2",
5
5
  "date-picker": "_date-picker_1w74t_9",
package/dist/utils.js CHANGED
@@ -1,20 +1,31 @@
1
1
  "use client";
2
2
  import './utils.css';
3
- import { b as f } from "./index-PAaZGbyz.js";
4
- import { c as d } from "./index-PAaZGbyz.js";
5
- import { f as C } from "./forwardRefWithAs-8eP3ZN15.js";
6
- import { useState as p, useCallback as a } from "react";
7
- function n(e, o) {
8
- const [t, s] = p();
9
- return [a(() => {
10
- let r;
11
- typeof e == "number" || typeof e == "string" ? r = e.toString() : e.current instanceof HTMLInputElement ? r = e.current.value : e.current instanceof HTMLElement && (r = e.current.textContent);
12
- const i = f(r);
13
- s(i), o && setTimeout(s, o);
3
+ import { u, b as f } from "./index-B6iGEm-i.js";
4
+ import { c as b } from "./index-B6iGEm-i.js";
5
+ import { f as S } from "./forwardRefWithAs-8eP3ZN15.js";
6
+ import { u as p } from "./use-viewport-GQu4vkby.js";
7
+ import { useState as a, useCallback as d } from "react";
8
+ function y(e = "includeThreshold") {
9
+ const { width: o } = p(), t = u(), i = o ?? (typeof window < "u" ? window.innerWidth : 0), c = (r) => e === "includeThreshold" ? i >= r : i > r, s = Object.keys(t).filter((r) => r !== "xxl").sort((r, n) => t[r] - t[n]);
10
+ return s.reduce(
11
+ (r, n) => c(t[n]) ? n : r,
12
+ s[0]
13
+ );
14
+ }
15
+ function w(e, o) {
16
+ const [t, i] = a();
17
+ return [d(() => {
18
+ let s;
19
+ typeof e == "number" || typeof e == "string" ? s = e.toString() : e.current instanceof HTMLInputElement ? s = e.current.value : e.current instanceof HTMLElement && (s = e.current.textContent);
20
+ const r = f(s);
21
+ i(r), o && setTimeout(i, o);
14
22
  }, [e, o]), t];
15
23
  }
16
24
  export {
17
- d as classNames,
18
- C as forwardRefWithAs,
19
- n as useCopyText
25
+ b as classNames,
26
+ S as forwardRefWithAs,
27
+ y as useBreakpoint,
28
+ w as useCopyText,
29
+ u as useScreens,
30
+ p as useViewportSize
20
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "10.4.0",
3
+ "version": "10.5.0",
4
4
  "description": "Customizable design system with react, typescript, tailwindcss and ariakit.",
5
5
  "files": [
6
6
  "dist"
@@ -1,102 +0,0 @@
1
- "use client";
2
- var R = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3
- function D(e) {
4
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
5
- }
6
- function S(e) {
7
- return function(...o) {
8
- const c = /* @__PURE__ */ new Set();
9
- function l(...f) {
10
- for (const a of f)
11
- if (a) {
12
- if (typeof a == "string")
13
- c.add((e == null ? void 0 : e[a]) || a);
14
- else if (Array.isArray(a))
15
- l(...a);
16
- else if (typeof a == "object")
17
- for (const t in a)
18
- Object.prototype.hasOwnProperty.call(a, t) && a[t] && c.add((e == null ? void 0 : e[t]) || t);
19
- }
20
- }
21
- return l(...o), Array.from(c).join(" ");
22
- };
23
- }
24
- var y, v;
25
- function h() {
26
- return v || (v = 1, y = function() {
27
- var e = document.getSelection();
28
- if (!e.rangeCount)
29
- return function() {
30
- };
31
- for (var o = document.activeElement, c = [], l = 0; l < e.rangeCount; l++)
32
- c.push(e.getRangeAt(l));
33
- switch (o.tagName.toUpperCase()) {
34
- // .toUpperCase handles XHTML
35
- case "INPUT":
36
- case "TEXTAREA":
37
- o.blur();
38
- break;
39
- default:
40
- o = null;
41
- break;
42
- }
43
- return e.removeAllRanges(), function() {
44
- e.type === "Caret" && e.removeAllRanges(), e.rangeCount || c.forEach(function(f) {
45
- e.addRange(f);
46
- }), o && o.focus();
47
- };
48
- }), y;
49
- }
50
- var g, C;
51
- function T() {
52
- if (C) return g;
53
- C = 1;
54
- var e = h(), o = {
55
- "text/plain": "Text",
56
- "text/html": "Url",
57
- default: "Text"
58
- }, c = "Copy to clipboard: #{key}, Enter";
59
- function l(a) {
60
- var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
61
- return a.replace(/#{\s*key\s*}/g, t);
62
- }
63
- function f(a, t) {
64
- var i, b, m, u, s, r, d = !1;
65
- t || (t = {}), i = t.debug || !1;
66
- try {
67
- m = e(), u = document.createRange(), s = document.getSelection(), r = document.createElement("span"), r.textContent = a, r.ariaHidden = "true", r.style.all = "unset", r.style.position = "fixed", r.style.top = 0, r.style.clip = "rect(0, 0, 0, 0)", r.style.whiteSpace = "pre", r.style.webkitUserSelect = "text", r.style.MozUserSelect = "text", r.style.msUserSelect = "text", r.style.userSelect = "text", r.addEventListener("copy", function(n) {
68
- if (n.stopPropagation(), t.format)
69
- if (n.preventDefault(), typeof n.clipboardData > "u") {
70
- i && console.warn("unable to use e.clipboardData"), i && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
71
- var p = o[t.format] || o.default;
72
- window.clipboardData.setData(p, a);
73
- } else
74
- n.clipboardData.clearData(), n.clipboardData.setData(t.format, a);
75
- t.onCopy && (n.preventDefault(), t.onCopy(n.clipboardData));
76
- }), document.body.appendChild(r), u.selectNodeContents(r), s.addRange(u);
77
- var w = document.execCommand("copy");
78
- if (!w)
79
- throw new Error("copy command was unsuccessful");
80
- d = !0;
81
- } catch (n) {
82
- i && console.error("unable to copy using execCommand: ", n), i && console.warn("trying IE specific stuff");
83
- try {
84
- window.clipboardData.setData(t.format || "text", a), t.onCopy && t.onCopy(window.clipboardData), d = !0;
85
- } catch (p) {
86
- i && console.error("unable to copy using clipboardData: ", p), i && console.error("falling back to prompt"), b = l("message" in t ? t.message : c), window.prompt(b, a);
87
- }
88
- } finally {
89
- s && (typeof s.removeRange == "function" ? s.removeRange(u) : s.removeAllRanges()), r && document.body.removeChild(r), m();
90
- }
91
- return d;
92
- }
93
- return g = f, g;
94
- }
95
- var E = T();
96
- const x = /* @__PURE__ */ D(E);
97
- export {
98
- R as a,
99
- x as b,
100
- S as c,
101
- D as g
102
- };