@cfx-dev/ui-components 0.0.23 → 0.0.24

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/main.d.ts CHANGED
@@ -6,9 +6,11 @@ export { noop, returnTrue, returnFalse, identity, invoke, } from './utils/functi
6
6
  export { isExternalUrl, matchLinks, matchLinkNodes, defaultLinkReplacerx, defaultLinkReplacer, linkifyx, linkify, Linkify, } from './utils/links';
7
7
  export { clamp01, clamp, } from './utils/math';
8
8
  export { unicodeCharAt, splitByIndices, replaceRange, normalizeSlashes, isTrueString, isFalseString, } from './utils/string';
9
+ export { debounce, throttle, } from './utils/execution';
9
10
  export type { ValueOrGetter } from './utils/getValue';
10
11
  export type { ILinkSubstitute, ILinkMatch, LinkifyProps, } from './utils/links';
11
12
  export type { OutletPosition } from './utils/hooks';
13
+ export type { SetTimeoutReturn } from './utils/execution';
12
14
  export { Checkbox } from './components/Checkbox/Checkbox';
13
15
  export { Button } from './components/Button/Button';
14
16
  export { LinkButton } from './components/Button/LinkButton';
package/dist/main.js CHANGED
@@ -3,133 +3,135 @@ import { clsx as p } from "./utils/clsx.js";
3
3
  import { getValue as m } from "./utils/getValue.js";
4
4
  import { useDynamicRef as a, useGlobalKeyboardEvent as l, useInstance as n, useKeyboardClose as i, useOutlet as s, useWindowResize as u } from "./utils/hooks.js";
5
5
  import { identity as d, invoke as T, noop as I, returnFalse as L, returnTrue as S } from "./utils/functional.js";
6
- import { Linkify as B, defaultLinkReplacer as k, defaultLinkReplacerx as R, isExternalUrl as O, linkify as b, linkifyx as g, matchLinkNodes as D, matchLinks as h } from "./utils/links.js";
6
+ import { Linkify as B, defaultLinkReplacer as k, defaultLinkReplacerx as R, isExternalUrl as b, linkify as O, linkifyx as g, matchLinkNodes as h, matchLinks as D } from "./utils/links.js";
7
7
  import { clamp as E, clamp01 as P } from "./utils/math.js";
8
8
  import { isFalseString as v, isTrueString as F, normalizeSlashes as U, replaceRange as A, splitByIndices as z, unicodeCharAt as K } from "./utils/string.js";
