@wrdagency/blockout 0.1.2 → 0.1.3

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,45 +1,21 @@
1
- import { jsxs as m, jsx as r, Fragment as M } from "react/jsx-runtime";
2
- import { useObjectState as b } from "../../../hooks/state.js";
3
- import { Weekday as y, Frequency as p, createRRule as v } from "../../../types/date.js";
1
+ import { jsxs as m, jsx as t, Fragment as v } from "react/jsx-runtime";
2
+ import { useObjectState as w } from "../../../hooks/state.js";
3
+ import { Weekday as p, Frequency as s, createRRule as C } from "../../../types/date.js";
4
4
  import { getOrdinalSuffix as d } from "../../../utils/date.js";
5
- import { noop as w } from "../../../utils/noop.js";
5
+ import { noop as M } from "../../../utils/noop.js";
6
6
  import * as e from "react";
7
- import { useMemo as F } from "react";
8
- import { w as A } from "../../../SSRBase.es-BUXS72ra.js";
9
- import { useBaseControlProps as C } from "../base-control/props.js";
10
- import { BasePopoverControl as k } from "../base-popover-control/index.js";
7
+ import { useMemo as E } from "react";
8
+ import { w as g } from "../../../SSRBase.es-BUXS72ra.js";
9
+ import { t as k } from "../../../Circle.es-B6Ug9Tpf.js";
10
+ import { useBaseControlProps as q } from "../base-control/props.js";
11
+ import { BasePopoverControl as S } from "../base-popover-control/index.js";
11
12
  import { NumberControl as h } from "../number-control/index.js";
