@phillips/seldon 1.32.0 → 1.34.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 (74) hide show
  1. package/dist/components/Accordion/AccordionItem.d.ts +5 -1
  2. package/dist/components/Accordion/AccordionItem.js +59 -58
  3. package/dist/components/Button/Button.d.ts +1 -1
  4. package/dist/components/Button/Button.js +39 -34
  5. package/dist/components/Drawer/Drawer.d.ts +23 -0
  6. package/dist/components/Drawer/Drawer.js +46 -0
  7. package/dist/components/Footer/Footer.d.ts +1 -1
  8. package/dist/components/Footer/Footer.js +12 -10
  9. package/dist/components/Social/Social.d.ts +10 -1
  10. package/dist/components/Social/Social.js +17 -8
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +34 -32
  13. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +6 -6
  14. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +8 -8
  15. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +3 -3
  16. package/dist/node_modules/@radix-ui/react-context/dist/index.js +67 -0
  17. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +260 -0
  18. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
  19. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +18 -0
  20. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +137 -0
  21. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
  22. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
  23. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  24. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  25. package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
  26. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
  27. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
  28. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
  29. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
  30. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +62 -0
  31. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  32. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  33. package/dist/node_modules/react-remove-scroll/node_modules/tslib/tslib.es6.js +27 -0
  34. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
  35. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
  36. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
  37. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
  38. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
  39. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
  40. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
  41. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
  42. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
  43. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
  44. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
  45. package/dist/node_modules/use-sidecar/node_modules/tslib/tslib.es6.js +21 -0
  46. package/dist/scss/_vars.scss +2 -0
  47. package/dist/scss/components/Drawer/_drawer.scss +66 -0
  48. package/dist/scss/components/Footer/_footer.scss +79 -32
  49. package/dist/scss/components/Social/_social.scss +44 -6
  50. package/dist/scss/components/Subscribe/_subscribe.scss +1 -0
  51. package/dist/scss/styles.scss +1 -0
  52. package/package.json +7 -6
  53. package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-context/dist/index.js +0 -52
  54. package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.js +0 -31
  55. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/primitive/dist/index.js +0 -9
  56. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -14
  57. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-context/dist/index.js +0 -52
  58. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-id/dist/index.js +0 -13
  59. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-primitive/dist/index.js +0 -31
  60. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
  61. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -13
  62. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -32
  63. package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
  64. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -14
  65. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context/dist/index.js +0 -52
  66. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +0 -48
  67. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/primitive → primitive}/dist/index.js +0 -0
  68. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-compose-refs → react-compose-refs}/dist/index.js +0 -0
  69. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-id → react-id}/dist/index.js +0 -0
  70. /package/dist/node_modules/@radix-ui/{react-collapsible/node_modules/@radix-ui/react-presence → react-presence}/dist/index.js +0 -0
  71. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-slot → react-slot}/dist/index.js +0 -0
  72. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-callback-ref → react-use-callback-ref}/dist/index.js +0 -0
  73. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-controllable-state → react-use-controllable-state}/dist/index.js +0 -0
  74. /package/dist/node_modules/@radix-ui/{react-accordion/node_modules/@radix-ui/react-use-layout-effect → react-use-layout-effect}/dist/index.js +0 -0
@@ -42,6 +42,7 @@ $clock-widget-red: $widget-red;
42
42
  $articker-red: #fc1e2b;
43
43
  $articker-orange: #ff8201;