9
- import { Checkbox as w } from "./components/Checkbox/Checkbox.js";
10
- import { Button as Y } from "./components/Button/Button.js";
11
- import { LinkButton as M } from "./components/Button/LinkButton.js";
12
- import { ButtonBar as j } from "./components/Button/ButtonBar.js";
13
- import { Avatar as H } from "./components/Avatar/Avatar.js";
14
- import { BACKDROP_OUTLET_ID as Q, BackdropPortal as X } from "./components/BackdropPortal/BackdropPortal.js";
15
- import { Badge as $ } from "./components/Badge/Badge.js";
16
- import { ControlBox as or } from "./components/ControlBox/ControlBox.js";
17
- import { CountryFlag as tr } from "./components/CountryFlag/CountryFlag.js";
18
- import { Decorate as xr } from "./components/Decorate/Decorate.js";
19
- import { Dot as fr } from "./components/Dot/Dot.js";
20
- import { FLYOUT_OUTLET_ID as lr, Flyout as nr } from "./components/Flyout/Flyout.js";
21
- import { Icon as sr } from "./components/Icon/Icon.js";
22
- import { Indicator as cr } from "./components/Indicator/Indicator.js";
23
- import { InfoPanel as Tr } from "./components/InfoPanel/InfoPanel.js";
24
- import { Input as Lr } from "./components/Input/Input.js";
25
- import { RichInput as yr } from "./components/Input/RichInput.js";
26
- import { Interactive as kr } from "./components/Interactive/Interactive.js";
27
- import { Island as Or } from "./components/Island/Island.js";
28
- import { Box as gr } from "./components/Layout/Box/Box.js";
29
- import { Center as hr } from "./components/Layout/Center/Center.js";
30
- import { Flex as Er } from "./components/Layout/Flex/Flex.js";
31
- import { FlexRestricter as _r } from "./components/Layout/Flex/FlexRestricter.js";
32
- import { Pad as Fr } from "./components/Layout/Pad/Pad.js";
33
- import { Page as Ar } from "./components/Layout/Page/Page.js";
34
- import { Scrollable as Kr } from "./components/Layout/Scrollable/Scrollable.js";
35
- import { VirtualScrollable as wr } from "./components/Layout/Scrollable/VirtualScrollable.js";
36
- import { Loaf as Yr } from "./components/Loaf/Loaf.js";
37
- import { Modal as Mr } from "./components/Modal/Modal.js";
38
- import { NavList as jr } from "./components/NavList/NavList.js";
39
- import { OVERLAY_OUTLET_ID as Hr, Overlay as Jr } from "./components/Overlay/Overlay.js";
40
- import { Popover as Xr } from "./components/Popover/Popover.js";
41
- import { PremiumBadge as $r } from "./components/PremiumBadge/PremiumBadge.js";
42
- import { Prose as oo } from "./components/Prose/Prose.js";
43
- import { Radio as to } from "./components/Radio/Radio.js";
44
- import { Select as xo } from "./components/Select/Select.js";
45
- import { Separator as fo } from "./components/Separator/Separator.js";
46
- import { Shroud as lo } from "./components/Shroud/Shroud.js";
47
- import { Spacer as io } from "./components/Spacer/Spacer.js";
48
- import { Style as uo, useContextualStyle as co } from "./components/Style/Style.js";
49
- import { Switch as Io } from "./components/Switch/Switch.js";
50
- import { Tabular as So } from "./components/Tabular/Tabular.js";
51
- import { Table as Bo } from "./components/Table/Table.js";
52
- import { Text as Ro, TextBlock as Oo } from "./components/Text/Text.js";
53
- import { Textarea as go } from "./components/Textarea/Textarea.js";
54
- import { TITLE_OUTLET_ID as ho, Title as Co } from "./components/Title/Title.js";
55
- import { InputDropzone as Po } from "./components/InputDropzone/InputDropzone.js";
56
- import { B as vo, I as Fo } from "./Icons-BlBKvJD8.js";
57
- import { OnScreenSensor as Ao } from "./components/OnScreenSensor.js";
58
- import { ui as Ko } from "./components/ui.js";
59
- import { Symbols as wo } from "./components/Symbols.js";
9
+ import { debounce as w, throttle as N } from "./utils/execution.js";
10
+ import { Checkbox as G } from "./components/Checkbox/Checkbox.js";
11
+ import { Button as W } from "./components/Button/Button.js";
12
+ import { LinkButton as q } from "./components/Button/LinkButton.js";
13
+ import { ButtonBar as J } from "./components/Button/ButtonBar.js";
14
+ import { Avatar as X } from "./components/Avatar/Avatar.js";
15
+ import { BACKDROP_OUTLET_ID as $, BackdropPortal as oo } from "./components/BackdropPortal/BackdropPortal.js";
16
+ import { Badge as eo } from "./components/Badge/Badge.js";
17
+ import { ControlBox as po } from "./components/ControlBox/ControlBox.js";
18
+ import { CountryFlag as mo } from "./components/CountryFlag/CountryFlag.js";
19
+ import { Decorate as ao } from "./components/Decorate/Decorate.js";
20
+ import { Dot as no } from "./components/Dot/Dot.js";
21
+ import { FLYOUT_OUTLET_ID as so, Flyout as uo } from "./components/Flyout/Flyout.js";
22
+ import { Icon as To } from "./components/Icon/Icon.js";
23
+ import { Indicator as Lo } from "./components/Indicator/Indicator.js";
24
+ import { InfoPanel as yo } from "./components/InfoPanel/InfoPanel.js";
25
+ import { Input as ko } from "./components/Input/Input.js";
26
+ import { RichInput as bo } from "./components/Input/RichInput.js";
27
+ import { Interactive as go } from "./components/Interactive/Interactive.js";
28
+ import { Island as Do } from "./components/Island/Island.js";
29
+ import { Box as Eo } from "./components/Layout/Box/Box.js";
30
+ import { Center as _o } from "./components/Layout/Center/Center.js";
31
+ import { Flex as Fo } from "./components/Layout/Flex/Flex.js";
32
+ import { FlexRestricter as Ao } from "./components/Layout/Flex/FlexRestricter.js";
33
+ import { Pad as Ko } from "./components/Layout/Pad/Pad.js";
34
+ import { Page as wo } from "./components/Layout/Page/Page.js";
35
+ import { Scrollable as Yo } from "./components/Layout/Scrollable/Scrollable.js";
36
+ import { VirtualScrollable as Mo } from "./components/Layout/Scrollable/VirtualScrollable.js";
37
+ import { Loaf as jo } from "./components/Loaf/Loaf.js";
38
+ import { Modal as Ho } from "./components/Modal/Modal.js";
39
+ import { NavList as Qo } from "./components/NavList/NavList.js";
40
+ import { OVERLAY_OUTLET_ID as Zo, Overlay as $o } from "./components/Overlay/Overlay.js";
41
+ import { Popover as rr } from "./components/Popover/Popover.js";
42
+ import { PremiumBadge as tr } from "./components/PremiumBadge/PremiumBadge.js";
43
+ import { Prose as xr } from "./components/Prose/Prose.js";
44
+ import { Radio as fr } from "./components/Radio/Radio.js";
45
+ import { Select as lr } from "./components/Select/Select.js";
46
+ import { Separator as ir } from "./components/Separator/Separator.js";
47
+ import { Shroud as ur } from "./components/Shroud/Shroud.js";
48
+ import { Spacer as dr } from "./components/Spacer/Spacer.js";
49
+ import { Style as Ir, useContextualStyle as Lr } from "./components/Style/Style.js";
50
+ import { Switch as yr } from "./components/Switch/Switch.js";
51
+ import { Tabular as kr } from "./components/Tabular/Tabular.js";
52
+ import { Table as br } from "./components/Table/Table.js";
53
+ import { Text as gr, TextBlock as hr } from "./components/Text/Text.js";
54
+ import { Textarea as Cr } from "./components/Textarea/Textarea.js";
55
+ import { TITLE_OUTLET_ID as Pr, Title as _r } from "./components/Title/Title.js";
56
+ import { InputDropzone as Fr } from "./components/InputDropzone/InputDropzone.js";
57
+ import { B as Ar, I as zr } from "./Icons-BlBKvJD8.js";
58
+ import { OnScreenSensor as Vr } from "./components/OnScreenSensor.js";
59
+ import { ui as Nr } from "./components/ui.js";
60
+ import { Symbols as Gr } from "./components/Symbols.js";
60
61
  export {
61
- H as Avatar,
62
- Q as BACKDROP_OUTLET_ID,
63
- X as BackdropPortal,
64
- $ as Badge,
65
- gr as Box,
66
- vo as BrandIcon,
67
- Y as Button,
68
- j as ButtonBar,
69
- hr as Center,
70
- w as Checkbox,
71
- or as ControlBox,
72
- tr as CountryFlag,
73
- xr as Decorate,
74
- fr as Dot,
75
- lr as FLYOUT_OUTLET_ID,
76
- Er as Flex,
77
- _r as FlexRestricter,
78
- nr as Flyout,
79
- sr as Icon,
80
- Fo as Icons,
81
- cr as Indicator,
82
- Tr as InfoPanel,
83
- Lr as Input,
84
- Po as InputDropzone,
85
- kr as Interactive,
86
- Or as Island,
87
- M as LinkButton,
62
+ X as Avatar,
63
+ $ as BACKDROP_OUTLET_ID,
64
+ oo as BackdropPortal,
65
+ eo as Badge,
66
+ Eo as Box,
67
+ Ar as BrandIcon,
68
+ W as Button,
69
+ J as ButtonBar,
70
+ _o as Center,
71
+ G as Checkbox,
72
+ po as ControlBox,
73
+ mo as CountryFlag,
74
+ ao as Decorate,
75
+ no as Dot,
76
+ so as FLYOUT_OUTLET_ID,
77
+ Fo as Flex,
78
+ Ao as FlexRestricter,
79
+ uo as Flyout,
80
+ To as Icon,
81
+ zr as Icons,
82
+ Lo as Indicator,
83
+ yo as InfoPanel,
84
+ ko as Input,
85
+ Fr as InputDropzone,
86
+ go as Interactive,
87
+ Do as Island,
88
+ q as LinkButton,
88
89
  B as Linkify,
89
- Yr as Loaf,
90
- Mr as Modal,
91
- jr as NavList,
92
- Hr as OVERLAY_OUTLET_ID,
93
- Ao as OnScreenSensor,
94
- Jr as Overlay,
95
- Fr as Pad,
96
- Ar as Page,
97
- Xr as Popover,
98
- $r as PremiumBadge,
99
- oo as Prose,
100
- to as Radio,
101
- yr as RichInput,
102
- Kr as Scrollable,
103
- xo as Select,
104
- fo as Separator,
105
- lo as Shroud,
106
- io as Spacer,
107
- uo as Style,
108
- Io as Switch,
109
- wo as Symbols,
110
- ho as TITLE_OUTLET_ID,
111
- Bo as Table,
112
- So as Tabular,
113
- Ro as Text,
114
- Oo as TextBlock,
115
- go as Textarea,
116
- Co as Title,
117
- wr as VirtualScrollable,
90
+ jo as Loaf,
91
+ Ho as Modal,
92
+ Qo as NavList,
93
+ Zo as OVERLAY_OUTLET_ID,
94
+ Vr as OnScreenSensor,
95
+ $o as Overlay,
96
+ Ko as Pad,
97
+ wo as Page,
98
+ rr as Popover,
99
+ tr as PremiumBadge,
100
+ xr as Prose,
101
+ fr as Radio,
102
+ bo as RichInput,
103
+ Yo as Scrollable,
104
+ lr as Select,
105
+ ir as Separator,
106
+ ur as Shroud,
107
+ dr as Spacer,
108
+ Ir as Style,
109
+ yr as Switch,
110
+ Gr as Symbols,
111
+ Pr as TITLE_OUTLET_ID,
112
+ br as Table,
113
+ kr as Tabular,
114
+ gr as Text,
115
+ hr as TextBlock,
116
+ Cr as Textarea,
117
+ _r as Title,
118
+ Mo as VirtualScrollable,
118
119
  E as clamp,
119
120
  P as clamp01,
120
121
  p as clsx,
122
+ w as debounce,
121
123
  k as defaultLinkReplacer,
122
124
  R as defaultLinkReplacerx,
123
125
  m as getValue,
124
126
  d as identity,
125
127
  T as invoke,
126
- O as isExternalUrl,
128
+ b as isExternalUrl,
127
129
  v as isFalseString,
128
130
  F as isTrueString,
129
- b as linkify,
131
+ O as linkify,
130
132
  g as linkifyx,
131
- D as matchLinkNodes,
132
- h as matchLinks,
133
+ h as matchLinkNodes,
134
+ D as matchLinks,
133
135
  e as mergeRefs,
134
136
  I as noop,
135
137
  U as normalizeSlashes,
@@ -137,9 +139,10 @@ export {
137
139
  L as returnFalse,
138
140
  S as returnTrue,
139
141
  z as splitByIndices,
140
- Ko as ui,
142
+ N as throttle,
143
+ Nr as ui,
141
144
  K as unicodeCharAt,
142
- co as useContextualStyle,
145
+ Lr as useContextualStyle,
143
146
  a as useDynamicRef,
144
147
  l as useGlobalKeyboardEvent,
145
148
  n as useInstance,
@@ -0,0 +1,3 @@
1
+ export type SetTimeoutReturn = ReturnType<typeof setTimeout>;
2
+ export declare function debounce<A extends unknown[]>(fn: (...args: A) => void, time: number): (...args: A) => void;
3
+ export declare function throttle<A extends unknown[]>(fn: (...args: A) => void, time: number): (...args: A) => void;
@@ -0,0 +1,20 @@
1
+ function n(e, l) {
2
+ let t = null;
3
+ return (...u) => {
4
+ t !== null && clearTimeout(t), t = setTimeout(() => {
5
+ t = null, e(...u);
6
+ }, l);
7
+ };
8
+ }
9
+ function r(e, l) {
10
+ let t = null;
11
+ return (...u) => {
12
+ t === null && (t = setTimeout(() => {
13
+ t = null;
14
+ }, l), e(...u));
15
+ };
16
+ }
17
+ export {
18
+ n as debounce,
19
+ r as throttle
20
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "0.0.23",
4
+ "version": "0.0.24",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",