@wrdagency/blockout 1.0.8 → 1.0.10

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,5 +1,6 @@
1
1
  export { useSplitInput } from './input';
2
- export { useModifiers } from './keyboard';
2
+ export { useHotkey, useModifiers } from './keyboard';
3
3
  export { useSelection, type Selection, type SelectionMode } from './selection';
4
4
  export { useObjectState } from './state';
5
5
  export { useTemporaryChange } from './temporary';
6
+ export { useTheme } from './theme';
@@ -1,12 +1,15 @@
1
1
  import { useSplitInput as r } from "./input.js";
2
- import { useModifiers as p } from "./keyboard.js";
3
- import { useSelection as m } from "./selection.js";
4
- import { useObjectState as u } from "./state.js";
5
- import { useTemporaryChange as i } from "./temporary.js";
2
+ import { useHotkey as p, useModifiers as m } from "./keyboard.js";
3
+ import { useSelection as u } from "./selection.js";
4
+ import { useObjectState as x } from "./state.js";
5
+ import { useTemporaryChange as a } from "./temporary.js";
6
+ import { useTheme as S } from "./theme.js";
6
7
  export {
7
- p as useModifiers,
8
- u as useObjectState,
9
- m as useSelection,
8
+ p as useHotkey,
9
+ m as useModifiers,
10
+ x as useObjectState,
11
+ u as useSelection,
10
12
  r as useSplitInput,
11
- i as useTemporaryChange
13
+ a as useTemporaryChange,
14
+ S as useTheme
12
15
  };
