@arcanejs/react-toolkit 0.4.1 → 0.6.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/README.md CHANGED
@@ -90,7 +90,7 @@ const ControlPanel = () => {
90
90
  <Group>
91
91
  {`Switch State: ${switchState}`}
92
92
  <Switch
93
- state={switchState}
93
+ value={switchState}
94
94
  onChange={setSwitchState}
95
95
  />
96
96
  </Group>
@@ -289,6 +289,12 @@ For a comprehensive list of examples,
289
289
  please see the example directory in the arcane monorepo:
290
290
  <https://github.com/arcanejs/arcanejs/tree/main/examples/react>
291
291
 
292
+ ### [Example Philips Hue App](https://github.com/arcanejs/hue-example)
293
+
294
+ Check out this example repository that uses `@arcanejs/react-toolkit`
295
+ to create an app that can be used to control a Philips Hue Bridge
296
+ on your local network.
297
+
292
298
  ## Status / Suitability / Security Disclaimer
293
299
 
294
300
  This project is **experimental**,
@@ -0,0 +1,49 @@
1
+ // src/components.ts
2
+ import * as React from "react";
3
+ var Button = React.forwardRef(
4
+ (props, ref) => React.createElement("button", { ...props, ref }, props.children)
5
+ );
6
+ var Group = React.forwardRef(
7
+ (props, ref) => React.createElement("group", { ...props, ref }, props.children)
8
+ );
9
+ var GroupHeader = React.forwardRef(
10
+ (props, ref) => React.createElement("group-header", { ...props, ref }, props.children)
11
+ );
12
+ var Label = React.forwardRef(
13
+ (props, ref) => React.createElement("label", { ...props, ref }, props.children)
14
+ );
15
+ var Rect = React.forwardRef(
16
+ (props, ref) => React.createElement("rect", { ...props, ref }, props.children)
17
+ );
18
+ var SliderButton = React.forwardRef(
19
+ (props, ref) => React.createElement("slider-button", { ...props, ref }, props.children)
20
+ );
21
+ var Switch = React.forwardRef(
22
+ (props, ref) => React.createElement("switch", { ...props, ref }, props.children)
23
+ );
24
+ var Tab = React.forwardRef(
25
+ (props, ref) => React.createElement("tab", { ...props, ref }, props.children)
26
+ );
27
+ var Tabs = React.forwardRef(
28
+ (props, ref) => React.createElement("tabs", { ...props, ref }, props.children)
29
+ );
30
+ var TextInput = React.forwardRef(
31
+ (props, ref) => React.createElement("text-input", { ...props, ref }, props.children)
32
+ );
33
+ var Timeline = React.forwardRef(
34
+ (props, ref) => React.createElement("timeline", { ...props, ref }, props.children)
35
+ );
36
+
37
+ export {
38
+ Button,
39
+ Group,
40
+ GroupHeader,
41
+ Label,
42
+ Rect,
43
+ SliderButton,
44
+ Switch,
45
+ Tab,
46
+ Tabs,
47
+ TextInput,
48
+ Timeline
49
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }// src/components.ts
2
+ var _react = require('react'); var React = _interopRequireWildcard(_react);
3
+ var Button = React.forwardRef(
4
+ (props, ref) => React.createElement("button", { ...props, ref }, props.children)
5
+ );
6
+ var Group = React.forwardRef(
7
+ (props, ref) => React.createElement("group", { ...props, ref }, props.children)
8
+ );
9
+ var GroupHeader = React.forwardRef(
10
+ (props, ref) => React.createElement("group-header", { ...props, ref }, props.children)
11
+ );
12
+ var Label = React.forwardRef(
13
+ (props, ref) => React.createElement("label", { ...props, ref }, props.children)
14
+ );
15
+ var Rect = React.forwardRef(
16
+ (props, ref) => React.createElement("rect", { ...props, ref }, props.children)
17
+ );
18
+ var SliderButton = React.forwardRef(
19
+ (props, ref) => React.createElement("slider-button", { ...props, ref }, props.children)
20
+ );
21
+ var Switch = React.forwardRef(
22
+ (props, ref) => React.createElement("switch", { ...props, ref }, props.children)
23
+ );
24
+ var Tab = React.forwardRef(
25
+ (props, ref) => React.createElement("tab", { ...props, ref }, props.children)
26
+ );
27
+ var Tabs = React.forwardRef(
28
+ (props, ref) => React.createElement("tabs", { ...props, ref }, props.children)
29
+ );
30
+ var TextInput = React.forwardRef(
31
+ (props, ref) => React.createElement("text-input", { ...props, ref }, props.children)
32
+ );
33
+ var Timeline = React.forwardRef(
34
+ (props, ref) => React.createElement("timeline", { ...props, ref }, props.children)
35
+ );
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+ exports.Button = Button; exports.Group = Group; exports.GroupHeader = GroupHeader; exports.Label = Label; exports.Rect = Rect; exports.SliderButton = SliderButton; exports.Switch = Switch; exports.Tab = Tab; exports.Tabs = Tabs; exports.TextInput = TextInput; exports.Timeline = Timeline;
@@ -0,0 +1,49 @@
1
+ import React__default from 'react';
2
+ import { L as LightDeskIntrinsicElements } from './types-D0Wa4a4d.mjs';
3
+ import '@arcanejs/toolkit/components/group';
4
+ import '@arcanejs/toolkit/components/button';
5
+ import '@arcanejs/toolkit/components/label';
6
+ import '@arcanejs/toolkit/components/rect';
7
+ import '@arcanejs/toolkit/components/slider-button';
8
+ import '@arcanejs/toolkit/components/switch';
9
+ import '@arcanejs/toolkit/components/tabs';
10
+ import '@arcanejs/toolkit/components/text-input';
11
+ import '@arcanejs/toolkit/components/timeline';
12
+
13
+ type HslColor = {
14
+ /**
15
+ * Hue in degrees, between 0-360.
16
+ */
17
+ hue: number;
18
+ /**
19
+ * Percentage saturation, between 0-100.
20
+ */
21
+ saturation: number;
22
+ /**
23
+ * Percentage lightness, between 0-100.
24
+ */
25
+ lightness: number;
26
+ /**
27
+ * Alpha channel, between 0-1.
28
+ */
29
+ alpha?: number;
30
+ };
31
+ type HslColorPickerProps = {
32
+ color: HslColor;
33
+ onChange: (update: (current: HslColor) => HslColor) => void;
34
+ /**
35
+ * Should the alpha channel be shown?
36
+ *
37
+ * @default false
38
+ */
39
+ showAlpha?: boolean;
40
+ /**
41
+ * Props to pass to the group component.
42
+ *
43
+ * @see {@link DEFAULT_GROUP_PROPS}
44
+ */
45
+ groupProps?: LightDeskIntrinsicElements['group'];
46
+ };
47
+ declare const HslColorPicker: React__default.FC<HslColorPickerProps>;
48
+
49
+ export { type HslColor, HslColorPicker, type HslColorPickerProps };
@@ -0,0 +1,49 @@
1
+ import React__default from 'react';
2
+ import { L as LightDeskIntrinsicElements } from './types-D0Wa4a4d.js';
3
+ import '@arcanejs/toolkit/components/group';
4
+ import '@arcanejs/toolkit/components/button';
5
+ import '@arcanejs/toolkit/components/label';
6
+ import '@arcanejs/toolkit/components/rect';
7
+ import '@arcanejs/toolkit/components/slider-button';
8
+ import '@arcanejs/toolkit/components/switch';
9
+ import '@arcanejs/toolkit/components/tabs';
10
+ import '@arcanejs/toolkit/components/text-input';
11
+ import '@arcanejs/toolkit/components/timeline';
12
+
13
+ type HslColor = {
14
+ /**
15
+ * Hue in degrees, between 0-360.
16
+ */
17
+ hue: number;
18
+ /**
19
+ * Percentage saturation, between 0-100.
20
+ */
21
+ saturation: number;
22
+ /**
23
+ * Percentage lightness, between 0-100.
24
+ */
25
+ lightness: number;
26
+ /**
27
+ * Alpha channel, between 0-1.
28
+ */
29
+ alpha?: number;
30
+ };
31
+ type HslColorPickerProps = {
32
+ color: HslColor;
33
+ onChange: (update: (current: HslColor) => HslColor) => void;
34
+ /**
35
+ * Should the alpha channel be shown?
36
+ *
37
+ * @default false
38
+ */
39
+ showAlpha?: boolean;
40
+ /**
41
+ * Props to pass to the group component.
42
+ *
43
+ * @see {@link DEFAULT_GROUP_PROPS}
44
+ */
45
+ groupProps?: LightDeskIntrinsicElements['group'];
46
+ };
47
+ declare const HslColorPicker: React__default.FC<HslColorPickerProps>;
48
+
49
+ export { type HslColor, HslColorPicker, type HslColorPickerProps };
package/dist/colors.js ADDED
@@ -0,0 +1,129 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkRKOUSLUWjs = require('./chunk-RKOUSLUW.js');
6
+
7
+ // src/colors.tsx
8
+ var _react = require('react');
9
+ var _util = require('@arcanejs/toolkit/util');
10
+ var _jsxruntime = require('react/jsx-runtime');
11
+ var DEFAULT_GROUP_PROPS = {
12
+ wrap: true,
13
+ direction: "horizontal"
14
+ };
15
+ var HslColorPicker = ({
16
+ color,
17
+ onChange,
18
+ showAlpha = false,
19
+ groupProps
20
+ }) => {
21
+ const { hue, saturation, lightness, alpha = 1 } = color;
22
+ const setHue = _react.useCallback.call(void 0,
23
+ (newHue) => {
24
+ onChange((current) => ({
25
+ ...current,
26
+ hue: newHue
27
+ }));
28
+ },
29
+ [onChange]
30
+ );
31
+ const setSat = _react.useCallback.call(void 0,
32
+ (newSat) => {
33
+ onChange((current) => ({
34
+ ...current,
35
+ saturation: newSat
36
+ }));
37
+ },
38
+ [onChange]
39
+ );
40
+ const setLightness = _react.useCallback.call(void 0,
41
+ (newLightness) => {
42
+ onChange((current) => ({
43
+ ...current,
44
+ lightness: newLightness
45
+ }));
46
+ },
47
+ [onChange]
48
+ );
49
+ const setAlpha = _react.useCallback.call(void 0,
50
+ (newAlpha) => {
51
+ onChange((current) => ({
52
+ ...current,
53
+ alpha: newAlpha
54
+ }));
55
+ },
56
+ [onChange]
57
+ );
58
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkRKOUSLUWjs.Group, { ...DEFAULT_GROUP_PROPS, ...groupProps, children: [
59
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRKOUSLUWjs.Rect, { color: `hsl(${hue}deg ${saturation}% ${lightness}% / ${alpha})` }),
60
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
61
+ _chunkRKOUSLUWjs.SliderButton,
62
+ {
63
+ value: hue,
64
+ onChange: setHue,
65
+ min: 0,
66
+ max: 360,
67
+ step: 1,
68
+ gradient: _util.HUE_GRADIENT,
69
+ grow: true
70
+ }
71
+ ),
72
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
73
+ _chunkRKOUSLUWjs.SliderButton,
74
+ {
75
+ value: saturation,
76
+ onChange: setSat,
77
+ min: 0,
78
+ max: 100,
79
+ step: 1,
80
+ gradient: [
81
+ { color: `hsl(${hue}deg 0% ${lightness}%)`, position: 0 },
82
+ { color: `hsl(${hue}deg 50% ${lightness}%)`, position: 0.5 },
83
+ { color: `hsl(${hue}deg 100% ${lightness}%)`, position: 1 }
84
+ ],
85
+ grow: true
86
+ }
87
+ ),
88
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
89
+ _chunkRKOUSLUWjs.SliderButton,
90
+ {
91
+ value: lightness,
92
+ onChange: setLightness,
93
+ min: 0,
94
+ max: 100,
95
+ step: 1,
96
+ gradient: [
97
+ { color: `hsl(${hue}deg ${saturation}% 0%)`, position: 0 },
98
+ { color: `hsl(${hue}deg ${saturation}% 50%)`, position: 0.5 },
99
+ { color: `hsl(${hue}deg ${saturation}% 100%)`, position: 1 }
100
+ ],
101
+ grow: true
102
+ }
103
+ ),
104
+ showAlpha && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
105
+ _chunkRKOUSLUWjs.SliderButton,
106
+ {
107
+ value: alpha,
108
+ onChange: setAlpha,
109
+ min: 0,
110
+ max: 1,
111
+ step: 0.01,
112
+ gradient: [
113
+ {
114
+ color: `hsla(${hue}deg ${saturation}% ${lightness}% / 0)`,
115
+ position: 0
116
+ },
117
+ {
118
+ color: `hsla(${hue}deg ${saturation}% ${lightness}% / 1)`,
119
+ position: 1
120
+ }
121
+ ],
122
+ grow: true
123
+ }
124
+ )
125
+ ] });
126
+ };
127
+
128
+
129
+ exports.HslColorPicker = HslColorPicker;
@@ -0,0 +1,129 @@
1
+ import {
2
+ Group,
3
+ Rect,
4
+ SliderButton
5
+ } from "./chunk-HVMRFXJ2.mjs";
6
+
7
+ // src/colors.tsx
8
+ import { useCallback } from "react";
9
+ import { HUE_GRADIENT } from "@arcanejs/toolkit/util";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ var DEFAULT_GROUP_PROPS = {
12
+ wrap: true,
13
+ direction: "horizontal"
14
+ };
15
+ var HslColorPicker = ({
16
+ color,
17
+ onChange,
18
+ showAlpha = false,
19
+ groupProps
20
+ }) => {
21
+ const { hue, saturation, lightness, alpha = 1 } = color;
22
+ const setHue = useCallback(
23
+ (newHue) => {
24
+ onChange((current) => ({
25
+ ...current,
26
+ hue: newHue
27
+ }));
28
+ },
29
+ [onChange]
30
+ );
31
+ const setSat = useCallback(
32
+ (newSat) => {
33
+ onChange((current) => ({
34
+ ...current,
35
+ saturation: newSat
36
+ }));
37
+ },
38
+ [onChange]
39
+ );
40
+ const setLightness = useCallback(
41
+ (newLightness) => {
42
+ onChange((current) => ({
43
+ ...current,
44
+ lightness: newLightness
45
+ }));
46
+ },
47
+ [onChange]
48
+ );
49
+ const setAlpha = useCallback(
50
+ (newAlpha) => {
51
+ onChange((current) => ({
52
+ ...current,
53
+ alpha: newAlpha
54
+ }));
55
+ },
56
+ [onChange]
57
+ );
58
+ return /* @__PURE__ */ jsxs(Group, { ...DEFAULT_GROUP_PROPS, ...groupProps, children: [
59
+ /* @__PURE__ */ jsx(Rect, { color: `hsl(${hue}deg ${saturation}% ${lightness}% / ${alpha})` }),
60
+ /* @__PURE__ */ jsx(
61
+ SliderButton,
62
+ {
63
+ value: hue,
64
+ onChange: setHue,
65
+ min: 0,
66
+ max: 360,
67
+ step: 1,
68
+ gradient: HUE_GRADIENT,
69
+ grow: true
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(
73
+ SliderButton,
74
+ {
75
+ value: saturation,
76
+ onChange: setSat,
77
+ min: 0,
78
+ max: 100,
79
+ step: 1,
80
+ gradient: [
81
+ { color: `hsl(${hue}deg 0% ${lightness}%)`, position: 0 },
82
+ { color: `hsl(${hue}deg 50% ${lightness}%)`, position: 0.5 },
83
+ { color: `hsl(${hue}deg 100% ${lightness}%)`, position: 1 }
84
+ ],
85
+ grow: true
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsx(
89
+ SliderButton,
90
+ {
91
+ value: lightness,
92
+ onChange: setLightness,
93
+ min: 0,
94
+ max: 100,
95
+ step: 1,
96
+ gradient: [
97
+ { color: `hsl(${hue}deg ${saturation}% 0%)`, position: 0 },
98
+ { color: `hsl(${hue}deg ${saturation}% 50%)`, position: 0.5 },
99
+ { color: `hsl(${hue}deg ${saturation}% 100%)`, position: 1 }
100
+ ],
101
+ grow: true
102
+ }
103
+ ),
104
+ showAlpha && /* @__PURE__ */ jsx(
105
+ SliderButton,
106
+ {
107
+ value: alpha,
108
+ onChange: setAlpha,
109
+ min: 0,
110
+ max: 1,
111
+ step: 0.01,
112
+ gradient: [
113
+ {
114
+ color: `hsla(${hue}deg ${saturation}% ${lightness}% / 0)`,
115
+ position: 0
116
+ },
117
+ {
118
+ color: `hsla(${hue}deg ${saturation}% ${lightness}% / 1)`,
119
+ position: 1
120
+ }
121
+ ],
122
+ grow: true
123
+ }
124
+ )
125
+ ] });
126
+ };
127
+ export {
128
+ HslColorPicker
129
+ };
package/dist/index.d.mts CHANGED
@@ -1,69 +1,15 @@
1
1
  import * as ld from '@arcanejs/toolkit';
2
- import { Props as Props$1, Events as Events$1, Group as Group$1, GroupHeader as GroupHeader$1 } from '@arcanejs/toolkit/components/group';
3
- import { Props, Events, Button as Button$1 } from '@arcanejs/toolkit/components/button';
4
- import { Props as Props$2, Label as Label$1 } from '@arcanejs/toolkit/components/label';
5
- import { Props as Props$3, Rect as Rect$1 } from '@arcanejs/toolkit/components/rect';
6
- import { Props as Props$4, Events as Events$2, SliderButton as SliderButton$1 } from '@arcanejs/toolkit/components/slider-button';
7
- import { Props as Props$5, Events as Events$3, Switch as Switch$1 } from '@arcanejs/toolkit/components/switch';
8
- import { TabProps, Tab as Tab$1, TabsProps, Tabs as Tabs$1 } from '@arcanejs/toolkit/components/tabs';
9
- import { Props as Props$6, Events as Events$4, TextInput as TextInput$1 } from '@arcanejs/toolkit/components/text-input';
10
- import { Props as Props$7, Timeline as Timeline$1 } from '@arcanejs/toolkit/components/timeline';
2
+ import { Group as Group$1, GroupHeader as GroupHeader$1, Props } from '@arcanejs/toolkit/components/group';
3
+ import { L as LightDeskIntrinsicElements } from './types-D0Wa4a4d.mjs';
11
4
  import * as React from 'react';
12
- import { Ref } from 'react';
13
-
14
- type Child = JSX.Element | string | null | undefined | boolean;
15
- type Children = Child | Child[];
16
- interface LightDeskIntrinsicElements {
17
- button: Props & {
18
- children?: never;
19
- onClick?: Events['click'];
20
- ref?: Ref<Button$1>;
21
- };
22
- group: Props$1 & {
23
- children?: Children;
24
- onTitleChanged?: Events$1['title-changed'];
25
- ref?: Ref<Group$1>;
26
- };
27
- 'group-header': {
28
- children?: Children;
29
- ref?: Ref<GroupHeader$1>;
30
- };
31
- label: Props$2 & {
32
- children?: never;
33
- ref?: Ref<Label$1>;
34
- };
35
- rect: Props$3 & {
36
- children?: never;
37
- ref?: Ref<Rect$1>;
38
- };
39
- 'slider-button': Props$4 & {
40
- children?: never;
41
- onChange?: Events$2['change'];
42
- ref?: Ref<SliderButton$1>;
43
- };
44
- switch: Props$5 & {
45
- children?: never;
46
- onChange?: Events$3['change'];
47
- ref?: Ref<Switch$1>;
48
- };
49
- tab: TabProps & {
50
- children?: JSX.Element | string;
51
- ref?: Ref<Tab$1>;
52
- };
53
- tabs: TabsProps & {
54
- children?: JSX.Element | JSX.Element[];
55
- ref?: Ref<Tabs$1>;
56
- };
57
- 'text-input': Props$6 & {
58
- children?: JSX.Element | JSX.Element[];
59
- onChange?: Events$4['change'];
60
- ref?: Ref<TextInput$1>;
61
- };
62
- timeline: Props$7 & {
63
- children?: never;
64
- ref?: Ref<Timeline$1>;
65
- };
66
- }
5
+ import { Button as Button$1 } from '@arcanejs/toolkit/components/button';
6
+ import { Label as Label$1 } from '@arcanejs/toolkit/components/label';
7
+ import { Rect as Rect$1 } from '@arcanejs/toolkit/components/rect';
8
+ import { SliderButton as SliderButton$1 } from '@arcanejs/toolkit/components/slider-button';
9
+ import { Switch as Switch$1 } from '@arcanejs/toolkit/components/switch';
10
+ import { Tab as Tab$1, Tabs as Tabs$1 } from '@arcanejs/toolkit/components/tabs';
11
+ import { Timeline as Timeline$1 } from '@arcanejs/toolkit/components/timeline';
12
+ import { TextInput as TextInput$1 } from '@arcanejs/toolkit/components/text-input';
67
13
 
68
14
  type ComponentWithRef<T, P> = React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
69
15
  declare const Button: ComponentWithRef<Button$1, LightDeskIntrinsicElements['button']>;
@@ -80,7 +26,7 @@ declare const Timeline: ComponentWithRef<Timeline$1, LightDeskIntrinsicElements[
80
26
 
81
27
  declare const ToolkitRenderer: {
82
28
  renderGroup: (component: JSX.Element, container: ld.Group) => void;
83
- render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props$1) => void;
29
+ render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props) => void;
84
30
  };
85
31
 
86
- export { Button, Group, GroupHeader, Label, type LightDeskIntrinsicElements, Rect, SliderButton, Switch, Tab, Tabs, TextInput, Timeline, ToolkitRenderer };
32
+ export { Button, Group, GroupHeader, Label, LightDeskIntrinsicElements, Rect, SliderButton, Switch, Tab, Tabs, TextInput, Timeline, ToolkitRenderer };
package/dist/index.d.ts CHANGED
@@ -1,69 +1,15 @@
1
1
  import * as ld from '@arcanejs/toolkit';
2
- import { Props as Props$1, Events as Events$1, Group as Group$1, GroupHeader as GroupHeader$1 } from '@arcanejs/toolkit/components/group';
3
- import { Props, Events, Button as Button$1 } from '@arcanejs/toolkit/components/button';
4
- import { Props as Props$2, Label as Label$1 } from '@arcanejs/toolkit/components/label';
5
- import { Props as Props$3, Rect as Rect$1 } from '@arcanejs/toolkit/components/rect';
6
- import { Props as Props$4, Events as Events$2, SliderButton as SliderButton$1 } from '@arcanejs/toolkit/components/slider-button';
7
- import { Props as Props$5, Events as Events$3, Switch as Switch$1 } from '@arcanejs/toolkit/components/switch';
8
- import { TabProps, Tab as Tab$1, TabsProps, Tabs as Tabs$1 } from '@arcanejs/toolkit/components/tabs';
9
- import { Props as Props$6, Events as Events$4, TextInput as TextInput$1 } from '@arcanejs/toolkit/components/text-input';
10
- import { Props as Props$7, Timeline as Timeline$1 } from '@arcanejs/toolkit/components/timeline';
2
+ import { Group as Group$1, GroupHeader as GroupHeader$1, Props } from '@arcanejs/toolkit/components/group';
3
+ import { L as LightDeskIntrinsicElements } from './types-D0Wa4a4d.js';
11
4
  import * as React from 'react';
12
- import { Ref } from 'react';
13
-
14
- type Child = JSX.Element | string | null | undefined | boolean;
15
- type Children = Child | Child[];
16
- interface LightDeskIntrinsicElements {
17
- button: Props & {
18
- children?: never;
19
- onClick?: Events['click'];
20
- ref?: Ref<Button$1>;
21
- };
22
- group: Props$1 & {
23
- children?: Children;
24
- onTitleChanged?: Events$1['title-changed'];
25
- ref?: Ref<Group$1>;
26
- };
27
- 'group-header': {
28
- children?: Children;
29
- ref?: Ref<GroupHeader$1>;
30
- };
31
- label: Props$2 & {
32
- children?: never;
33
- ref?: Ref<Label$1>;
34
- };
35
- rect: Props$3 & {
36
- children?: never;
37
- ref?: Ref<Rect$1>;
38
- };
39
- 'slider-button': Props$4 & {
40
- children?: never;
41
- onChange?: Events$2['change'];
42
- ref?: Ref<SliderButton$1>;
43
- };
44
- switch: Props$5 & {
45
- children?: never;
46
- onChange?: Events$3['change'];
47
- ref?: Ref<Switch$1>;
48
- };
49
- tab: TabProps & {
50
- children?: JSX.Element | string;
51
- ref?: Ref<Tab$1>;
52
- };
53
- tabs: TabsProps & {
54
- children?: JSX.Element | JSX.Element[];
55
- ref?: Ref<Tabs$1>;
56
- };
57
- 'text-input': Props$6 & {
58
- children?: JSX.Element | JSX.Element[];
59
- onChange?: Events$4['change'];
60
- ref?: Ref<TextInput$1>;
61
- };
62
- timeline: Props$7 & {
63
- children?: never;
64
- ref?: Ref<Timeline$1>;
65
- };
66
- }
5
+ import { Button as Button$1 } from '@arcanejs/toolkit/components/button';
6
+ import { Label as Label$1 } from '@arcanejs/toolkit/components/label';
7
+ import { Rect as Rect$1 } from '@arcanejs/toolkit/components/rect';
8
+ import { SliderButton as SliderButton$1 } from '@arcanejs/toolkit/components/slider-button';
9
+ import { Switch as Switch$1 } from '@arcanejs/toolkit/components/switch';
10
+ import { Tab as Tab$1, Tabs as Tabs$1 } from '@arcanejs/toolkit/components/tabs';
11
+ import { Timeline as Timeline$1 } from '@arcanejs/toolkit/components/timeline';
12
+ import { TextInput as TextInput$1 } from '@arcanejs/toolkit/components/text-input';
67
13
 
68
14
  type ComponentWithRef<T, P> = React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
69
15
  declare const Button: ComponentWithRef<Button$1, LightDeskIntrinsicElements['button']>;
@@ -80,7 +26,7 @@ declare const Timeline: ComponentWithRef<Timeline$1, LightDeskIntrinsicElements[
80
26
 
81
27
  declare const ToolkitRenderer: {
82
28
  renderGroup: (component: JSX.Element, container: ld.Group) => void;
83
- render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props$1) => void;
29
+ render: (component: JSX.Element, container: ld.Toolkit, rootGroupProps?: Props) => void;
84
30
  };
85
31
 
86
- export { Button, Group, GroupHeader, Label, type LightDeskIntrinsicElements, Rect, SliderButton, Switch, Tab, Tabs, TextInput, Timeline, ToolkitRenderer };
32
+ export { Button, Group, GroupHeader, Label, LightDeskIntrinsicElements, Rect, SliderButton, Switch, Tab, Tabs, TextInput, Timeline, ToolkitRenderer };
package/dist/index.js CHANGED
@@ -1,5 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ var _chunkRKOUSLUWjs = require('./chunk-RKOUSLUW.js');
14
+
15
+
3
16
  var _chunkRT2VSMJLjs = require('./chunk-RT2VSMJL.js');
4
17
 
5
18
  // src/index.tsx
@@ -7,44 +20,6 @@ var _reactreconciler = require('react-reconciler'); var _reactreconciler2 = _int
7
20
  var _constants = require('react-reconciler/constants');
8
21
  var _toolkit = require('@arcanejs/toolkit'); var ld = _interopRequireWildcard(_toolkit);
9
22
  var _base = require('@arcanejs/toolkit/components/base');
10
-
11
- // src/components.ts
12
- var _react = require('react'); var React = _interopRequireWildcard(_react);
13
- var Button = React.forwardRef(
14
- (props, ref) => React.createElement("button", { ...props, ref }, props.children)
15
- );
16
- var Group = React.forwardRef(
17
- (props, ref) => React.createElement("group", { ...props, ref }, props.children)
18
- );
19
- var GroupHeader = React.forwardRef(
20
- (props, ref) => React.createElement("group-header", { ...props, ref }, props.children)
21
- );
22
- var Label = React.forwardRef(
23
- (props, ref) => React.createElement("label", { ...props, ref }, props.children)
24
- );
25
- var Rect = React.forwardRef(
26
- (props, ref) => React.createElement("rect", { ...props, ref }, props.children)
27
- );
28
- var SliderButton = React.forwardRef(
29
- (props, ref) => React.createElement("slider-button", { ...props, ref }, props.children)
30
- );
31
- var Switch = React.forwardRef(
32
- (props, ref) => React.createElement("switch", { ...props, ref }, props.children)
33
- );
34
- var Tab = React.forwardRef(
35
- (props, ref) => React.createElement("tab", { ...props, ref }, props.children)
36
- );
37
- var Tabs = React.forwardRef(
38
- (props, ref) => React.createElement("tabs", { ...props, ref }, props.children)
39
- );
40
- var TextInput = React.forwardRef(
41
- (props, ref) => React.createElement("text-input", { ...props, ref }, props.children)
42
- );
43
- var Timeline = React.forwardRef(
44
- (props, ref) => React.createElement("timeline", { ...props, ref }, props.children)
45
- );
46
-
47
- // src/index.tsx
48
23
  var _jsxruntime = require('react/jsx-runtime');
49
24
  var isType = (targetType, type, _props) => targetType === type;
50
25
  var canSetProps = (instance) => instance instanceof _base.Base;
@@ -229,7 +204,7 @@ var ToolkitRenderer = {
229
204
  reconciler.updateContainer(componentWithContexts, root, null);
230
205
  },
231
206
  render: (component, container, rootGroupProps) => {
232
- const group = new ld.Group(rootGroupProps);
207
+ const group = new ld.Group({ direction: "vertical", ...rootGroupProps });
233
208
  container.setRoot(group);
234
209
  ToolkitRenderer.renderGroup(component, group);
235
210
  }
@@ -247,4 +222,4 @@ var ToolkitRenderer = {
247
222
 
248
223
 
249
224
 
250
- exports.Button = Button; exports.Group = Group; exports.GroupHeader = GroupHeader; exports.Label = Label; exports.Rect = Rect; exports.SliderButton = SliderButton; exports.Switch = Switch; exports.Tab = Tab; exports.Tabs = Tabs; exports.TextInput = TextInput; exports.Timeline = Timeline; exports.ToolkitRenderer = ToolkitRenderer;
225
+ exports.Button = _chunkRKOUSLUWjs.Button; exports.Group = _chunkRKOUSLUWjs.Group; exports.GroupHeader = _chunkRKOUSLUWjs.GroupHeader; exports.Label = _chunkRKOUSLUWjs.Label; exports.Rect = _chunkRKOUSLUWjs.Rect; exports.SliderButton = _chunkRKOUSLUWjs.SliderButton; exports.Switch = _chunkRKOUSLUWjs.Switch; exports.Tab = _chunkRKOUSLUWjs.Tab; exports.Tabs = _chunkRKOUSLUWjs.Tabs; exports.TextInput = _chunkRKOUSLUWjs.TextInput; exports.Timeline = _chunkRKOUSLUWjs.Timeline; exports.ToolkitRenderer = ToolkitRenderer;
package/dist/index.mjs CHANGED
@@ -1,3 +1,16 @@
1
+ import {
2
+ Button,
3
+ Group,
4
+ GroupHeader,
5
+ Label,
6
+ Rect,
7
+ SliderButton,
8
+ Switch,
9
+ Tab,
10
+ Tabs,
11
+ TextInput,
12
+ Timeline
13
+ } from "./chunk-HVMRFXJ2.mjs";
1
14
  import {
2
15
  LoggerContext
3
16
  } from "./chunk-TOGR56FN.mjs";
@@ -7,44 +20,6 @@ import Reconciler from "react-reconciler";
7
20
  import { DefaultEventPriority } from "react-reconciler/constants";
8
21
  import * as ld from "@arcanejs/toolkit";
9
22
  import { Base, BaseParent } from "@arcanejs/toolkit/components/base";
10
-
11
- // src/components.ts
12
- import * as React from "react";
13
- var Button = React.forwardRef(
14
- (props, ref) => React.createElement("button", { ...props, ref }, props.children)
15
- );
16
- var Group = React.forwardRef(
17
- (props, ref) => React.createElement("group", { ...props, ref }, props.children)
18
- );
19
- var GroupHeader = React.forwardRef(
20
- (props, ref) => React.createElement("group-header", { ...props, ref }, props.children)
21
- );
22
- var Label = React.forwardRef(
23
- (props, ref) => React.createElement("label", { ...props, ref }, props.children)
24
- );
25
- var Rect = React.forwardRef(
26
- (props, ref) => React.createElement("rect", { ...props, ref }, props.children)
27
- );
28
- var SliderButton = React.forwardRef(
29
- (props, ref) => React.createElement("slider-button", { ...props, ref }, props.children)
30
- );
31
- var Switch = React.forwardRef(
32
- (props, ref) => React.createElement("switch", { ...props, ref }, props.children)
33
- );
34
- var Tab = React.forwardRef(
35
- (props, ref) => React.createElement("tab", { ...props, ref }, props.children)
36
- );
37
- var Tabs = React.forwardRef(
38
- (props, ref) => React.createElement("tabs", { ...props, ref }, props.children)
39
- );
40
- var TextInput = React.forwardRef(
41
- (props, ref) => React.createElement("text-input", { ...props, ref }, props.children)
42
- );
43
- var Timeline = React.forwardRef(
44
- (props, ref) => React.createElement("timeline", { ...props, ref }, props.children)
45
- );
46
-
47
- // src/index.tsx
48
23
  import { jsx } from "react/jsx-runtime";
49
24
  var isType = (targetType, type, _props) => targetType === type;
50
25
  var canSetProps = (instance) => instance instanceof Base;
@@ -229,7 +204,7 @@ var ToolkitRenderer = {
229
204
  reconciler.updateContainer(componentWithContexts, root, null);
230
205
  },
231
206
  render: (component, container, rootGroupProps) => {
232
- const group = new ld.Group(rootGroupProps);
207
+ const group = new ld.Group({ direction: "vertical", ...rootGroupProps });
233
208
  container.setRoot(group);
234
209
  ToolkitRenderer.renderGroup(component, group);
235
210
  }
@@ -0,0 +1,66 @@
1
+ import { Props as Props$1, Events as Events$1, Group, GroupHeader } from '@arcanejs/toolkit/components/group';
2
+ import { Props, Events, Button } from '@arcanejs/toolkit/components/button';
3
+ import { Props as Props$2, Label } from '@arcanejs/toolkit/components/label';
4
+ import { Props as Props$3, Rect } from '@arcanejs/toolkit/components/rect';
5
+ import { Props as Props$4, Events as Events$2, SliderButton } from '@arcanejs/toolkit/components/slider-button';
6
+ import { Props as Props$5, Events as Events$3, Switch } from '@arcanejs/toolkit/components/switch';
7
+ import { TabProps, Tab, TabsProps, Tabs } from '@arcanejs/toolkit/components/tabs';
8
+ import { Props as Props$6, Events as Events$4, TextInput } from '@arcanejs/toolkit/components/text-input';
9
+ import { Props as Props$7, Timeline } from '@arcanejs/toolkit/components/timeline';
10
+ import { Ref } from 'react';
11
+
12
+ type Child = JSX.Element | string | null | undefined | boolean;
13
+ type Children = Child | Child[];
14
+ interface LightDeskIntrinsicElements {
15
+ button: Props & {
16
+ children?: never;
17
+ onClick?: Events['click'];
18
+ ref?: Ref<Button>;
19
+ };
20
+ group: Props$1 & {
21
+ children?: Children;
22
+ onTitleChanged?: Events$1['title-changed'];
23
+ ref?: Ref<Group>;
24
+ };
25
+ 'group-header': {
26
+ children?: Children;
27
+ ref?: Ref<GroupHeader>;
28
+ };
29
+ label: Props$2 & {
30
+ children?: never;
31
+ ref?: Ref<Label>;
32
+ };
33
+ rect: Props$3 & {
34
+ children?: never;
35
+ ref?: Ref<Rect>;
36
+ };
37
+ 'slider-button': Props$4 & {
38
+ children?: never;
39
+ onChange?: Events$2['change'];
40
+ ref?: Ref<SliderButton>;
41
+ };
42
+ switch: Props$5 & {
43
+ children?: never;
44
+ onChange?: Events$3['change'];
45
+ ref?: Ref<Switch>;
46
+ };
47
+ tab: TabProps & {
48
+ children?: JSX.Element | string;
49
+ ref?: Ref<Tab>;
50
+ };
51
+ tabs: TabsProps & {
52
+ children?: JSX.Element | JSX.Element[];
53
+ ref?: Ref<Tabs>;
54
+ };
55
+ 'text-input': Props$6 & {
56
+ children?: JSX.Element | JSX.Element[];
57
+ onChange?: Events$4['change'];
58
+ ref?: Ref<TextInput>;
59
+ };
60
+ timeline: Props$7 & {
61
+ children?: never;
62
+ ref?: Ref<Timeline>;
63
+ };
64
+ }
65
+
66
+ export type { LightDeskIntrinsicElements as L };
@@ -0,0 +1,66 @@
1
+ import { Props as Props$1, Events as Events$1, Group, GroupHeader } from '@arcanejs/toolkit/components/group';
2
+ import { Props, Events, Button } from '@arcanejs/toolkit/components/button';
3
+ import { Props as Props$2, Label } from '@arcanejs/toolkit/components/label';
4
+ import { Props as Props$3, Rect } from '@arcanejs/toolkit/components/rect';
5
+ import { Props as Props$4, Events as Events$2, SliderButton } from '@arcanejs/toolkit/components/slider-button';
6
+ import { Props as Props$5, Events as Events$3, Switch } from '@arcanejs/toolkit/components/switch';
7
+ import { TabProps, Tab, TabsProps, Tabs } from '@arcanejs/toolkit/components/tabs';
8
+ import { Props as Props$6, Events as Events$4, TextInput } from '@arcanejs/toolkit/components/text-input';
9
+ import { Props as Props$7, Timeline } from '@arcanejs/toolkit/components/timeline';
10
+ import { Ref } from 'react';
11
+
12
+ type Child = JSX.Element | string | null | undefined | boolean;
13
+ type Children = Child | Child[];
14
+ interface LightDeskIntrinsicElements {
15
+ button: Props & {
16
+ children?: never;
17
+ onClick?: Events['click'];
18
+ ref?: Ref<Button>;
19
+ };
20
+ group: Props$1 & {
21
+ children?: Children;
22
+ onTitleChanged?: Events$1['title-changed'];
23
+ ref?: Ref<Group>;
24
+ };
25
+ 'group-header': {
26
+ children?: Children;
27
+ ref?: Ref<GroupHeader>;
28
+ };
29
+ label: Props$2 & {
30
+ children?: never;
31
+ ref?: Ref<Label>;
32
+ };
33
+ rect: Props$3 & {
34
+ children?: never;
35
+ ref?: Ref<Rect>;
36
+ };
37
+ 'slider-button': Props$4 & {
38
+ children?: never;
39
+ onChange?: Events$2['change'];
40
+ ref?: Ref<SliderButton>;
41
+ };
42
+ switch: Props$5 & {
43
+ children?: never;
44
+ onChange?: Events$3['change'];
45
+ ref?: Ref<Switch>;
46
+ };
47
+ tab: TabProps & {
48
+ children?: JSX.Element | string;
49
+ ref?: Ref<Tab>;
50
+ };
51
+ tabs: TabsProps & {
52
+ children?: JSX.Element | JSX.Element[];
53
+ ref?: Ref<Tabs>;
54
+ };
55
+ 'text-input': Props$6 & {
56
+ children?: JSX.Element | JSX.Element[];
57
+ onChange?: Events$4['change'];
58
+ ref?: Ref<TextInput>;
59
+ };
60
+ timeline: Props$7 & {
61
+ children?: never;
62
+ ref?: Ref<Timeline>;
63
+ };
64
+ }
65
+
66
+ export type { LightDeskIntrinsicElements as L };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcanejs/react-toolkit",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Build web-accessible control interfaces for your long-running Node.js processes",
6
6
  "keywords": [
@@ -25,6 +25,12 @@
25
25
  "require": "./dist/index.js",
26
26
  "types": "./dist/index.d.ts"
27
27
  },
28
+ "./colors": {
29
+ "@arcanejs/source": "./src/colors.tsx",
30
+ "import": "./dist/colors.mjs",
31
+ "require": "./dist/colors.js",
32
+ "types": "./dist/colors.d.ts"
33
+ },
28
34
  "./data": {
29
35
  "@arcanejs/source": "./src/data.tsx",
30
36
  "import": "./dist/data.mjs",
@@ -50,15 +56,15 @@
50
56
  "tsup": "^8.1.0",
51
57
  "typescript": "^5.3.3",
52
58
  "zod": "^3.23.8",
53
- "@arcanejs/typescript-config": "^0.0.0",
54
- "@arcanejs/eslint-config": "^0.0.0"
59
+ "@arcanejs/eslint-config": "^0.0.0",
60
+ "@arcanejs/typescript-config": "^0.0.0"
55
61
  },
56
62
  "dependencies": {
57
63
  "lodash": "^4.17.21",
58
64
  "react": "^18",
59
65
  "react-reconciler": "0.28.0",
60
- "@arcanejs/protocol": "^0.2.0",
61
- "@arcanejs/toolkit": "^0.3.0"
66
+ "@arcanejs/protocol": "^0.3.0",
67
+ "@arcanejs/toolkit": "^0.5.0"
62
68
  },
63
69
  "peerDependencies": {
64
70
  "zod": "^3.23.8"