@wrdagency/blockout 1.0.19 → 1.0.21

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.
@@ -1,6 +1,7 @@
1
1
  import { Optionable } from '../../../types/options';
2
2
  import { HTMLInputAutoCompleteAttribute, ReactNode } from 'react';
3
3
  export type SelectProps<T extends string = string> = {
4
+ className?: string;
4
5
  id?: string;
5
6
  value?: T;
6
7
  onChangeValue?: (value: T) => void;
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { SelectProps } from './props';
3
- export declare const Select: <T extends string = string>({ value, onChangeValue, options: unnormalizedOptions, searchable, combobox, placeholder, prefix, suffix, children, withIcon, ...restControlProps }: SelectProps<T> & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Select: <T extends string = string>({ className, value, onChangeValue, options: unnormalizedOptions, searchable, combobox, placeholder, prefix, suffix, children, withIcon, ...restControlProps }: SelectProps<T> & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1,76 +1,79 @@
1
1
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
- import { cn as V } from "../../../utils/css.js";
2
+ import { cn as L } from "../../../utils/css.js";
3
3
  import '../../../assets/style16.css';import '../../../assets/styles.css';import '../../../assets/style6.css';import '../../../assets/style5.css';import '../../../assets/style4.css';import '../../../assets/style3.css';import '../../../assets/style2.css';import '../../../assets/style.css';import '../../../assets/style10.css';import '../../../assets/style7.css';/* empty css */
4
- import { noop as x } from "../../../utils/noop.js";
5
- import { useState as _, useMemo as L, startTransition as g } from "react";
4
+ import { noop as g } from "../../../utils/noop.js";
5
+ import { useState as _, useMemo as j, startTransition as y } from "react";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  import "../../../primitives/popover/index.js";
10
10
  /* empty css */
11
- import { ScrollArea as j } from "../../../primitives/scroll-area/index.js";
11
+ import { ScrollArea as k } from "../../../primitives/scroll-area/index.js";
12
12
  import "../../../primitives/symbol/index.js";
13
13
  /* empty css */
14
14
  /* empty css */
15
15
  /* empty css */
16
16
  /* empty css */
17
- import { normalizeOption as y } from "../../../types/options.js";
18
- import { s as k } from "../../../MagnifyingGlass.es-CLstwG_v.js";
19
- import { m as z } from "../../../match-sorter.esm-MNVE8H_6.js";
17
+ import { normalizeOption as z } from "../../../types/options.js";
18
+ import { s as A } from "../../../MagnifyingGlass.es-CLstwG_v.js";
19
+ import { m as H } from "../../../match-sorter.esm-MNVE8H_6.js";
20
20
  /* empty css */
21
- import { C as A, a as h, b as H, c as M, d as f } from "../../../combobox-popover-DFcT6u90.js";
22
- import { S as T, a as $, b as q, c as B, d as D } from "../../../select-popover-BuB2Ioa9.js";
23
- const fe = ({
21
+ import { C as M, a as h, b as T, c as $, d as f } from "../../../combobox-popover-DFcT6u90.js";
22
+ import { S as q, a as B, b as D, c as E, d as F } from "../../../select-popover-BuB2Ioa9.js";
23
+ const ue = ({
24
+ className: u,
24
25
  value: r,
25
- onChangeValue: p = x,
26
- options: u,
26
+ onChangeValue: p = g,
27
+ options: v,
27
28
  searchable: i = !1,
28
29
  combobox: t = !1,
29
- placeholder: E = "Choose an option...",
30
- prefix: F,
31
- suffix: G,
32
- children: v,
33
- withIcon: J,
34
- ...S
30
+ placeholder: S = "Choose an option...",
31
+ prefix: G,
32
+ suffix: J,
33
+ children: N,
34
+ withIcon: K,
35
+ ...P
35
36
  }) => {
36
37
  t && (i = !0);
37
- const [c, l] = _(!1), [n, N] = _(""), a = (u || []).map(y), m = L(() => z(a, n, {
38
- baseSort: (e, I) => e.index < I.index ? -1 : 1,
38
+ const [n, a] = _(!1), [c, O] = _(""), l = (v || []).map(z), m = j(() => H(l, c, {
39
+ baseSort: (e, x) => e.index < x.index ? -1 : 1,
39
40
  keys: ["label", "description"]
40
- }), [n]), P = i || t ? M : B, O = t ? f : D, w = t ? h : $, C = t ? H : q, d = !!!a.find((e) => e.value === r);
41
+ }), [c]), w = i || t ? $ : E, C = t ? f : F, I = t ? h : B, V = t ? T : D, d = !!!l.find((e) => e.value === r);
41
42
  return /* @__PURE__ */ o(
42
- A,
43
+ M,
43
44
  {
44
45
  resetValueOnHide: !t,
45
- open: c,
46
- setOpen: l,
47
- value: t ? r : n,
46
+ open: n,
47
+ setOpen: a,
48
+ value: t ? r : c,
48
49
  setValue: (e) => {
49
- t && p(e), g(() => {
50
- N(e);
50
+ t && p(e), y(() => {
51
+ O(e);
51
52
  });
52
53
  },
53
54
  children: /* @__PURE__ */ s(
54
- T,
55
+ q,
55
56
  {
56
57
  value: d ? "" : r,
57
58
  setValue: p,
58
- open: c,
59
- setOpen: l,
59
+ open: n,
60
+ setOpen: a,
60
61
  children: [
61
62
  /* @__PURE__ */ o(
62
- w,
63
+ I,
63
64
  {
64
- className: V(
65
+ className: L(
66
+ u,
65
67
  "component-select__input",
66
68
  d && "component-select__input--placeholder"
67
69
  ),
68
- children: t ? void 0 : v,
69
- ...S
70
+ children: t ? void 0 : N,
71
+ placeholder: S,
72
+ ...P
70
73
  }
71
74
  ),
72
- c && m.length > 0 && /* @__PURE__ */ o(
73
- C,
75
+ n && m.length > 0 && /* @__PURE__ */ o(
76
+ V,
74
77
  {
75
78
  className: "component-select__popover",
76
79
  "data-colour-scheme": "invert",
@@ -81,9 +84,9 @@ const fe = ({
81
84
  gutter: 8,
82
85
  overflowPadding: 4,
83
86
  shift: -1,
84
- children: /* @__PURE__ */ s(j, { className: "component-select__popover__scroll", axis: "y", children: [
87
+ children: /* @__PURE__ */ s(k, { className: "component-select__popover__scroll", axis: "y", children: [
85
88
  i && !t && /* @__PURE__ */ s("div", { className: "component-select__popover__search-wrapper", children: [
86
- /* @__PURE__ */ o(k, { className: "component-select__popover__search-icon" }),
89
+ /* @__PURE__ */ o(A, { className: "component-select__popover__search-icon" }),
87
90
  /* @__PURE__ */ o(
88
91
  h,
89
92
  {
@@ -93,8 +96,8 @@ const fe = ({
93
96
  }
94
97
  )
95
98
  ] }),
96
- /* @__PURE__ */ o(P, { className: "component-select__list", children: m.map((e) => /* @__PURE__ */ s(
97
- O,
99
+ /* @__PURE__ */ o(w, { className: "component-select__list", children: m.map((e) => /* @__PURE__ */ s(
100
+ C,
98
101
  {
99
102
  disabled: e.disabled,
100
103
  value: e.value,
@@ -120,5 +123,5 @@ const fe = ({
120
123
  );
121
124
  };
122
125
  export {
123
- fe as Select
126
+ ue as Select
124
127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrdagency/blockout",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "A React component library created by WRD.agency",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",