@wrdagency/blockout 0.0.3 → 0.0.5
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/{2NBKRL7C-DnAMmXv4.js → 2NBKRL7C-raj2vrMY.js} +3 -3
- package/dist/{P7GR5CS5-BryEvRCz.js → P7GR5CS5-PkUYC6hd.js} +199 -180
- package/dist/{T7VMP3TM--1s529fr.js → T7VMP3TM-BeJUiw28.js} +683 -679
- package/dist/{UQQRIHDV-Bfi_RJby.js → UQQRIHDV-xtNCxi0H.js} +115 -115
- package/dist/{VIIRIBF3-XWA2y8Hu.js → VIIRIBF3-B3f0V2Nc.js} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/style.css +1 -0
- package/dist/assets/styles.css +1 -0
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/controls/base-control/index.d.ts +4 -2
- package/dist/components/controls/base-control/index.js +26 -22
- package/dist/components/controls/choice-control/choice.d.ts +8 -0
- package/dist/components/controls/choice-control/choice.js +54 -0
- package/dist/components/controls/choice-control/index.d.ts +9 -0
- package/dist/components/controls/choice-control/index.js +31 -0
- package/dist/components/controls/index.d.ts +1 -0
- package/dist/components/controls/index.js +12 -10
- package/dist/components/controls/number-control/index.js +1 -1
- package/dist/components/controls/ranked-choice-control/index.d.ts +1 -0
- package/dist/components/controls/ranked-choice-control/index.js +1 -0
- package/dist/components/controls/select-control/index.d.ts +2 -1
- package/dist/components/controls/select-control/index.js +1642 -374
- package/dist/components/controls/textarea-control/index.js +1 -1
- package/dist/components/controls/toggle-control/index.js +15 -14
- package/dist/components/data-table/header.js +9 -8
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +17 -13
- package/dist/components/menu/index.js +4 -4
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/items/action.js +1 -1
- package/dist/components/menu/items/spacer.js +2 -2
- package/dist/components/menu/items/submenu.js +2 -2
- package/dist/components/menu/items/toggle.js +1 -1
- package/dist/components/progress/index.d.ts +7 -0
- package/dist/components/progress/index.js +28 -0
- package/dist/index.js +25 -17
- package/dist/{item-CPVd5mKo.js → item-Bcbx6pI-.js} +87 -87
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +6 -2
- package/dist/primitives/resizable/index.js +7 -6
- package/dist/primitives/visually-hidden/index.js +6 -0
- package/package.json +2 -1
- package/dist/components/visually-hidden/index.js +0 -5
- /package/dist/{components → primitives}/visually-hidden/index.d.ts +0 -0
- /package/dist/{components/controls/select-control → types}/options.d.ts +0 -0
- /package/dist/{components/controls/select-control → types}/options.js +0 -0
package/dist/assets/index5.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.component-
|
|
1
|
+
.component-button-group{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}
|
package/dist/assets/index6.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.component-
|
|
1
|
+
.component-base-control{display:flex;flex-direction:column}.component-base-control__label{display:block;font-weight:500;color:var(--blockout__colours__surface--950);font-size:.75rem;text-transform:uppercase;padding-bottom:.375rem}.component-base-control__label__required{color:#df1414;padding-left:.25rem}.component-base-control__box{display:flex;flex-direction:row;border:1px solid var(--blockout__colours__surface--300);background-color:var(--blockout__colours__surface--0);transition:outline .25s ease,outline-offset .25s ease,border-color .25s ease,color .25s ease}.component-base-control__box:focus-within{background-color:var(--blockout__colours__surface--0);outline:1px solid var(--blockout__colours__surface--950);outline-offset:4px}.component-base-control__control{flex-grow:1}.component-base-control__control>input,.component-base-control__control>select,.component-base-control__control>textarea{display:block;padding:.75rem;min-height:40px;width:100%;min-width:0;max-width:100%;color:var(--blockout__colours__surface--800);font-size:1rem;background-color:transparent;transition:background-color .25s ease}.component-base-control__control>input:hover,.component-base-control__control>select:hover,.component-base-control__control>textarea:hover{background-color:var(--blockout__colours__surface--50)}.component-base-control__control>input:focus,.component-base-control__control>select:focus,.component-base-control__control>textarea:focus{background-color:transparent;outline:none}.component-base-control__help{margin-top:.25rem;max-width:65ch;font-size:.75rem;font-weight:400;color:var(--blockout__colours__surface--600)}fieldset.component-base-control .component-base-control__box{border:none}fieldset.component-base-control .component-base-control__box:focus-within{outline:none}fieldset.component-base-control .component-base-control__help{order:-1;margin-top:0;margin-bottom:.75rem}
|
package/dist/assets/index7.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.component-
|
|
1
|
+
.component-choice-control__choices{display:grid;gap:1.5rem;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr))}.component-choice-control__choice{display:flex;flex-direction:row;align-items:baseline;gap:.75rem;padding:1rem;border:1px solid var(--blockout__colours__surface--300);background-color:var(--blockout__colours__surface--200);cursor:pointer;transition:background-color .25s ease,outline .25s ease,outline-offset .25s ease}.component-choice-control__choice:focus-within{outline:1px solid var(--blockout__colours__surface--950);outline-offset:4px}.component-choice-control__choice:has(input:checked){background-color:var(--blockout__colours__surface--0)}.component-choice-control__choice__icon{position:relative;border:2px solid var(--blockout__colours__surface--300);width:1rem;height:1rem;transition:border-color .25s ease;border-radius:2px;transform:translateY(.125rem)}.component-choice-control__choice:has(input:checked) .component-choice-control__choice__icon{border-color:var(--blockout__colours__surface--950)}.component-choice-control__choice__icon:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;transform:scale(0);display:block;background-color:var(--blockout__colours__primary--950);transition:transform .15s ease;border-radius:1px}.component-choice-control__choice:has(input:checked) .component-choice-control__choice__icon:after{transform:scale(.75)}.component-choice-control__choice--single .component-choice-control__choice__icon{border-radius:1rem}.component-choice-control__choice--single .component-choice-control__choice__icon:after{border-radius:1rem}.component-choice-control__choice__label{font-weight:500;color:var(--blockout__colours__surface--600);transition:color .25s ease}.component-choice-control__choice__description{font-weight:400;color:var(--blockout__colours__surface--500);font-size:.875rem;transition:color .25s ease,opacity .25s ease}.component-choice-control__choice:has(input:checked) .component-choice-control__choice__label{color:var(--blockout__colours__surface--950)}
|
package/dist/assets/index8.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.component-
|
|
1
|
+
.component-number-control__input::-webkit-outer-spin-button,.component-number-control__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.component-number-control__input{-moz-appearance:textfield}.component-number-control__spinbox{width:2rem;display:flex;flex-direction:column;border-left:1px solid var(--blockout__colours__surface--300);background-color:var(--blockout__colours__surface--0)}.component-number-control__spinbox__button{display:flex;align-items:center;justify-content:center;flex-basis:50%;cursor:pointer;transition:background-color .25s ease}.component-number-control__spinbox__button:hover{background-color:var(--blockout__colours__surface--50)}.component-number-control__spinbox__button:first-child{border-bottom:1px solid var(--blockout__colours__surface--300)}.component-number-control__spinbox__button>svg{width:.75rem;height:.75rem;fill:currentColor}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.primitive-resizable{position:relative}.primitive-resizable__handle{position:absolute;z-index:2}.primitive-resizable__handle--x{top:0;bottom:0;right:-.75rem;height:100%;width:1.5rem;cursor:ew-resize}.primitive-resizable__handle--y{left:0;right:0;bottom:-.75rem;width:100%;height:1.5rem;cursor:ns-resize}.primitive-resizable__handle:after{content:"";display:block;position:absolute;z-index:1;background-color:var(--blockout__colours__surface--950);opacity:0;transition:opacity .25s ease}.primitive-resizable__handle--x:after{top:10%;bottom:10%;left:calc(50% - 1px);height:80%;width:2px}.primitive-resizable__handle--y:after{left:10%;right:10%;top:calc(50% - 1px);width:80%;height:2px}.primitive-resizable__handle:before{content:"";display:block;position:absolute;z-index:1;border:1px solid var(--blockout__colours__surface--400);opacity:0;transform:scale(1.125);transition:opacity .25s ease,transform .25s ease}.primitive-resizable__handle--x:before{top:1rem;bottom:1rem;left:0;right:0;height:calc(100% - 2rem);width:100%;border-top:none;border-bottom:none}.primitive-resizable__handle--y:before{left:1.5rem;right:1.5rem;top:0;bottom:0;width:calc(100% - 3rem);height:100%;border-left:none;border-right:none}.primitive-resizable__handle:hover:after,.primitive-resizable__handle:focus:after,.primitive-resizable__handle[data-dragging=true]:after{opacity:1}.primitive-resizable__handle[data-dragging=true]:after{background-color:var(--blockout__colours__primary--500)}.primitive-resizable__handle:hover:before,.primitive-resizable__handle:focus:before,.primitive-resizable__handle[data-dragging=true]:before{opacity:1;transform:scale(1)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component-visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as n } from "../../utils/css.js";
|
|
3
|
-
import '../../assets/
|
|
3
|
+
import '../../assets/index5.css';const u = ({ children: o, className: t }) => /* @__PURE__ */ r("div", { className: n("component-button-group", t), children: o });
|
|
4
4
|
export {
|
|
5
5
|
u as ButtonGroup
|
|
6
6
|
};
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
3
|
-
import '../../../assets/
|
|
2
|
+
import { cn as b } from "../../../utils/css.js";
|
|
3
|
+
import '../../../assets/index6.css';const N = ({
|
|
4
|
+
as: n = "div",
|
|
4
5
|
label: c,
|
|
5
|
-
className:
|
|
6
|
-
id:
|
|
7
|
-
help:
|
|
8
|
-
children:
|
|
9
|
-
prefix:
|
|
10
|
-
suffix:
|
|
11
|
-
required:
|
|
12
|
-
}) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
] })
|
|
6
|
+
className: s,
|
|
7
|
+
id: a,
|
|
8
|
+
help: l,
|
|
9
|
+
children: r,
|
|
10
|
+
prefix: t,
|
|
11
|
+
suffix: m,
|
|
12
|
+
required: i
|
|
13
|
+
}) => {
|
|
14
|
+
const d = n, _ = n === "fieldset" ? "legend" : "label";
|
|
15
|
+
return /* @__PURE__ */ o(d, { className: b("component-base-control", s), children: [
|
|
16
|
+
/* @__PURE__ */ o(_, { className: "component-base-control__label", htmlFor: a, children: [
|
|
17
|
+
c,
|
|
18
|
+
i && /* @__PURE__ */ e("span", { className: "component-base-control__label__required", children: "*" })
|
|
19
|
+
] }),
|
|
20
|
+
/* @__PURE__ */ o("div", { className: "component-base-control__box", children: [
|
|
21
|
+
t,
|
|
22
|
+
/* @__PURE__ */ e("div", { className: "component-base-control__control", children: r }),
|
|
23
|
+
m
|
|
24
|
+
] }),
|
|
25
|
+
l && /* @__PURE__ */ e("div", { className: "component-base-control__help", children: l })
|
|
26
|
+
] });
|
|
27
|
+
};
|
|
24
28
|
export {
|
|
25
|
-
|
|
29
|
+
N as BaseControl
|
|
26
30
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Option } from '../../../types/options';
|
|
2
|
+
import { FC, InputHTMLAttributes } from 'react';
|
|
3
|
+
interface ChoiceProps extends Option, Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value"> {
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Choice: FC<ChoiceProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as n, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../../../utils/css.js";
|
|
3
|
+
import { useId as s } from "react";
|
|
4
|
+
import '../../../assets/style.css';/* empty css */
|
|
5
|
+
import { VisuallyHidden as a } from "../../../primitives/visually-hidden/index.js";
|
|
6
|
+
const x = ({
|
|
7
|
+
value: t,
|
|
8
|
+
label: r,
|
|
9
|
+
description: o,
|
|
10
|
+
disabled: l,
|
|
11
|
+
multiple: e = !1,
|
|
12
|
+
className: _,
|
|
13
|
+
...h
|
|
14
|
+
}) => {
|
|
15
|
+
const i = s();
|
|
16
|
+
return /* @__PURE__ */ n(
|
|
17
|
+
"label",
|
|
18
|
+
{
|
|
19
|
+
className: m(
|
|
20
|
+
"component-choice-control__choice",
|
|
21
|
+
`component-choice-control__choice--${e ? "multiple" : "single"}`,
|
|
22
|
+
_
|
|
23
|
+
),
|
|
24
|
+
htmlFor: i,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ c(a, { children: /* @__PURE__ */ c(
|
|
27
|
+
"input",
|
|
28
|
+
{
|
|
29
|
+
...h,
|
|
30
|
+
className: "component-choice-control__choice__input",
|
|
31
|
+
id: i,
|
|
32
|
+
type: e ? "checkbox" : "radio",
|
|
33
|
+
value: t,
|
|
34
|
+
disabled: l
|
|
35
|
+
}
|
|
36
|
+
) }),
|
|
37
|
+
/* @__PURE__ */ c(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: "component-choice-control__choice__icon"
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ n("div", { className: "component-choice-control__choice__text", children: [
|
|
45
|
+
/* @__PURE__ */ c("div", { className: "component-choice-control__choice__label", children: r }),
|
|
46
|
+
o && /* @__PURE__ */ c("p", { className: "component-choice-control__choice__description", children: o })
|
|
47
|
+
] })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
x as Choice
|
|
54
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Optionable } from '../../../types/options';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
import { ControlFC } from '../base-control/props';
|
|
4
|
+
interface ChoiceControlProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
5
|
+
options?: Optionable[];
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ChoiceControl: ControlFC<ChoiceControlProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { normalizeOption as p } from "../../../types/options.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { BaseControl as a } from "../base-control/index.js";
|
|
5
|
+
import { useBaseControlProps as f } from "../base-control/props.js";
|
|
6
|
+
import { Choice as h } from "./choice.js";
|
|
7
|
+
import '../../../assets/index7.css';const B = (t) => {
|
|
8
|
+
const { baseProps: r, controlProps: n } = f(t, {
|
|
9
|
+
className: "component-choice-control"
|
|
10
|
+
}), {
|
|
11
|
+
options: s,
|
|
12
|
+
multiple: i = !1,
|
|
13
|
+
name: c = r.id,
|
|
14
|
+
value: d,
|
|
15
|
+
// Remove value from restControlProps
|
|
16
|
+
...m
|
|
17
|
+
} = n, l = (s || []).map(p);
|
|
18
|
+
return /* @__PURE__ */ o(a, { as: "fieldset", ...r, children: /* @__PURE__ */ o("div", { className: "component-choice-control__choices", children: l.map((e) => /* @__PURE__ */ o(
|
|
19
|
+
h,
|
|
20
|
+
{
|
|
21
|
+
name: c,
|
|
22
|
+
multiple: i,
|
|
23
|
+
...e,
|
|
24
|
+
...m
|
|
25
|
+
},
|
|
26
|
+
e.value
|
|
27
|
+
)) }) });
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
B as ChoiceControl
|
|
31
|
+
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { BaseControl as t } from "./base-control/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { ChoiceControl as l } from "./choice-control/index.js";
|
|
3
|
+
import { NumberControl as m } from "./number-control/index.js";
|
|
4
|
+
import { SelectControl as f } from "./select-control/index.js";
|
|
5
|
+
import { TextControl as p } from "./text-control/index.js";
|
|
6
|
+
import { TextareaControl as T } from "./textarea-control/index.js";
|
|
7
|
+
import { ToggleControl as g } from "./toggle-control/index.js";
|
|
7
8
|
export {
|
|
8
9
|
t as BaseControl,
|
|
9
|
-
l as
|
|
10
|
-
m as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
T as
|
|
10
|
+
l as ChoiceControl,
|
|
11
|
+
m as NumberControl,
|
|
12
|
+
f as SelectControl,
|
|
13
|
+
p as TextControl,
|
|
14
|
+
T as TextareaControl,
|
|
15
|
+
g as ToggleControl
|
|
14
16
|
};
|
|
@@ -4,7 +4,7 @@ import { r as u } from "../../../CaretUp.es-Cy8czlHG.js";
|
|
|
4
4
|
import { useRef as p } from "react";
|
|
5
5
|
import { BaseControl as a } from "../base-control/index.js";
|
|
6
6
|
import { useBaseControlProps as b } from "../base-control/props.js";
|
|
7
|
-
import '../../../assets/
|
|
7
|
+
import '../../../assets/index8.css';const h = (t) => {
|
|
8
8
|
const o = p(null), c = () => /* @__PURE__ */ i("div", { className: "component-number-control__spinbox", children: [
|
|
9
9
|
/* @__PURE__ */ n(
|
|
10
10
|
"button",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { Optionable } from '../../../types/options';
|
|
1
2
|
import { ControlFC } from '../base-control/props';
|
|
2
|
-
import { Optionable } from './options';
|
|
3
3
|
import * as Ariakit from "@ariakit/react";
|
|
4
4
|
interface SelectControlProps extends Ariakit.SelectOptions {
|
|
5
5
|
options?: Optionable[];
|
|
6
|
+
searchable?: boolean;
|
|
6
7
|
placeholder?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const SelectControl: ControlFC<SelectControlProps>;
|