@cfx-dev/ui-components 0.0.17 → 0.0.19

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.
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { ButtonSize, ButtonTheme } from './Button';
3
+
4
+ export interface LinkButtonProps {
5
+ to: string;
6
+ text?: React.ReactNode;
7
+ title?: string;
8
+ icon?: React.ReactNode;
9
+ theme?: ButtonTheme;
10
+ size?: ButtonSize;
11
+ disabled?: boolean;
12
+ onClick?(): void;
13
+ tabIndex?: number;
14
+ className?: string;
15
+ target?: string;
16
+ Component?: React.ElementType;
17
+ decorator?: React.ReactNode;
18
+ }
19
+ export declare const LinkButton: React.ForwardRefExoticComponent<LinkButtonProps & React.RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,48 @@
1
+ import { jsxs as R, jsx as a } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { clsx as j } from "../../utils/clsx.js";
4
+ import { n as B } from "../../functional-C0pE183N.js";
5
+ import { i as E } from "../../links-CgOD-Vfj.js";
6
+ import { s as o } from "../../Button.module-Z6njvP9Z.js";
7
+ const P = l.forwardRef(function(i, c) {
8
+ const {
9
+ to: e,
10
+ text: n = null,
11
+ icon: t = null,
12
+ title: m = "",
13
+ className: d = "",
14
+ theme: f = "default",
15
+ size: p = "normal",
16
+ disabled: u = !1,
17
+ tabIndex: x,
18
+ target: k = "",
19
+ onClick: C = B,
20
+ decorator: s = null,
21
+ Component: h
22
+ } = i, N = j(o.root, o[f], o[p], d, {
23
+ [o.disabled]: u,
24
+ [o.icon]: !!t && !n,
25
+ [o.text]: !!n
26
+ }), r = E(e), b = r ? "a" : h || "a", L = l.useMemo(() => r ? { href: e } : { to: e }, [e, r]);
27
+ return /* @__PURE__ */ R(
28
+ b,
29
+ {
30
+ ref: c,
31
+ className: N,
32
+ tabIndex: x,
33
+ title: m,
34
+ target: k,
35
+ rel: "noopener noreferrer",
36
+ onClickCapture: C,
37
+ ...L,
38
+ children: [
39
+ !!t && /* @__PURE__ */ a("span", { className: o["icon-node"], children: t }),
40
+ n,
41
+ !!s && /* @__PURE__ */ a("div", { className: o.decorator, children: s })
42
+ ]
43
+ }
44
+ );
45
+ });
46
+ export {
47
+ P as LinkButton
48
+ };
package/dist/main.d.ts CHANGED
@@ -8,6 +8,7 @@ import * as links from './utils/links';
8
8
  import * as math from './utils/math';
9
9
  import * as outlet from './utils/outlet';
10
10
  import * as string from './utils/string';