@@ -1,4 +1,4 @@
1
- import { useRef as f, useEffect as o } from "react";
1
+ import { useEffect as o, useRef as f } from "react";
2
2
  function l() {
3
3
  const r = f({
4
4
  shift: !1,
@@ -0,0 +1,9 @@
1
+ type Theme = "light" | "dark";
2
+ export declare function useTheme(): {
3
+ theme: Theme;
4
+ isDark: boolean;
5
+ isLight: boolean;
6
+ toggle: () => void;
7
+ set: import('react').Dispatch<import('react').SetStateAction<Theme>>;
8
+ };
9
+ export {};
@@ -0,0 +1,19 @@
1
+ import { u as m } from "../index-D7vLJIGX.js";
2
+ import { useEffect as r } from "react";
3
+ function h() {
4
+ const [e, t] = m("blockout__theme", "light");
5
+ return r(() => {
6
+ document.documentElement.dataset.colourScheme = e;
7
+ }, [e]), {
8
+ theme: e,
9
+ isDark: e === "dark",
10
+ isLight: e === "light",
11
+ toggle: () => {
12
+ t((o) => o === "light" ? "dark" : "light");
13
+ },
14
+ set: t
15
+ };
16
+ }
17
+ export {
18
+ h as useTheme
19
+ };
package/dist/index.js CHANGED
@@ -4,13 +4,13 @@ import { Breadcrumbs as x } from "./components/breadcrumbs/index.js";
4
4
  import { Button as a } from "./components/button/index.js";
5
5
  import { BaseControl as n } from "./components/controls/base-control/index.js";
6
6
  import { CardNumberControl as C } from "./components/controls/card-number-control/index.js";
7
- import { CheckboxControl as u } from "./components/controls/checkbox-control/index.js";
7
+ import { CheckboxControl as i } from "./components/controls/checkbox-control/index.js";
8
8
  import { ChoiceControl as g } from "./components/controls/choice-control/index.js";
9
9
  import { DateControl as b } from "./components/controls/date-control/index.js";
10
- import { ListControl as S } from "./components/controls/list-control/index.js";
10
+ import { ListControl as H } from "./components/controls/list-control/index.js";
11
11
  import { MarkdownControl as h } from "./components/controls/markdown-control/index.js";
12
12
  import { NumberControl as y } from "./components/controls/number-control/index.js";
13
- import { PasswordControl as k } from "./components/controls/password-control/index.js";
13
+ import { PasswordControl as F } from "./components/controls/password-control/index.js";
14
14
  import { RecurrenceControl as D } from "./components/controls/recurrence-control/index.js";
15
15
  import { SelectControl as P } from "./components/controls/select-control/control.js";
16
16
  import { o as v } from "./options-Cfoqhxw2.js";
@@ -30,30 +30,31 @@ import { createForm as po } from "./components/form/types/form.js";
30
30
  import { Menu as fo } from "./components/menu/index.js";
31
31
  import { Progress as lo } from "./components/progress/index.js";
32
32
  import { Shell as so } from "./components/shell/index.js";
33
- import { Tabs as io } from "./components/tabs/index.js";
33
+ import { Tabs as uo } from "./components/tabs/index.js";
34
34
  import { Tag as co } from "./components/tag/index.js";
35
35
  import { Toolbar as To } from "./components/toolbar/index.js";
36
- import { Window as So } from "./components/window/index.js";
36
+ import { Window as Ho } from "./components/window/index.js";
37
37
  import { useSplitInput as ho } from "./hooks/input.js";
38
- import { useModifiers as yo } from "./hooks/keyboard.js";
39
- import { useSelection as ko } from "./hooks/selection.js";
40
- import { useObjectState as Do } from "./hooks/state.js";
41
- import { useTemporaryChange as Po } from "./hooks/temporary.js";
42
- import { Colourway as vo } from "./primitives/colourway/index.js";
43
- import { Draggable as No } from "./primitives/draggable/index.js";
44
- import { IconLabel as Ao } from "./primitives/icon-label/index.js";
45
- import { Link as Oo } from "./primitives/link/index.js";
46
- import { NavLink as zo } from "./primitives/nav-link/index.js";
47
- import { Popover as Wo } from "./primitives/popover/index.js";
48
- import { Resizable as Eo } from "./primitives/resizable/index.js";
49
- import { ScrollArea as Ko } from "./primitives/scroll-area/index.js";
50
- import { Symbol as Uo } from "./primitives/symbol/index.js";
51
- import { Tooltip as Yo } from "./primitives/tooltip/index.js";
52
- import { Truncate as _o } from "./primitives/truncate/index.js";
53
- import { H1 as or, H2 as rr, H3 as er, H4 as tr, H5 as mr, H6 as pr, Heading as xr } from "./primitives/typography/heading.js";
54
- import { Paragraph as ar } from "./primitives/typography/paragraph.js";
55
- import { VisuallyHidden as nr } from "./primitives/visually-hidden/index.js";
56
- import { getRandomTheme as Cr } from "./primitives/colourway/util.js";
38
+ import { useHotkey as yo, useModifiers as ko } from "./hooks/keyboard.js";
39
+ import { useSelection as Bo } from "./hooks/selection.js";
40
+ import { useObjectState as Lo } from "./hooks/state.js";
41
+ import { useTemporaryChange as Ro } from "./hooks/temporary.js";
42
+ import { useTheme as Mo } from "./hooks/theme.js";
43
+ import { Colourway as Vo } from "./primitives/colourway/index.js";
44
+ import { Draggable as Io } from "./primitives/draggable/index.js";
45
+ import { IconLabel as jo } from "./primitives/icon-label/index.js";
46
+ import { Link as Go } from "./primitives/link/index.js";
47
+ import { NavLink as qo } from "./primitives/nav-link/index.js";
48
+ import { Popover as Jo } from "./primitives/popover/index.js";
49
+ import { Resizable as Qo } from "./primitives/resizable/index.js";
50
+ import { ScrollArea as Xo } from "./primitives/scroll-area/index.js";
51
+ import { Symbol as Zo } from "./primitives/symbol/index.js";
52
+ import { Tooltip as $o } from "./primitives/tooltip/index.js";
53
+ import { Truncate as rr } from "./primitives/truncate/index.js";
54
+ import { H1 as tr, H2 as mr, H3 as pr, H4 as xr, H5 as fr, H6 as ar, Heading as lr } from "./primitives/typography/heading.js";
55
+ import { Paragraph as sr } from "./primitives/typography/paragraph.js";
56
+ import { VisuallyHidden as ur } from "./primitives/visually-hidden/index.js";
57
+ import { getRandomTheme as cr } from "./primitives/colourway/util.js";
57
58
  import './assets/index.css';export {
58
59
  e as Avatar,
59
60
  m as Badge,
@@ -61,43 +62,43 @@ import './assets/index.css';export {
61
62
  x as Breadcrumbs,
62
63
  a as Button,
63
64
  C as CardNumberControl,
64
- u as CheckboxControl,
65
+ i as CheckboxControl,
65
66
  g as ChoiceControl,
66
- vo as Colourway,
67
+ Vo as Colourway,
67
68
  K as DataForm,
68
69
  $ as DataView,
69
70
  b as DateControl,
70
- No as Draggable,
71
+ Io as Draggable,
71
72
  ro as Filesystem,
72
73
  Z as Filters,
73
74
  to as Form,
74
- or as H1,
75
- rr as H2,
76
- er as H3,
77
- tr as H4,
78
- mr as H5,
79
- pr as H6,
80
- xr as Heading,
81
- Ao as IconLabel,
82
- Oo as Link,
83
- S as ListControl,
75
+ tr as H1,
76
+ mr as H2,
77
+ pr as H3,
78
+ xr as H4,
79
+ fr as H5,
80
+ ar as H6,
81
+ lr as Heading,
82
+ jo as IconLabel,
83
+ Go as Link,
84
+ H as ListControl,
84
85
  h as MarkdownControl,
85
86
  fo as Menu,
86
- zo as NavLink,
87
+ qo as NavLink,
87
88
  y as NumberControl,
88
89
  v as Options,
89
- ar as Paragraph,
90
- k as PasswordControl,
91
- Wo as Popover,
90
+ sr as Paragraph,
91
+ F as PasswordControl,
92
+ Jo as Popover,
92
93
  lo as Progress,
93
94
  D as RecurrenceControl,
94
- Eo as Resizable,
95
- Ko as ScrollArea,
95
+ Qo as Resizable,
96
+ Xo as ScrollArea,
96
97
  N as Select,
97
98
  P as SelectControl,
98
99
  so as Shell,
99
- Uo as Symbol,
100
- io as Tabs,
100
+ Zo as Symbol,
101
+ uo as Tabs,
101
102
  co as Tag,
102
103
  A as TagControl,
103
104
  O as TextControl,
@@ -105,17 +106,19 @@ import './assets/index.css';export {
105
106
  W as ToggleControl,
106
107
  E as ToggleGroupControl,
107
108
  To as Toolbar,
108
- Yo as Tooltip,
109
- _o as Truncate,
110
- nr as VisuallyHidden,
111
- So as Window,
109
+ $o as Tooltip,
110
+ rr as Truncate,
111
+ ur as VisuallyHidden,
112
+ Ho as Window,
112
113
  po as createForm,
113
- Cr as getRandomTheme,
114
- yo as useModifiers,
115
- Do as useObjectState,
114
+ cr as getRandomTheme,
115
+ yo as useHotkey,
116
+ ko as useModifiers,
117
+ Lo as useObjectState,
116
118
  U as useSchema,
117
- ko as useSelection,
119
+ Bo as useSelection,
118
120
  ho as useSplitInput,
119
- Po as useTemporaryChange,
121
+ Ro as useTemporaryChange,
122
+ Mo as useTheme,
120
123
  X as useView
121
124
  };
@@ -1,8 +1,6 @@
1
- function o(e, u) {
2
- return u.split(".").reduce(function(t, n) {
3
- return t[n] = t[n] || {}, t[n];
4
- }, e);
1
+ function u(e, n) {
2
+ return n.split(".").reduce((t, o) => t == null ? void 0 : t[o], e);
5
3
  }
6
4
  export {
7
- o as dot
5
+ u as dot
8
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrdagency/blockout",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "A React component library created by WRD.agency",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",