44
44
  $articker-red-orange-gradient: linear-gradient(90deg, #fc1e2b, #ff8201);
45
+ $overlay-black: rgba(0, 0, 0, 80%);
45
46
 
46
47
  // Legacy mapping
47
48
  $pure-white: $white;
@@ -242,3 +243,4 @@ $size-sm: 'sm';
242
243
  $size-md: 'md';
243
244
  $size-lg: 'lg';
244
245
  $size-xl: 'xl';
246
+ $default-transition: 150ms cubic-bezier(0.16, 1, 0.3, 1);
@@ -0,0 +1,66 @@
1
+ @import '../../_vars';
2
+
3
+ .#{$px}-drawer {
4
+ align-items: center;
5
+ animation: content-show $default-transition;
6
+ background-color: $white;
7
+ display: flex;
8
+ flex-direction: column;
9
+ height: 100vh;
10
+ max-width: 600px;
11
+ padding: $padding-md;
12
+ position: fixed;
13
+ right: 0;
14
+ top: 0;
15
+ width: 100%;
16
+ z-index: 10;
17
+
18
+ &:focus {
19
+ outline: none;
20
+ }
21
+
22
+ @media (max-width: $breakpoint-sm) {
23
+ max-width: 100%;
24
+ }
25
+
26
+ &__overlay {
27
+ animation: overlay-show $default-transition;
28
+ background-color: $overlay-black;
29
+ inset: 0;
30
+ position: fixed;
31
+ z-index: 10;
32
+ }
33
+
34
+ &__close {
35
+ align-items: center;
36
+ border-radius: 100%;
37
+ color: $pure-black;
38
+ display: inline-flex;
39
+ justify-content: center;
40
+ position: absolute;
41
+ right: 10px;
42
+ top: 10px;
43
+ }
44
+
45
+ @keyframes overlay-show {
46
+ from {
47
+ opacity: 0;
48
+ }
49
+
50
+ to {
51
+ opacity: 1;
52
+ }
53
+ }
54
+
55
+ @keyframes content-show {
56
+ from {
57
+ opacity: 0;
58
+ transform: translateX(12rem);
59
+ }
60
+
61
+ to {
62
+ opacity: 1;
63
+ transform: translateX(0);
64
+ }
65
+ }
66
+ }
@@ -5,44 +5,76 @@
5
5
 
6
6
  .#{$px}-footer {
7
7
  background-color: $off-white;
8
- border-top: 1px solid $keyline-gray;
9
8
  margin: $spacing-lg 0 0;
10
9
  width: 100%;
11
10
 
12
- ul {
13
- list-style: none;
14
- padding: 0;
15
- }
16
-
17
- &__navigation {
18
- background-color: $white;
19
- padding: $spacing-md $spacing-md $spacing-sm;
20
- text-align: right;
21
-
22
- @include media($size-md) {
23
- padding: $spacing-md $spacing-lg $spacing-sm;
24
- }
25
-
26
- @include media($size-lg) {
27
- padding: $spacing-md $spacing-xl $spacing-sm;
11
+ .#{$px}-accordion {
12
+ border-bottom: 1px solid #eae8e4;
13
+ border-top: 1px solid #eae8e4;
14
+ width: 100%;
15
+
16
+ &-item {
17
+ padding: $spacing-sm 0 0;
18
+
19
+ ul {
20
+ li {
21
+ a {
22
+ font-size: 0.875rem;
23
+ font-weight: 500;
24
+ line-height: 1.875rem;
25
+
26
+ &:hover {
27
+ text-decoration: underline;
28
+ }
29
+ }
30
+ }
31
+ }
32
+
33
+ &-label {
34
+ opacity: 1;
35
+ padding: 0 0 0.5rem;
36
+
37
+ @include media($size-sm) {
38
+ cursor: unset;
39
+ }
40
+
41
+ &__text {
42
+ color: $pure-black;
43
+ font-family: $Distinct;
44
+ font-size: 1rem;
45
+ font-weight: 600;
46
+ }
47
+ }
48
+
49
+ &__border-bottom {
50
+ border-bottom: 1px solid #eae8e4;
51
+ }
28
52
  }
53
+ }
29
54
 
30
- ul {
31
- display: inline-flex;
32
- flex-wrap: wrap;
33
- gap: $spacing-md;
34
- justify-content: center;
35
- list-style: none;
36
- padding: 0;
55
+ @include media($size-sm) {
56
+ .#{$px}-accordion {
57
+ border-bottom: 0;
58
+ border-top: 0;
59
+ display: flex;
60
+ width: 100%;
61
+
62
+ &-item {
63
+ border-bottom: 0;
64
+ flex: 1;
65
+ max-width: 18rem;
66
+ padding: $spacing-sm;
67
+
68
+ &-label__icon {
69
+ display: none;
70
+ }
71
+ }
37
72
  }
73
+ }
38
74
 
39
- a,
40
- button {
41
- @include text('cta-sm');
42
- @include bodyText;
43
-
44
- cursor: pointer;
45
- }
75
+ ul {
76
+ list-style: none;
77
+ padding: 0;
46
78
  }
47
79
 
48
80
  &__content {
@@ -88,10 +120,25 @@
88
120
  align-items: center;
89
121
  background-color: $white;
90
122
  display: flex;
123
+ flex-direction: column;
124
+ font-size: 1rem;
125
+ gap: 1rem;
91
126
 
92
- // font-size: 0.875rem;
93
127
  // height: 2.125rem;
94
128
  justify-content: center;
95
129
  padding: $spacing-xsm 0;
130
+
131
+ h1 {
132
+ margin-top: $spacing-md;
133
+ }
134
+ }
135
+
136
+ .#{$px}-split-panel {
137
+ @include media($size-sm) {
138
+ & > :last-child {
139
+ flex: unset;
140
+ width: unset;
141
+ }
142
+ }
96
143
  }