12
- import '../../../assets/style.css';import '../../../assets/index18.css';/* empty css */
13
- import { SelectControl as s } from "../select-control/component.js";
14
- import { f as q, w as S, a as B } from "../../../options-Cfoqhxw2.js";
15
- import { ToggleGroupControl as x } from "../toggle-group-control/index.js";
16
- const P = /* @__PURE__ */ new Map([
17
- [
18
- "bold",
19
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z" }))
20
- ],
21
- [
22
- "duotone",
23
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z", opacity: "0.2" }), /* @__PURE__ */ e.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z" }))
24
- ],
25
- [
26
- "fill",
27
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z" }))
28
- ],
29
- [
30
- "light",
31
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z" }))
32
- ],
33
- [
34
- "regular",
35
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z" }))
36
- ],
37
- [
38
- "thin",
39
- /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z" }))
40
- ]
41
- ]), Z = e.forwardRef((o, n) => /* @__PURE__ */ e.createElement(A, { ref: n, ...o, weights: P }));
42
- Z.displayName = "CircleIcon";
13
+ import '../../../assets/style.css';import '../../../assets/index16.css';/* empty css */
14
+ import { SelectControl as y } from "../select-control/component.js";
15
+ import { f as B, w as F, a as x } from "../../../options-Cfoqhxw2.js";
16
+ import { ToggleGroupControl as P } from "../toggle-group-control/index.js";
17
+ const A = e.forwardRef((l, a) => /* @__PURE__ */ e.createElement(g, { ref: a, ...l, weights: k }));
18
+ A.displayName = "CircleIcon";
43
19
  const _ = /* @__PURE__ */ new Map([
44
20
  [
45
21
  "bold",
@@ -65,81 +41,81 @@ const _ = /* @__PURE__ */ new Map([
65
41
  "thin",
66
42
  /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm0-144a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,96a44,44,0,1,1,44-44A44.05,44.05,0,0,1,128,172Z" }))
67
43
  ]
68
- ]), g = e.forwardRef((o, n) => /* @__PURE__ */ e.createElement(A, { ref: n, ...o, weights: _ }));
69
- g.displayName = "RadioButtonIcon";
70
- const J = (o) => {
71
- const { baseProps: n, controlProps: u } = C(o, {
44
+ ]), Z = e.forwardRef((l, a) => /* @__PURE__ */ e.createElement(g, { ref: a, ...l, weights: _ }));
45
+ Z.displayName = "RadioButtonIcon";
46
+ const K = (l) => {
47
+ const { baseProps: a, controlProps: i } = q(l, {
72
48
  className: "component-recurrence-control"
73
- }), { onChangeValue: c = w, ...i } = u, [t, l] = b({
49
+ }), { onChangeValue: c = M, ...u } = i, [r, o] = w({
74
50
  interval: 1,
75
- frequency: p.Weekly,
51
+ frequency: s.Weekly,
76
52
  frequencySubtype: "byweekday",
77
- weeklyByWeekday: [y.Monday],
53
+ weeklyByWeekday: [p.Monday],
78
54
  monthlyByMonthDay: 1,
79
55
  monthlySetPos: "first",
80
- monthlyByWeekday: y.Monday
81
- }), E = F(() => v(t).toText(), [t]);
56
+ monthlyByWeekday: p.Monday
57
+ }), b = E(() => C(r).toText(), [r]);
82
58
  return /* @__PURE__ */ m(
83
- k,
59
+ S,
84
60
  {
85
- ...n,
86
- placeholder: E,
87
- inputProps: i,
61
+ ...a,
62
+ placeholder: b,
63
+ inputProps: u,
88
64
  children: [
89
65
  /* @__PURE__ */ m("div", { className: "component-recurrence-control__row", children: [
90
- /* @__PURE__ */ r(
66
+ /* @__PURE__ */ t(
91
67
  h,
92
68
  {
93
- value: t.interval,
94
- onChangeValue: (a) => l({ interval: a || 1 }),
95
- suffix: d(t.interval),
69
+ value: r.interval,
70
+ onChangeValue: (n) => o({ interval: n || 1 }),
71
+ suffix: d(r.interval),
96
72
  min: 1,
97
73
  "aria-label": "Recurrence frequency"
98
74
  }
99
75
  ),
100
- /* @__PURE__ */ r(
101
- s,
76
+ /* @__PURE__ */ t(
77
+ y,
102
78
  {
103
79
  "aria-label": "Recurrence period",
104
- value: t.frequency,
105
- onChangeValue: (a) => l({ frequency: a }),
106
- options: q
80
+ value: r.frequency,
81
+ onChangeValue: (n) => o({ frequency: n }),
82
+ options: B
107
83
  }
108
84
  )
109
85
  ] }),
110
- t.frequency === p.Weekly && /* @__PURE__ */ r("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ r(
111
- x,
86
+ r.frequency === s.Weekly && /* @__PURE__ */ t("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ t(
87
+ P,
112
88
  {
113
- value: t.weeklyByWeekday,
114
- onChangeValue: (a) => l({ weeklyByWeekday: a }),
89
+ value: r.weeklyByWeekday,
90
+ onChangeValue: (n) => o({ weeklyByWeekday: n }),
115
91
  label: "On every",
116
- options: S,
92
+ options: F,
117
93
  multiple: !0
118
94
  }
119
95
  ) }),
120
- t.frequency === p.Monthly && /* @__PURE__ */ m(M, { children: [
121
- /* @__PURE__ */ r(
96
+ r.frequency === s.Monthly && /* @__PURE__ */ m(v, { children: [
97
+ /* @__PURE__ */ t(
122
98
  f,
123
99
  {
124
100
  type: "bymonthday",
125
- parsed: t,
126
- setParsed: l,
127
- children: /* @__PURE__ */ r(
101
+ parsed: r,
102
+ setParsed: o,
103
+ children: /* @__PURE__ */ t(
128
104
  h,
129
105
  {
130
106
  prefix: "On the",
131
- suffix: d(t.monthlyByMonthDay) + " of the month",
132
- value: t.monthlyByMonthDay,
133
- onChangeValue: (a) => l({ monthlyByMonthDay: a || 1 }),
107
+ suffix: d(r.monthlyByMonthDay) + " of the month",
108
+ value: r.monthlyByMonthDay,
109
+ onChangeValue: (n) => o({ monthlyByMonthDay: n || 1 }),
134
110
  min: 1,
135
111
  max: 31
136
112
  }
137
113
  )
138
114
  }
139
115
  ),
140
- /* @__PURE__ */ m(f, { type: "byweekday", parsed: t, setParsed: l, children: [
141
- /* @__PURE__ */ r(
142
- s,
116
+ /* @__PURE__ */ m(f, { type: "byweekday", parsed: r, setParsed: o, children: [
117
+ /* @__PURE__ */ t(
118
+ y,
143
119
  {
144
120
  prefix: "On the",
145
121
  options: [
@@ -164,16 +140,16 @@ const J = (o) => {
164
140
  label: "Last"
165
141
  }
166
142
  ],
167
- value: t.monthlySetPos,
168
- onChangeValue: (a) => l({ monthlySetPos: a })
143
+ value: r.monthlySetPos,
144
+ onChangeValue: (n) => o({ monthlySetPos: n })
169
145
  }
170
146
  ),
171
- /* @__PURE__ */ r(
172
- s,
147
+ /* @__PURE__ */ t(
148
+ y,
173
149
  {
174
- options: B,
175
- value: t.monthlyByWeekday,
176
- onChangeValue: (a) => l({ monthlyByWeekday: a })
150
+ options: x,
151
+ value: r.monthlyByWeekday,
152
+ onChangeValue: (n) => o({ monthlyByWeekday: n })
177
153
  }
178
154
  )
179
155
  ] })
@@ -181,28 +157,28 @@ const J = (o) => {
181
157
  ]
182
158
  }
183
159
  );
184
- }, f = (o) => {
185
- const { type: n, children: u, parsed: c, setParsed: i } = o;
160
+ }, f = (l) => {
161
+ const { type: a, children: i, parsed: c, setParsed: u } = l;
186
162
  return /* @__PURE__ */ m("div", { className: "component-recurrence-control__frequency_type", children: [
187
- /* @__PURE__ */ r(
163
+ /* @__PURE__ */ t(
188
164
  "button",
189
165
  {
190
166
  className: "component-recurrence-control__radio",
191
- "aria-pressed": c.frequencySubtype === n,
192
- onClick: () => i({ frequencySubtype: n }),
193
- children: c.frequencySubtype === n ? /* @__PURE__ */ r(g, { weight: "fill" }) : /* @__PURE__ */ r(Z, {})
167
+ "aria-pressed": c.frequencySubtype === a,
168
+ onClick: () => u({ frequencySubtype: a }),
169
+ children: c.frequencySubtype === a ? /* @__PURE__ */ t(Z, { weight: "fill" }) : /* @__PURE__ */ t(A, {})
194
170
  }
195
171
  ),
196
- /* @__PURE__ */ r(
172
+ /* @__PURE__ */ t(
197
173
  "fieldset",
198
174
  {
199
175
  className: "component-recurrence-control__row",
200
- disabled: c.frequencySubtype !== n,
201
- children: u
176
+ disabled: c.frequencySubtype !== a,
177
+ children: i
202
178
  }
203
179
  )
204
180
  ] });
205
181
  };
206
182
  export {
207
- J as RecurrenceControl
183
+ K as RecurrenceControl
208
184
  };