@umami/react-zen 0.90.0 → 0.91.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.
package/dist/index.css CHANGED
@@ -4160,7 +4160,7 @@ body a.Button_button__NDYwM {
4160
4160
  }
4161
4161
 
4162
4162
  /* virtual-css:css:851dd5366a20c382ffec60997ee93e35 */
4163
- .Select_button__ZGY1Y {
4163
+ .Select_button__MWY5Z {
4164
4164
  display: flex;
4165
4165
  align-items: center;
4166
4166
  font-size: var(--font-size);
@@ -4172,7 +4172,10 @@ body a.Button_button__NDYwM {
4172
4172
  background: var(--background-color);
4173
4173
  cursor: pointer;
4174
4174
  }
4175
- .Select_popover__MTQ1Y {
4175
+ .Select_list__ODI4M {
4176
+ padding: var(--spacing-2);
4177
+ }
4178
+ .Select_popover__ZDNlZ {
4176
4179
  min-width: 200px;
4177
4180
  border: var(--border);
4178
4181
  border-radius: var(--border-radius);
@@ -4180,25 +4183,22 @@ body a.Button_button__NDYwM {
4180
4183
  background: var(--background-color);
4181
4184
  overflow: hidden;
4182
4185
  }
4183
- .Select_list__MDYyZ > * {
4184
- border-radius: 0;
4185
- }
4186
- .Select_icon__N2M0O {
4186
+ .Select_icon__ZGNhZ {
4187
4187
  color: var(--font-color-disabled);
4188
4188
  }
4189
- .Select_icon__N2M0O:hover {
4189
+ .Select_icon__ZGNhZ:hover {
4190
4190
  color: var(--font-color);
4191
4191
  cursor: pointer;
4192
4192
  }
4193
- .Select_search__MWQwM {
4193
+ .Select_search__NGY0O {
4194
4194
  border-bottom: var(--border);
4195
4195
  outline: none;
4196
4196
  }
4197
- .Select_search__MWQwM input {
4197
+ .Select_search__NGY0O input {
4198
4198
  border: 0;
4199
4199
  box-shadow: none;
4200
4200
  }
4201
- .Select_search__MWQwM input[data-focused] {
4201
+ .Select_search__NGY0O input[data-focused] {
4202
4202
  outline: none;
4203
4203
  }
4204
4204
 
package/dist/index.d.ts CHANGED
@@ -776,6 +776,7 @@ declare module '@umami/react-zen/Select' {
776
776
  label?: string;
777
777
  isLoading?: boolean;
778
778
  allowSearch?: boolean;
779
+ searchValue?: string;
779
780
  searchDelay?: number;
780
781
  onSearch?: (value: string) => void;
781
782
  onChange?: (e: any) => void;
package/dist/index.js CHANGED
@@ -40,12 +40,12 @@ var require_use_sync_external_store_shim_production = __commonJS({
40
40
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
41
41
  }
42
42
  var objectIs = "function" === typeof Object.is ? Object.is : is2;
43
- var useState17 = React7.useState;
43
+ var useState18 = React7.useState;
44
44
  var useEffect13 = React7.useEffect;
45
45
  var useLayoutEffect2 = React7.useLayoutEffect;
46
46
  var useDebugValue = React7.useDebugValue;
47
47
  function useSyncExternalStore$2(subscribe, getSnapshot) {
48
- var value = getSnapshot(), _useState = useState17({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
48
+ var value = getSnapshot(), _useState = useState18({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
49
49
  useLayoutEffect2(
50
50
  function() {
51
51
  inst.value = value;
@@ -103,7 +103,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
103
103
  "The result of getSnapshot should be cached to avoid an infinite loop"
104
104
  ), didWarnUncachedGetSnapshot = true);
105
105
  }
106
- cachedValue = useState17({
106
+ cachedValue = useState18({
107
107
  inst: { value, getSnapshot }
108
108
  });
109
109
  var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
@@ -141,7 +141,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
141
141
  return getSnapshot();
142
142
  }
143
143
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
144
- var React7 = import_react195.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState17 = React7.useState, useEffect13 = React7.useEffect, useLayoutEffect2 = React7.useLayoutEffect, useDebugValue = React7.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
144
+ var React7 = import_react195.default, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React7.useState, useEffect13 = React7.useEffect, useLayoutEffect2 = React7.useLayoutEffect, useDebugValue = React7.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
145
145
  exports.useSyncExternalStore = void 0 !== React7.useSyncExternalStore ? React7.useSyncExternalStore : shim;
146
146
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
147
147
  })();
@@ -31018,7 +31018,7 @@ var import_react189 = require("react");
31018
31018
  var import_classnames43 = __toESM(require_classnames());
31019
31019
 
31020
31020
  // css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
31021
- var Select_default = { "button": "Select_button__ZGY1Y", "popover": "Select_popover__MTQ1Y", "list": "Select_list__MDYyZ", "icon": "Select_icon__N2M0O", "search": "Select_search__MWQwM" };
31021
+ var Select_default = { "button": "Select_button__MWY5Z", "list": "Select_list__ODI4M", "popover": "Select_popover__ZDNlZ", "icon": "Select_icon__ZGNhZ", "search": "Select_search__NGY0O" };
31022
31022
 
31023
31023
  // src/components/Select.tsx
31024
31024
  var import_jsx_runtime53 = require("react/jsx-runtime");
@@ -31029,6 +31029,7 @@ var Select2 = (0, import_react189.forwardRef)(
31029
31029
  label,
31030
31030
  isLoading,
31031
31031
  allowSearch,
31032
+ searchValue,
31032
31033
  searchDelay,
31033
31034
  onSearch,
31034
31035
  onSelectionChange,
@@ -31040,10 +31041,15 @@ var Select2 = (0, import_react189.forwardRef)(
31040
31041
  children,
31041
31042
  ...props
31042
31043
  }, ref) => {
31044
+ const [search, setSearch] = (0, import_react189.useState)("");
31043
31045
  const handleChange = (e) => {
31044
31046
  onSelectionChange?.(e);
31045
31047
  onChange?.(e);
31046
31048
  };
31049
+ const handleSearch = (value2) => {
31050
+ setSearch(value2);
31051
+ onSearch?.(value2);
31052
+ };
31047
31053
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
31048
31054
  $82d7e5349645de74$export$ef9b1a59e592288f,
31049
31055
  {
@@ -31063,8 +31069,10 @@ var Select2 = (0, import_react189.forwardRef)(
31063
31069
  SearchField2,
31064
31070
  {
31065
31071
  className: Select_default.search,
31066
- onSearch,
31072
+ value: search,
31073
+ onSearch: handleSearch,
31067
31074
  delay: searchDelay,
31075
+ defaultValue: searchValue,
31068
31076
  autoFocus: true
31069
31077
  }
31070
31078
  ),
package/dist/index.mjs CHANGED
@@ -34,12 +34,12 @@ var require_use_sync_external_store_shim_production = __commonJS({
34
34
  return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
35
35
  }
36
36
  var objectIs = "function" === typeof Object.is ? Object.is : is2;
37
- var useState17 = React7.useState;
37
+ var useState18 = React7.useState;
38
38
  var useEffect13 = React7.useEffect;
39
39
  var useLayoutEffect2 = React7.useLayoutEffect;
40
40
  var useDebugValue = React7.useDebugValue;
41
41
  function useSyncExternalStore$2(subscribe, getSnapshot) {
42
- var value = getSnapshot(), _useState = useState17({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
42
+ var value = getSnapshot(), _useState = useState18({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
43
43
  useLayoutEffect2(
44
44
  function() {
45
45
  inst.value = value;
@@ -97,7 +97,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
97
97
  "The result of getSnapshot should be cached to avoid an infinite loop"
98
98
  ), didWarnUncachedGetSnapshot = true);
99
99
  }
100
- cachedValue = useState17({
100
+ cachedValue = useState18({
101
101
  inst: { value, getSnapshot }
102
102
  });
103
103
  var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
@@ -135,7 +135,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
135
135
  return getSnapshot();
136
136
  }
137
137
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
138
- var React7 = __import_react2, objectIs = "function" === typeof Object.is ? Object.is : is2, useState17 = React7.useState, useEffect13 = React7.useEffect, useLayoutEffect2 = React7.useLayoutEffect, useDebugValue = React7.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
138
+ var React7 = __import_react2, objectIs = "function" === typeof Object.is ? Object.is : is2, useState18 = React7.useState, useEffect13 = React7.useEffect, useLayoutEffect2 = React7.useLayoutEffect, useDebugValue = React7.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
139
139
  exports.useSyncExternalStore = void 0 !== React7.useSyncExternalStore ? React7.useSyncExternalStore : shim;
140
140
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
141
141
  })();
@@ -30908,10 +30908,10 @@ var SearchField2 = forwardRef8(
30908
30908
 
30909
30909
  // src/components/Select.tsx
30910
30910
  var import_classnames43 = __toESM(require_classnames());
30911
- import { forwardRef as forwardRef9 } from "react";
30911
+ import { forwardRef as forwardRef9, useState as useState17 } from "react";
30912
30912
 
30913
30913
  // css-modules:E:\dev\umami-react-zen\src\components\Select.module.css
30914
- var Select_default = { "button": "Select_button__ZGY1Y", "popover": "Select_popover__MTQ1Y", "list": "Select_list__MDYyZ", "icon": "Select_icon__N2M0O", "search": "Select_search__MWQwM" };
30914
+ var Select_default = { "button": "Select_button__MWY5Z", "list": "Select_list__ODI4M", "popover": "Select_popover__ZDNlZ", "icon": "Select_icon__ZGNhZ", "search": "Select_search__NGY0O" };
30915
30915
 
30916
30916
  // src/components/Select.tsx
30917
30917
  import { jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
@@ -30922,6 +30922,7 @@ var Select2 = forwardRef9(
30922
30922
  label,
30923
30923
  isLoading,
30924
30924
  allowSearch,
30925
+ searchValue,
30925
30926
  searchDelay,
30926
30927
  onSearch,
30927
30928
  onSelectionChange,
@@ -30933,10 +30934,15 @@ var Select2 = forwardRef9(
30933
30934
  children,
30934
30935
  ...props
30935
30936
  }, ref) => {
30937
+ const [search, setSearch] = useState17("");
30936
30938
  const handleChange = (e) => {
30937
30939
  onSelectionChange?.(e);
30938
30940
  onChange?.(e);
30939
30941
  };
30942
+ const handleSearch = (value2) => {
30943
+ setSearch(value2);
30944
+ onSearch?.(value2);
30945
+ };
30940
30946
  return /* @__PURE__ */ jsxs30(
30941
30947
  $82d7e5349645de74$export$ef9b1a59e592288f,
30942
30948
  {
@@ -30956,8 +30962,10 @@ var Select2 = forwardRef9(
30956
30962
  SearchField2,
30957
30963
  {
30958
30964
  className: Select_default.search,
30959
- onSearch,
30965
+ value: search,
30966
+ onSearch: handleSearch,
30960
30967
  delay: searchDelay,
30968
+ defaultValue: searchValue,
30961
30969
  autoFocus: true
30962
30970
  }
30963
30971
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.90.0",
3
+ "version": "0.91.0",
4
4
  "description": "Modern, minimalist React component library",
5
5
  "author": "Umami <hello@umami.is>",
6
6
  "license": "MIT",
package/styles.css CHANGED
@@ -4476,7 +4476,7 @@ body a.Button_button__NDYwM {
4476
4476
  }
4477
4477
 
4478
4478
  /* virtual-css:css:851dd5366a20c382ffec60997ee93e35 */
4479
- .Select_button__ZGY1Y {
4479
+ .Select_button__MWY5Z {
4480
4480
  display: flex;
4481
4481
  align-items: center;
4482
4482
  font-size: var(--font-size);
@@ -4488,7 +4488,10 @@ body a.Button_button__NDYwM {
4488
4488
  background: var(--background-color);
4489
4489
  cursor: pointer;
4490
4490
  }
4491
- .Select_popover__MTQ1Y {
4491
+ .Select_list__ODI4M {
4492
+ padding: var(--spacing-2);
4493
+ }
4494
+ .Select_popover__ZDNlZ {
4492
4495
  min-width: 200px;
4493
4496
  border: var(--border);
4494
4497
  border-radius: var(--border-radius);
@@ -4496,25 +4499,22 @@ body a.Button_button__NDYwM {
4496
4499
  background: var(--background-color);
4497
4500
  overflow: hidden;
4498
4501
  }
4499
- .Select_list__MDYyZ > * {
4500
- border-radius: 0;
4501
- }
4502
- .Select_icon__N2M0O {
4502
+ .Select_icon__ZGNhZ {
4503
4503
  color: var(--font-color-disabled);
4504
4504
  }
4505
- .Select_icon__N2M0O:hover {
4505
+ .Select_icon__ZGNhZ:hover {
4506
4506
  color: var(--font-color);
4507
4507
  cursor: pointer;
4508
4508
  }
4509
- .Select_search__MWQwM {
4509
+ .Select_search__NGY0O {
4510
4510
  border-bottom: var(--border);
4511
4511
  outline: none;
4512
4512
  }
4513
- .Select_search__MWQwM input {
4513
+ .Select_search__NGY0O input {
4514
4514
  border: 0;
4515
4515
  box-shadow: none;
4516
4516
  }
4517
- .Select_search__MWQwM input[data-focused] {
4517
+ .Select_search__NGY0O input[data-focused] {
4518
4518
  outline: none;
4519
4519
  }
4520
4520