97
144
  }
@@ -3,30 +3,68 @@
3
3
  @import '../../type';
4
4
 
5
5
  .#{$px}-social {
6
- align-items: center;
7
6
  display: inline-flex;
8
7
  flex-direction: column;
8
+ padding: 0;
9
+ width: 100%;
10
+
11
+ @include media($size-sm) {
12
+ align-items: center;
13
+ padding: $spacing-sm;
14
+ width: unset;
15
+ }
16
+
17
+ &__button {
18
+ color: $pure-black;
19
+ font-size: 0.875rem;
20
+ justify-content: flex-start;
21
+ opacity: 1;
22
+ padding: 0;
23
+ text-decoration: underline;
24
+ white-space: nowrap;
25
+
26
+ @include media($size-sm) {
27
+ justify-content: center;
28
+ }
29
+
30
+ &:hover {
31
+ background-color: unset;
32
+ color: unset;
33
+ }
34
+
35
+ &:focus {
36
+ background-color: unset;
37
+ color: unset;
38
+ }
39
+ }
9
40
 
10
41
  @include media($size-sm) {
11
42
  align-items: flex-end;
12
43
  }
13
44
 
14
45
  &__header {
15
- @include text($heading3);
16
-
17
- margin-bottom: $spacing-xsm;
46
+ color: $pure-black;
47
+ font-family: $Distinct;
48
+ font-size: 1rem;
49
+ font-weight: 600;
50
+ margin-bottom: 0.75rem;
18
51
  }
19
52
 