11
+ export type { ValueOrGetter } from './utils/getValue';
11
12
  export declare const utils: {
12
13
  clsx: typeof clsx;
13
14
  getValue: typeof getValue;
@@ -21,6 +22,7 @@ export declare const utils: {
21
22
  };
22
23
  export { Checkbox } from './components/Checkbox/Checkbox';
23
24
  export { Button } from './components/Button/Button';
25
+ export { LinkButton } from './components/Button/LinkButton';
24
26
  export { ButtonBar } from './components/Button/ButtonBar';
25
27
  export { Avatar } from './components/Avatar/Avatar';
26
28
  export { BackdropPortal } from './components/BackdropPortal/BackdropPortal';
package/dist/main.js CHANGED
@@ -8,53 +8,54 @@ import f from "./utils/mergeRefs.js";
8
8
  import { o as x } from "./outlet-B11a3Kgw.js";
9
9
  import { s as a } from "./string-NVxCUbqk.js";
10
10
  import { Checkbox as P } from "./components/Checkbox/Checkbox.js";
11
- import { Button as b } from "./components/Button/Button.js";
12
- import { ButtonBar as v } from "./components/Button/ButtonBar.js";
13
- import { Avatar as T } from "./components/Avatar/Avatar.js";
14
- import { BackdropPortal as R } from "./components/BackdropPortal/BackdropPortal.js";
15
- import { Badge as L } from "./components/Badge/Badge.js";
16
- import { ControlBox as V } from "./components/ControlBox/ControlBox.js";
17
- import { CountryFlag as A } from "./components/CountryFlag/CountryFlag.js";
18
- import { Decorate as N } from "./components/Decorate/Decorate.js";
19
- import { Dot as q } from "./components/Dot/Dot.js";
20
- import { Flyout as E } from "./components/Flyout/Flyout.js";
21
- import { Icon as H } from "./components/Icon/Icon.js";
22
- import { Indicator as K } from "./components/Indicator/Indicator.js";
23
- import { InfoPanel as U } from "./components/InfoPanel/InfoPanel.js";
24
- import { Input as X } from "./components/Input/Input.js";
25
- import { RichInput as Z } from "./components/Input/RichInput.js";
26
- import { Interactive as $ } from "./components/Interactive/Interactive.js";
27
- import { Island as ro } from "./components/Island/Island.js";
28
- import { Box as eo } from "./components/Layout/Box/Box.js";
29
- import { Center as po } from "./components/Layout/Center/Center.js";
30
- import { Flex as xo } from "./components/Layout/Flex/Flex.js";
31
- import { FlexRestricter as lo } from "./components/Layout/Flex/FlexRestricter.js";
32
- import { Pad as io } from "./components/Layout/Pad/Pad.js";
33
- import { Page as co } from "./components/Layout/Page/Page.js";
34
- import { Scrollable as So } from "./components/Layout/Scrollable/Scrollable.js";
35
- import { VirtualScrollable as Io } from "./components/Layout/Scrollable/VirtualScrollable.js";
36
- import { Loaf as ho } from "./components/Loaf/Loaf.js";
37
- import { Modal as yo } from "./components/Modal/Modal.js";
38
- import { NavList as ko } from "./components/NavList/NavList.js";
39
- import { Overlay as Co } from "./components/Overlay/Overlay.js";
40
- import { Popover as Fo } from "./components/Popover/Popover.js";
41
- import { PremiumBadge as Do } from "./components/PremiumBadge/PremiumBadge.js";
42
- import { Prose as Oo } from "./components/Prose/Prose.js";
43
- import { Radio as wo } from "./components/Radio/Radio.js";
44
- import { Select as Mo } from "./components/Select/Select.js";
45
- import { Separator as jo } from "./components/Separator/Separator.js";
46
- import { Shroud as zo } from "./components/Shroud/Shroud.js";
47
- import { Spacer as Go } from "./components/Spacer/Spacer.js";
48
- import { Style as Jo, useContextualStyle as Ko } from "./components/Style/Style.js";
49
- import { Switch as Uo } from "./components/Switch/Switch.js";
50
- import { Tabular as Xo } from "./components/Tabular/Tabular.js";
51
- import { Text as Zo, TextBlock as _o } from "./components/Text/Text.js";
52
- import { Textarea as or } from "./components/Textarea/Textarea.js";
53
- import { Title as tr } from "./components/Title/Title.js";
54
- import { B as mr, I as pr } from "./Icons-B26SczGZ.js";
55
- import { OnScreenSensor as xr } from "./components/OnScreenSensor.js";
56
- import { ui as lr } from "./components/ui.js";
57
- import { Symbols as ir } from "./components/Symbols.js";
11
+ import { Button as y } from "./components/Button/Button.js";
12
+ import { LinkButton as v } from "./components/Button/LinkButton.js";
13
+ import { ButtonBar as T } from "./components/Button/ButtonBar.js";
14
+ import { Avatar as R } from "./components/Avatar/Avatar.js";
15
+ import { BackdropPortal as D } from "./components/BackdropPortal/BackdropPortal.js";
16
+ import { Badge as V } from "./components/Badge/Badge.js";
17
+ import { ControlBox as A } from "./components/ControlBox/ControlBox.js";
18
+ import { CountryFlag as N } from "./components/CountryFlag/CountryFlag.js";
19
+ import { Decorate as q } from "./components/Decorate/Decorate.js";
20
+ import { Dot as E } from "./components/Dot/Dot.js";
21
+ import { Flyout as H } from "./components/Flyout/Flyout.js";
22
+ import { Icon as K } from "./components/Icon/Icon.js";
23
+ import { Indicator as U } from "./components/Indicator/Indicator.js";
24
+ import { InfoPanel as X } from "./components/InfoPanel/InfoPanel.js";
25
+ import { Input as Z } from "./components/Input/Input.js";
26
+ import { RichInput as $ } from "./components/Input/RichInput.js";
27
+ import { Interactive as ro } from "./components/Interactive/Interactive.js";
28
+ import { Island as eo } from "./components/Island/Island.js";
29
+ import { Box as po } from "./components/Layout/Box/Box.js";
30
+ import { Center as xo } from "./components/Layout/Center/Center.js";
31
+ import { Flex as lo } from "./components/Layout/Flex/Flex.js";
32
+ import { FlexRestricter as io } from "./components/Layout/Flex/FlexRestricter.js";
33
+ import { Pad as co } from "./components/Layout/Pad/Pad.js";
34
+ import { Page as Bo } from "./components/Layout/Page/Page.js";
35
+ import { Scrollable as Io } from "./components/Layout/Scrollable/Scrollable.js";
36
+ import { VirtualScrollable as ho } from "./components/Layout/Scrollable/VirtualScrollable.js";
37
+ import { Loaf as ko } from "./components/Loaf/Loaf.js";
38
+ import { Modal as bo } from "./components/Modal/Modal.js";
39
+ import { NavList as Co } from "./components/NavList/NavList.js";
40
+ import { Overlay as Fo } from "./components/Overlay/Overlay.js";
41
+ import { Popover as Lo } from "./components/Popover/Popover.js";
42
+ import { PremiumBadge as Oo } from "./components/PremiumBadge/PremiumBadge.js";
43
+ import { Prose as wo } from "./components/Prose/Prose.js";
44
+ import { Radio as Mo } from "./components/Radio/Radio.js";
45
+ import { Select as jo } from "./components/Select/Select.js";
46
+ import { Separator as zo } from "./components/Separator/Separator.js";
47
+ import { Shroud as Go } from "./components/Shroud/Shroud.js";
48
+ import { Spacer as Jo } from "./components/Spacer/Spacer.js";
49
+ import { Style as Qo, useContextualStyle as Uo } from "./components/Style/Style.js";
50
+ import { Switch as Xo } from "./components/Switch/Switch.js";
51
+ import { Tabular as Zo } from "./components/Tabular/Tabular.js";
52
+ import { Text as $o, TextBlock as or } from "./components/Text/Text.js";
53
+ import { Textarea as tr } from "./components/Textarea/Textarea.js";
54
+ import { Title as mr } from "./components/Title/Title.js";
55
+ import { B as fr, I as xr } from "./Icons-B26SczGZ.js";
56
+ import { OnScreenSensor as lr } from "./components/OnScreenSensor.js";
57
+ import { ui as ir } from "./components/ui.js";
58
+ import { Symbols as cr } from "./components/Symbols.js";
58
59
  const I = {
59
60
  clsx: o,
60
61
  getValue: t,
@@ -67,56 +68,57 @@ const I = {
67
68
  string: a
68
69
  };
69
70
  export {
70
- T as Avatar,
71
- R as BackdropPortal,
72
- L as Badge,
73
- eo as Box,
74
- mr as BrandIcon,
75
- b as Button,
76
- v as ButtonBar,
77
- po as Center,
71
+ R as Avatar,
72
+ D as BackdropPortal,
73
+ V as Badge,
74
+ po as Box,
75
+ fr as BrandIcon,
76
+ y as Button,
77
+ T as ButtonBar,
78
+ xo as Center,
78
79
  P as Checkbox,
79
- V as ControlBox,
80
- A as CountryFlag,
81
- N as Decorate,
82
- q as Dot,
83
- xo as Flex,
84
- lo as FlexRestricter,
85
- E as Flyout,
86
- H as Icon,
87
- pr as Icons,
88
- K as Indicator,
89
- U as InfoPanel,
90
- X as Input,
91
- $ as Interactive,
92
- ro as Island,
93
- ho as Loaf,
94
- yo as Modal,
95
- ko as NavList,
96
- xr as OnScreenSensor,
97
- Co as Overlay,
98
- io as Pad,
99
- co as Page,
100
- Fo as Popover,
101
- Do as PremiumBadge,
102
- Oo as Prose,
103
- wo as Radio,
104
- Z as RichInput,
105
- So as Scrollable,
106
- Mo as Select,
107
- jo as Separator,
108
- zo as Shroud,
109
- Go as Spacer,
110
- Jo as Style,
111
- Uo as Switch,
112
- ir as Symbols,
113
- Xo as Tabular,
114
- Zo as Text,
115
- _o as TextBlock,
116
- or as Textarea,
117
- tr as Title,
118
- Io as VirtualScrollable,
119
- lr as ui,
120
- Ko as useContextualStyle,
80
+ A as ControlBox,
81
+ N as CountryFlag,
82
+ q as Decorate,
83
+ E as Dot,
84
+ lo as Flex,
85
+ io as FlexRestricter,
86
+ H as Flyout,
87
+ K as Icon,
88
+ xr as Icons,
89
+ U as Indicator,
90
+ X as InfoPanel,
91
+ Z as Input,
92
+ ro as Interactive,
93
+ eo as Island,
94
+ v as LinkButton,
95
+ ko as Loaf,
96
+ bo as Modal,
97
+ Co as NavList,
98
+ lr as OnScreenSensor,
99
+ Fo as Overlay,
100
+ co as Pad,
101
+ Bo as Page,
102
+ Lo as Popover,
103
+ Oo as PremiumBadge,
104
+ wo as Prose,
105
+ Mo as Radio,
106
+ $ as RichInput,
107
+ Io as Scrollable,
108
+ jo as Select,
109
+ zo as Separator,
110
+ Go as Shroud,
111
+ Jo as Spacer,
112
+ Qo as Style,
113
+ Xo as Switch,
114
+ cr as Symbols,
115
+ Zo as Tabular,
116
+ $o as Text,
117
+ or as TextBlock,
118
+ tr as Textarea,
119
+ mr as Title,
120
+ ho as VirtualScrollable,
121
+ ir as ui,
122
+ Uo as useContextualStyle,
121
123
  I as utils
122
124
  };
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.17",
4
+ "version": "0.0.19",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",