20
53
  ul {
21
54
  align-items: center;
55
+ border-top: 1px solid #eae8e4;
22
56
  display: flex;
23
57
  gap: 0 1.25rem;
24
58
  list-style: none;
25
- margin: 0 0 $spacing-md;
26
- padding: 0;
59
+ margin: $spacing-md 0 $spacing-md;
60
+ padding: $spacing-md 0 0;
27
61
 
28
62
  @include media($size-sm) {
29
63
  gap: 0 1rem;
64
+ justify-content: flex-end;
65
+ margin: $spacing-sm 0 $spacing-md;
66
+ padding: $spacing-sm 0 0;
67
+ width: 100%;
30
68
  }
31
69
 
32
70
  li {
@@ -5,6 +5,7 @@
5
5
 
6
6
  .#{$px}-subscribe {
7
7
  max-width: 30rem;
8
+ width: 100%;
8
9
 
9
10
  &__title {
10
11
  @include text($heading3);
@@ -38,3 +38,4 @@
38
38
  @import 'components/Modal/modal';
39
39
  @import 'components/Accordion/accordion';
40
40
  @import 'components/Breadcrumb/breadcrumb';
41
+ @import 'components/Drawer/drawer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.32.0",
3
+ "version": "1.34.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -40,6 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@radix-ui/react-accordion": "^1.2.0",
43
+ "@radix-ui/react-dialog": "^1.1.1",
43
44
  "change-case": "^5.4.4",
44
45
  "classnames": "^2.5.1",
45
46
  "flatpickr": "^4.6.13",
@@ -77,10 +78,10 @@
77
78
  "eslint": "^8.57.0",
78
79
  "eslint-plugin-react": "^7.34.3",
79
80
  "eslint-plugin-react-hooks": "^4.6.2",
80
- "eslint-plugin-react-refresh": "^0.4.8",
81
+ "eslint-plugin-react-refresh": "^0.4.9",
81
82
  "eslint-plugin-storybook": "^0.8.0",
82
- "husky": "^9.1.2",
83
- "prettier": "3.3.2",
83
+ "husky": "^9.1.4",
84
+ "prettier": "3.3.3",
84
85
  "react": "^18.3.1",
85
86
  "react-docgen-typescript": "^2.2.2",
86
87
  "react-dom": "^18.2.0",
@@ -90,14 +91,14 @@
90
91
  "sass": "^1.77.8",
91
92
  "semantic-release": "^23.1.1",
92
93
  "storybook": "^8.1.4",
93
- "stylelint": "^16.6.1",
94
+ "stylelint": "^16.8.1",
94
95
  "stylelint-config-standard": "^36.0.1",
95
96
  "stylelint-config-standard-scss": "^13.1.0",
96
97
  "stylelint-order": "^6.0.4",
97
98
  "stylelint-scss": "^6.4.1",
98
99
  "ts-node": "^10.9.2",
99
100
  "typescript": "^5.5.4",
100
- "vite": "^5.3.3",
101
+ "vite": "^5.3.5",
101
102
  "vite-plugin-dts": "^2.3.0",
102
103
  "vite-plugin-svgr": "^4.2.0",
103
104
  "vite-tsconfig-paths": "^4.3.2",
@@ -1,52 +0,0 @@
1
- import * as i from "react";
2
- import { jsx as _ } from "react/jsx-runtime";
3
- function P(t, x = []) {
4
- let o = [];
5
- function f(u, e) {
6
- const n = i.createContext(e), r = o.length;
7
- o = [...o, e];
8
- function m(a) {
9
- const { scope: c, children: C, ...p } = a, d = (c == null ? void 0 : c[t][r]) || n, v = i.useMemo(() => p, Object.values(p));
10
- return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
11
- }
12
- function S(a, c) {
13
- const C = (c == null ? void 0 : c[t][r]) || n, p = i.useContext(C);
14
- if (p) return p;
15
- if (e !== void 0) return e;
16
- throw new Error(`\`${a}\` must be used within \`${u}\``);
17
- }
18
- return m.displayName = u + "Provider", [m, S];
19
- }
20
- const s = () => {
21
- const u = o.map((e) => i.createContext(e));
22
- return function(n) {
23
- const r = (n == null ? void 0 : n[t]) || u;
24
- return i.useMemo(
25
- () => ({ [`__scope${t}`]: { ...n, [t]: r } }),
26
- [n, r]
27
- );
28
- };
29
- };
30
- return s.scopeName = t, [f, h(s, ...x)];
31
- }
32
- function h(...t) {
33
- const x = t[0];
34
- if (t.length === 1) return x;
35
- const o = () => {
36
- const f = t.map((s) => ({
37
- useScope: s(),
38
- scopeName: s.scopeName
39
- }));
40
- return function(u) {
41
- const e = f.reduce((n, { useScope: r, scopeName: m }) => {
42
- const a = r(u)[`__scope${m}`];
43
- return { ...n, ...a };
44
- }, {});
45
- return i.useMemo(() => ({ [`__scope${x.scopeName}`]: e }), [e]);
46
- };
47
- };
48
- return o.scopeName = x.scopeName, o;
49
- }
50
- export {
51
- P as createContextScope
52
- };
@@ -1,31 +0,0 @@
1
- import * as f from "react";
2
- import "react-dom";
3
- import { Slot as n } from "../../react-slot/dist/index.js";
4
- import { jsx as s } from "react/jsx-runtime";
5
- var d = [
6
- "a",
7
- "button",
8
- "div",
9
- "form",
10
- "h2",
11
- "h3",
12
- "img",
13
- "input",
14
- "label",
15
- "li",
16
- "nav",
17
- "ol",
18
- "p",
19
- "span",
20
- "svg",
21
- "ul"
22
- ], c = d.reduce((o, r) => {
23
- const i = f.forwardRef((t, e) => {
24
- const { asChild: m, ...a } = t, p = m ? n : r;
25
- return typeof window != "undefined" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(p, { ...a, ref: e });
26
- });
27
- return i.displayName = `Primitive.${r}`, { ...o, [r]: i };
28
- }, {});
29
- export {
30
- c as Primitive
31
- };
@@ -1,9 +0,0 @@
1
- function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
2
- return function(s) {
3
- if (f == null || f(s), p === !1 || !s.defaultPrevented)
4
- return c == null ? void 0 : c(s);
5
- };
6
- }
7
- export {
8
- h as composeEventHandlers
9
- };
@@ -1,14 +0,0 @@
1
- import * as e from "react";
2
- function c(o, n) {
3
- typeof o == "function" ? o(n) : o != null && (o.current = n);
4
- }
5
- function u(...o) {
6
- return (n) => o.forEach((t) => c(t, n));
7
- }
8
- function i(...o) {
9
- return e.useCallback(u(...o), o);
10
- }
11
- export {
12
- u as composeRefs,
13
- i as useComposedRefs
14
- };
@@ -1,52 +0,0 @@
1
- import * as i from "react";
2
- import { jsx as _ } from "react/jsx-runtime";
3
- function P(t, x = []) {
4
- let o = [];
5
- function f(u, e) {
6
- const n = i.createContext(e), r = o.length;
7
- o = [...o, e];
8
- function m(a) {
9
- const { scope: c, children: C, ...p } = a, d = (c == null ? void 0 : c[t][r]) || n, v = i.useMemo(() => p, Object.values(p));
10
- return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
11
- }
12
- function S(a, c) {
13
- const C = (c == null ? void 0 : c[t][r]) || n, p = i.useContext(C);
14
- if (p) return p;
15
- if (e !== void 0) return e;
16
- throw new Error(`\`${a}\` must be used within \`${u}\``);
17
- }
18
- return m.displayName = u + "Provider", [m, S];
19
- }
20
- const s = () => {
21
- const u = o.map((e) => i.createContext(e));
22
- return function(n) {
23
- const r = (n == null ? void 0 : n[t]) || u;
24
- return i.useMemo(
25
- () => ({ [`__scope${t}`]: { ...n, [t]: r } }),
26
- [n, r]
27
- );
28
- };
29
- };
30
- return s.scopeName = t, [f, h(s, ...x)];
31
- }
32
- function h(...t) {
33
- const x = t[0];
34
- if (t.length === 1) return x;
35
- const o = () => {
36
- const f = t.map((s) => ({
37
- useScope: s(),
38
- scopeName: s.scopeName
39
- }));
40
- return function(u) {
41
- const e = f.reduce((n, { useScope: r, scopeName: m }) => {
42
- const a = r(u)[`__scope${m}`];
43
- return { ...n, ...a };
44
- }, {});
45
- return i.useMemo(() => ({ [`__scope${x.scopeName}`]: e }), [e]);
46
- };
47
- };
48
- return o.scopeName = x.scopeName, o;
49
- }
50
- export {
51
- P as createContextScope
52
- };
@@ -1,13 +0,0 @@
1
- import * as f from "react";
2
- import { useLayoutEffect as a } from "../../react-use-layout-effect/dist/index.js";
3
- var e = f.useId || (() => {
4
- }), r = 0;
5
- function i(o) {
6
- const [u, s] = f.useState(e());
7
- return a(() => {
8
- o || s((t) => t != null ? t : String(r++));
9
- }, [o]), o || (u ? `radix-${u}` : "");
10
- }
11
- export {
12
- i as useId
13
- };
@@ -1,31 +0,0 @@
1
- import * as f from "react";
2
- import "react-dom";
3
- import { Slot as n } from "../../react-slot/dist/index.js";
4
- import { jsx as s } from "react/jsx-runtime";
5
- var d = [
6
- "a",
7
- "button",
8
- "div",
9
- "form",
10
- "h2",
11
- "h3",
12
- "img",
13
- "input",
14
- "label",
15
- "li",
16
- "nav",
17
- "ol",
18
- "p",
19
- "span",
20
- "svg",
21
- "ul"
22
- ], c = d.reduce((o, r) => {
23
- const i = f.forwardRef((t, e) => {
24
- const { asChild: m, ...a } = t, p = m ? n : r;
25
- return typeof window != "undefined" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(p, { ...a, ref: e });
26
- });
27
- return i.displayName = `Primitive.${r}`, { ...o, [r]: i };
28
- }, {});
29
- export {
30
- c as Primitive
31
- };
@@ -1,48 +0,0 @@
1
- import * as l from "react";
2
- import { composeRefs as u } from "../../react-compose-refs/dist/index.js";
3
- import { jsx as c, Fragment as d } from "react/jsx-runtime";
4
- var m = l.forwardRef((e, n) => {
5
- const { children: r, ...t } = e, o = l.Children.toArray(r), i = o.find(y);
6
- if (i) {
7
- const s = i.props.children, a = o.map((p) => p === i ? l.Children.count(s) > 1 ? l.Children.only(null) : l.isValidElement(s) ? s.props.children : null : p);
8
- return /* @__PURE__ */ c(f, { ...t, ref: n, children: l.isValidElement(s) ? l.cloneElement(s, void 0, a) : null });
9
- }
10
- return /* @__PURE__ */ c(f, { ...t, ref: n, children: r });
11
- });
12
- m.displayName = "Slot";
13
- var f = l.forwardRef((e, n) => {
14
- const { children: r, ...t } = e;
15
- if (l.isValidElement(r)) {
16
- const o = C(r);
17
- return l.cloneElement(r, {
18
- ...h(t, r.props),
19
- // @ts-ignore
20
- ref: n ? u(n, o) : o
21
- });
22
- }
23
- return l.Children.count(r) > 1 ? l.Children.only(null) : null;
24
- });
25
- f.displayName = "SlotClone";
26
- var g = ({ children: e }) => /* @__PURE__ */ c(d, { children: e });
27
- function y(e) {
28
- return l.isValidElement(e) && e.type === g;
29
- }
30
- function h(e, n) {
31
- const r = { ...n };
32
- for (const t in n) {
33
- const o = e[t], i = n[t];
34
- /^on[A-Z]/.test(t) ? o && i ? r[t] = (...a) => {
35
- i(...a), o(...a);
36
- } : o && (r[t] = o) : t === "style" ? r[t] = { ...o, ...i } : t === "className" && (r[t] = [o, i].filter(Boolean).join(" "));
37
- }
38
- return { ...e, ...r };
39
- }
40
- function C(e) {
41
- var t, o;
42
- let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning;
43
- return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
44
- }
45
- export {
46
- m as Slot,
47
- g as Slottable
48
- };
@@ -1,13 +0,0 @@
1
- import * as r from "react";
2
- function o(t) {
3
- const e = r.useRef(t);
4
- return r.useEffect(() => {
5
- e.current = t;
6
- }), r.useMemo(() => (...n) => {
7
- var u;
8
- return (u = e.current) == null ? void 0 : u.call(e, ...n);
9
- }, []);
10
- }
11
- export {
12
- o as useCallbackRef
13
- };
@@ -1,32 +0,0 @@
1
- import * as l from "react";
2
- import { useCallbackRef as f } from "../../react-use-callback-ref/dist/index.js";
3
- function R({
4
- prop: t,
5
- defaultProp: r,
6
- onChange: s = () => {
7
- }
8
- }) {
9
- const [e, n] = v({ defaultProp: r, onChange: s }), o = t !== void 0, i = o ? t : e, u = f(s), d = l.useCallback(
10
- (c) => {
11
- if (o) {
12
- const a = typeof c == "function" ? c(t) : c;
13
- a !== t && u(a);
14
- } else
15
- n(c);
16
- },
17
- [o, t, n, u]
18
- );
19
- return [i, d];
20
- }
21
- function v({
22
- defaultProp: t,
23
- onChange: r
24
- }) {
25
- const s = l.useState(t), [e] = s, n = l.useRef(e), o = f(r);
26
- return l.useEffect(() => {
27
- n.current !== e && (o(e), n.current = e);
28
- }, [e, n, o]), s;
29
- }
30
- export {
31
- R as useControllableState
32
- };
@@ -1,6 +0,0 @@
1
- import * as e from "react";
2
- var o = globalThis != null && globalThis.document ? e.useLayoutEffect : () => {
3
- };
4
- export {
5
- o as useLayoutEffect
6
- };
@@ -1,14 +0,0 @@
1
- import * as e from "react";
2
- function c(o, n) {
3
- typeof o == "function" ? o(n) : o != null && (o.current = n);
4
- }
5
- function u(...o) {
6
- return (n) => o.forEach((t) => c(t, n));
7
- }
8
- function i(...o) {
9
- return e.useCallback(u(...o), o);
10
- }
11
- export {
12
- u as composeRefs,
13
- i as useComposedRefs
14
- };