@wrdagency/blockout 0.0.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/dist/2NBKRL7C-DnAMmXv4.js +81 -0
- package/dist/CaretDown.es-eySGHzTJ.js +32 -0
- package/dist/CaretUp.es-Cy8czlHG.js +32 -0
- package/dist/P7GR5CS5-BryEvRCz.js +621 -0
- package/dist/SSRBase.es-BUXS72ra.js +33 -0
- package/dist/T7VMP3TM--1s529fr.js +3544 -0
- package/dist/UQQRIHDV-Bfi_RJby.js +1046 -0
- package/dist/VIIRIBF3-XWA2y8Hu.js +21 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/components/button/index.d.ts +9 -0
- package/dist/components/button/index.js +28 -0
- package/dist/components/button-group/index.d.ts +6 -0
- package/dist/components/button-group/index.js +6 -0
- package/dist/components/controls/base-control/index.d.ts +3 -0
- package/dist/components/controls/base-control/index.js +26 -0
- package/dist/components/controls/base-control/props.d.ts +23 -0
- package/dist/components/controls/base-control/props.js +21 -0
- package/dist/components/controls/index.d.ts +6 -0
- package/dist/components/controls/index.js +14 -0
- package/dist/components/controls/number-control/index.d.ts +6 -0
- package/dist/components/controls/number-control/index.js +52 -0
- package/dist/components/controls/select-control/index.d.ts +9 -0
- package/dist/components/controls/select-control/index.js +591 -0
- package/dist/components/controls/select-control/options.d.ts +11 -0
- package/dist/components/controls/select-control/options.js +12 -0
- package/dist/components/controls/text-control/index.d.ts +6 -0
- package/dist/components/controls/text-control/index.js +12 -0
- package/dist/components/controls/textarea-control/index.d.ts +6 -0
- package/dist/components/controls/textarea-control/index.js +18 -0
- package/dist/components/controls/toggle-control/index.d.ts +8 -0
- package/dist/components/controls/toggle-control/index.js +46 -0
- package/dist/components/data-table/column.d.ts +4 -0
- package/dist/components/data-table/column.js +874 -0
- package/dist/components/data-table/context.d.ts +7 -0
- package/dist/components/data-table/context.js +36 -0
- package/dist/components/data-table/example.d.ts +1 -0
- package/dist/components/data-table/example.js +5 -0
- package/dist/components/data-table/footer.d.ts +2 -0
- package/dist/components/data-table/footer.js +23 -0
- package/dist/components/data-table/header.d.ts +7 -0
- package/dist/components/data-table/header.js +408 -0
- package/dist/components/data-table/index.d.ts +10 -0
- package/dist/components/data-table/index.js +86 -0
- package/dist/components/data-table/types.d.ts +75 -0
- package/dist/components/data-table/types.js +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +23 -0
- package/dist/components/menu/icon.d.ts +4 -0
- package/dist/components/menu/icon.js +6 -0
- package/dist/components/menu/index.d.ts +8 -0
- package/dist/components/menu/index.js +131 -0
- package/dist/components/menu/item.d.ts +7 -0
- package/dist/components/menu/item.js +8 -0
- package/dist/components/menu/items/action.d.ts +7 -0
- package/dist/components/menu/items/action.js +23 -0
- package/dist/components/menu/items/spacer.d.ts +2 -0
- package/dist/components/menu/items/spacer.js +46 -0
- package/dist/components/menu/items/submenu.d.ts +7 -0
- package/dist/components/menu/items/submenu.js +7 -0
- package/dist/components/menu/items/toggle.d.ts +7 -0
- package/dist/components/menu/items/toggle.js +109 -0
- package/dist/components/menu/types.d.ts +28 -0
- package/dist/components/menu/types.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -0
- package/dist/item-CPVd5mKo.js +758 -0
- package/dist/primitives/draggable/index.d.ts +17 -0
- package/dist/primitives/draggable/index.js +52 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/resizable/index.d.ts +7 -0
- package/dist/primitives/resizable/index.js +76 -0
- package/dist/types/component.d.ts +4 -0
- package/dist/types/component.js +1 -0
- package/dist/types/math.d.ts +10 -0
- package/dist/types/math.js +1 -0
- package/dist/utils/css.d.ts +1 -0
- package/dist/utils/css.js +6 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/noop.js +5 -0
- package/package.json +61 -0
- package/readme.md +3 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { c as r, P as t, o as v, C as a, a as d } from "./P7GR5CS5-BryEvRCz.js";
|
|
2
|
+
import { createContext as n } from "react";
|
|
3
|
+
var o = r(
|
|
4
|
+
[v],
|
|
5
|
+
[t]
|
|
6
|
+
), P = o.useProviderContext, C = o.ContextProvider, x = o.ScopedContextProvider, e = r(
|
|
7
|
+
[d, C],
|
|
8
|
+
[a, x]
|
|
9
|
+
), c = e.useContext, p = e.useScopedContext, u = e.useProviderContext, S = e.ContextProvider, m = e.ScopedContextProvider;
|
|
10
|
+
n(
|
|
11
|
+
void 0
|
|
12
|
+
);
|
|
13
|
+
export {
|
|
14
|
+
x as H,
|
|
15
|
+
m as M,
|
|
16
|
+
c as a,
|
|
17
|
+
P as b,
|
|
18
|
+
u as c,
|
|
19
|
+
S as d,
|
|
20
|
+
p as u
|
|
21
|
+
};
|
|
@@ -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-menu__button{outline:0px solid transparent;outline-offset:0px;cursor:pointer;transition:background-color .25s ease,outline .25s ease,outline-offset .25s ease}.component-menu__button:hover{background-color:var(--blockout__colours__surface--50)}.component-menu__button:focus-visible{background-color:transparent;outline:1px solid var(--blockout__colours__surface--950);outline-offset:4px}.component-menu__menu-wrapper{z-index:9999!important}.component-menu{display:flex;flex-direction:column;background-color:var(--blockout__colours__surface--0);border:1px solid var(--blockout__colours__surface--300);min-width:8rem;gap:.325rem;padding:.325rem;box-shadow:0 .175rem .375rem #0000001a}.component-menu__arrow>svg{fill:var(--blockout__colours__surface--0)!important;stroke:var(--blockout__colours__surface--300)!important}.component-menu__item{display:flex;align-items:baseline;gap:.875rem;padding:.375rem .675rem;width:100%;cursor:pointer;transition:background-color .25s ease}.component-menu__item[data-active-item=true]{background-color:var(--blockout__colours__primary--50)}.component-menu__item:focus-visible{outline:none}.component-menu__item[data-active-item=true] .component-menu__item__label{color:var(--blockout__colours__primary--950)}.component-menu__item[data-active-item=true] .component-menu__item__description{color:var(--blockout__colours__primary--900);opacity:.7}.component-menu__item__icon{width:1.25rem;height:1.25rem;fill:var(--blockout__colours__surface--400)}.component-menu__item__icon--pictoral{transform:translateY(.25rem)}.component-menu__item__text{flex-grow:1}.component-menu__item__text__header{display:flex;align-items:center;gap:2rem;justify-content:space-between;width:100%}.component-menu__item__text__header+.component-menu__item__description{margin-top:.25rem}.component-menu__item__label{font-weight:500;color:var(--blockout__colours__surface--950);transition:color .25s ease}.component-menu__item__description{font-weight:400;color:var(--blockout__colours__surface--500);font-size:.875rem;padding-right:.375rem;transition:color .25s ease,opacity .25s ease}.component-menu__item--toggle--checked .component-menu__item__icon--checkbox{fill:var(--blockout__colours__surface--950)}.component-menu__separator{margin:0 -.325rem;border-top:1px solid var(--blockout__colours__surface--300);border-bottom:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component-select-control__input{-webkit-appearance:none;-moz-appearance:none;cursor:pointer;display:flex;width:100%}.component-select-control__input:focus{outline:none}.component-select-control__value{flex-grow:1;padding:.75rem;min-height:40px;width:100%;min-width:0;max-width:100%;color:var(--blockout__colours__surface--800);font-size:1rem;text-align:left;background-color:transparent;transition:background-color .25s ease}.component-select-control__value:hover{background-color:var(--blockout__colours__surface--50)}.component-select-control__caret{width:2rem;display:flex;justify-content:center;align-items:center;border-left:1px solid var(--blockout__colours__surface--300);background-color:var(--blockout__colours__surface--0);cursor:pointer;transition:background-color .25s ease}.component-select-control__caret:hover{background-color:var(--blockout__colours__surface--50)}.component-select-control__caret>svg{width:.75rem;height:.75rem;fill:currentColor}.component-select-control__popover__wrapper{z-index:9999!important}.component-select-control__popover{display:flex;flex-direction:column;gap:.325rem;padding:.325rem;background-color:var(--blockout__colours__surface--0);border:1px solid var(--blockout__colours__surface--300);box-shadow:0 .175rem .375rem #0000001a;width:calc(var(--popover-anchor-width) + 2px);max-height:var(--popover-available-height);overflow-y:auto}.component-select-control__popover:focus{outline:none}.component-select-control__option{display:flex;justify-content:start;align-items:start;flex-direction:column;gap:.25rem;padding:.375rem .675rem;min-height:40px;cursor:pointer;transition:background-color .25s ease}.component-select-control__option:first-child{border-top:none}.component-select-control__option__label{font-weight:500;color:var(--blockout__colours__surface--950);transition:color .25s ease}.component-select-control__option__description{font-weight:400;color:var(--blockout__colours__surface--500);font-size:.875rem;transition:color .25s ease,opacity .25s ease}.component-select-control__option[data-active-item=true]{background-color:var(--blockout__colours__primary--50)}.component-select-control__option[data-active-item=true] .component-select-control__option__label{color:var(--blockout__colours__primary--950)}.component-select-control__option[data-active-item=true] .component-select-control__option__description{color:var(--blockout__colours__primary--900);opacity:.7}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component-toggle-control__buttons{display:flex;overflow:hidden}.component-toggle-control__on,.component-toggle-control__off{padding:.5rem .75rem;min-height:40px;width:100%;color:var(--blockout__colours__surface--800);font-size:1rem;font-weight:500;flex-basis:50%;cursor:pointer;position:relative;transition:color .25s ease,background-color .25s ease}.component-toggle-control__on{border-right:1px solid var(--blockout__colours__surface--300)}.component-toggle-control__on,.component-toggle-control__buttons:has(input:checked) .component-toggle-control__off{background-color:var(--blockout__colours__surface--100);color:var(--blockout__colours__surface--600);box-shadow:none;z-index:1}.component-toggle-control__off,.component-toggle-control__buttons:has(input:checked) .component-toggle-control__on{background-color:var(--blockout__colours__surface--0);color:var(--blockout__colours__surface--950);box-shadow:0 0 .75rem .125rem #0003;z-index:2}
|
|
@@ -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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component-textarea-control__input{min-height:5rem!important;max-height:85vh!important;resize:vertical}
|
|
@@ -0,0 +1 @@
|
|
|
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
|
+
.component-button{--button__bg: var(--blockout__colours__primary--500);--button__bg--hover: var(--blockout__colours__primary--600);--button__text: var(--blockout__colours__surface--50);--button__text--hover: var(--blockout__colours__surface--50);display:flex;align-items:center;justify-content:center;gap:1rem;padding:.75rem 1.25rem;min-height:40px;font-size:1rem;width:fit-content;background-color:var(--button__bg);color:var(--button__text);cursor:pointer;outline:0px solid transparent;outline-offset:0px;transition:background-color .25s ease,outline .25s ease,outline-offset .25s ease,border-color .25s ease,color .25s ease}.component-button>svg{width:1.25rem;height:1.25rem;color:currentColor}.component-button:hover{background-color:var(--button__bg--hover);color:var(--button__text--hover)}.component-button:focus{background-color:var(--button__bg--hover);color:var(--button__text--hover);outline:1px solid var(--blockout__colours__surface--950);outline-offset:4px}.component-button:active{outline-offset:3px}.component-button--wide{width:100%}.component-button--outline{border:2px solid var(--button__bg);color:var(--button__bg);background-color:transparent}.component-button--outline:hover{border:2px solid var(--button__bg--hover);color:var(--button__bg--hover);background-color:transparent}.component-button--outline:focus{border:2px solid var(--button__bg--hover);color:var(--button__bg--hover);background-color:transparent}.component-button--primary{--button__bg: var(--blockout__colours__primary--500);--button__bg--hover: var(--blockout__colours__primary--600);--button__text: var(--blockout__colours__surface--50);--button__text--hover: var(--blockout__colours__surface--50)}.component-button--dark{--button__bg: var(--blockout__colours__surface--950);--button__bg--hover: var(--blockout__colours__surface--900);--button__text: var(--blockout__colours__surface--50);--button__text--hover: var(--blockout__colours__surface--50)}.component-button--light{--button__bg: var(--blockout__colours__surface--100);--button__bg--hover: var(--blockout__colours__surface--200);--button__text: var(--blockout__colours__surface--950);--button__text--hover: var(--blockout__colours__surface--950)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component-button-group{display:flex;flex-direction:row;flex-wrap:wrap;gap:1rem}
|
|
@@ -0,0 +1 @@
|
|
|
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;font-size:.75rem;font-weight:400;color:var(--blockout__colours__surface--600)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.component-data-table__table{border-collapse:separate;border-spacing:0}.component-data-table__th__target,.component-data-table__td{padding:1.25rem;border-bottom:1px solid var(--blockout__colours__surface--300)}.component-data-table__th:first-child .component-data-table__th__target,.component-data-table__td:first-child{padding-left:.25rem}.component-data-table__th:last-child .component-data-table__th__target,.component-data-table__td:last-child{padding-right:.25rem}.component-data-table__th{text-align:left;font-weight:500}.component-data-table__th__target{display:flex;align-items:center;gap:.75rem;width:100%;height:100%;font-weight:500}.component-data-table__th__sort-indicator{width:1rem;height:1rem;fill:var(--blockout__colours__surface--400)}.component-data-table__td{white-space:nowrap}.component-data-table__td--sticky,.component-data-table__th--sticky{position:sticky;left:0;background-color:var(--blockout__colours__surface--0)}.component-data-table__td--sticky:after,.component-data-table__th--sticky:after{content:"";position:absolute;top:-1px;left:100%;bottom:0;width:1rem;pointer-events:none;background:linear-gradient(90deg,#00000016,#0000)}.component-data-table__tfoot .component-data-table__td{padding-top:.75rem;padding-bottom:.75rem;font-size:.875rem;color:var(--blockout__colours__surface--600)}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
variant?: "primary" | "light" | "dark";
|
|
5
|
+
wide?: boolean;
|
|
6
|
+
outline?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Button: FC<ButtonProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { cn as c } from "../../utils/css.js";
|
|
3
|
+
import '../../assets/index6.css';const a = ({
|
|
4
|
+
children: t,
|
|
5
|
+
className: o,
|
|
6
|
+
variant: n = "primary",
|
|
7
|
+
wide: e = !1,
|
|
8
|
+
outline: m = !1,
|
|
9
|
+
type: r = "button",
|
|
10
|
+
...u
|
|
11
|
+
}) => /* @__PURE__ */ p(
|
|
12
|
+
"button",
|
|
13
|
+
{
|
|
14
|
+
type: r,
|
|
15
|
+
className: c(
|
|
16
|
+
o,
|
|
17
|
+
"component-button",
|
|
18
|
+
`component-button--${n}`,
|
|
19
|
+
e && "component-button--wide",
|
|
20
|
+
m && "component-button--outline"
|
|
21
|
+
),
|
|
22
|
+
...u,
|
|
23
|
+
children: t
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
export {
|
|
27
|
+
a as Button
|
|
28
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../utils/css.js";
|
|
3
|
+
import '../../assets/index7.css';const u = ({ children: o, className: t }) => /* @__PURE__ */ r("div", { className: n("component-button-group", t), children: o });
|
|
4
|
+
export {
|
|
5
|
+
u as ButtonGroup
|
|
6
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../../utils/css.js";
|
|
3
|
+
import '../../../assets/index8.css';const d = ({
|
|
4
|
+
label: c,
|
|
5
|
+
className: l,
|
|
6
|
+
id: s,
|
|
7
|
+
help: n,
|
|
8
|
+
children: a,
|
|
9
|
+
prefix: r,
|
|
10
|
+
suffix: t,
|
|
11
|
+
required: m
|
|
12
|
+
}) => /* @__PURE__ */ o("div", { className: i("component-base-control", l), children: [
|
|
13
|
+
/* @__PURE__ */ o("label", { className: "component-base-control__label", htmlFor: s, children: [
|
|
14
|
+
c,
|
|
15
|
+
m && /* @__PURE__ */ e("span", { className: "component-base-control__label__required", children: "*" })
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ o("div", { className: "component-base-control__box", children: [
|
|
18
|
+
r,
|
|
19
|
+
/* @__PURE__ */ e("div", { className: "component-base-control__control", children: a }),
|
|
20
|
+
t
|
|
21
|
+
] }),
|
|
22
|
+
n && /* @__PURE__ */ e("div", { className: "component-base-control__help", children: n })
|
|
23
|
+
] });
|
|
24
|
+
export {
|
|
25
|
+
d as BaseControl
|
|
26
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export type CommonProps = {
|
|
3
|
+
label?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
help?: string;
|
|
6
|
+
prefix?: ReactNode;
|
|
7
|
+
suffix?: ReactNode;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type BaseProps = CommonProps & {
|
|
11
|
+
id: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export type ControlProps<T> = CommonProps & T;
|
|
15
|
+
export type ControlFC<T> = FC<ControlProps<T>>;
|
|
16
|
+
type UseBaseControlPropsReturn<T> = {
|
|
17
|
+
baseProps: BaseProps;
|
|
18
|
+
controlProps: T & {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare function useBaseControlProps<T>(props: ControlProps<T>, overrideProps?: CommonProps): UseBaseControlPropsReturn<T>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cn as m } from "../../../utils/css.js";
|
|
2
|
+
import { useId as u } from "react";
|
|
3
|
+
function x(e, s = {}) {
|
|
4
|
+
const { label: t, help: c, prefix: n, suffix: a, className: l, ...o } = e, r = u(), p = {
|
|
5
|
+
id: r,
|
|
6
|
+
label: t,
|
|
7
|
+
help: c,
|
|
8
|
+
prefix: n,
|
|
9
|
+
suffix: a,
|
|
10
|
+
required: o.required,
|
|
11
|
+
...s,
|
|
12
|
+
className: m(l, s.className)
|
|
13
|
+
}, i = { ...o, id: r };
|
|
14
|
+
return {
|
|
15
|
+
baseProps: p,
|
|
16
|
+
controlProps: i
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
x as useBaseControlProps
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BaseControl } from './base-control';
|
|
2
|
+
export { NumberControl } from './number-control';
|
|
3
|
+
export { SelectControl } from './select-control';
|
|
4
|
+
export { TextControl } from './text-control';
|
|
5
|
+
export { TextareaControl } from './textarea-control';
|
|
6
|
+
export { ToggleControl } from './toggle-control';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseControl as t } from "./base-control/index.js";
|
|
2
|
+
import { NumberControl as l } from "./number-control/index.js";
|
|
3
|
+
import { SelectControl as m } from "./select-control/index.js";
|
|
4
|
+
import { TextControl as n } from "./text-control/index.js";
|
|
5
|
+
import { TextareaControl as C } from "./textarea-control/index.js";
|
|
6
|
+
import { ToggleControl as T } from "./toggle-control/index.js";
|
|
7
|
+
export {
|
|
8
|
+
t as BaseControl,
|
|
9
|
+
l as NumberControl,
|
|
10
|
+
m as SelectControl,
|
|
11
|
+
n as TextControl,
|
|
12
|
+
C as TextareaControl,
|
|
13
|
+
T as ToggleControl
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { ControlFC } from '../base-control/props';
|
|
3
|
+
interface NumberControlProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
4
|
+
}
|
|
5
|
+
export declare const NumberControl: ControlFC<NumberControlProps>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { e as l } from "../../../CaretDown.es-eySGHzTJ.js";
|
|
3
|
+
import { r as u } from "../../../CaretUp.es-Cy8czlHG.js";
|
|
4
|
+
import { useRef as a } from "react";
|
|
5
|
+
import { BaseControl as p } from "../base-control/index.js";
|
|
6
|
+
import { useBaseControlProps as b } from "../base-control/props.js";
|
|
7
|
+
import '../../../assets/index5.css';const h = (r) => {
|
|
8
|
+
const o = a(null), c = () => /* @__PURE__ */ i("div", { className: "component-number-control__spinbox", children: [
|
|
9
|
+
/* @__PURE__ */ n(
|
|
10
|
+
"button",
|
|
11
|
+
{
|
|
12
|
+
className: "component-number-control__spinbox__button",
|
|
13
|
+
"aria-label": "Increment",
|
|
14
|
+
role: "spinbutton",
|
|
15
|
+
"aria-controls": r.id,
|
|
16
|
+
onClick: () => e(1),
|
|
17
|
+
tabIndex: -1,
|
|
18
|
+
children: /* @__PURE__ */ n(u, {})
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ n(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
className: "component-number-control__spinbox__button",
|
|
25
|
+
"aria-label": "Decrement",
|
|
26
|
+
role: "spinbutton",
|
|
27
|
+
"aria-controls": r.id,
|
|
28
|
+
onClick: () => e(-1),
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
children: /* @__PURE__ */ n(l, {})
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }), e = (t) => {
|
|
34
|
+
o.current && (t > 0 ? o.current.stepUp(t) : o.current.stepDown(t * -1), o.current.focus());
|
|
35
|
+
}, { baseProps: s, controlProps: m } = b(r, {
|
|
36
|
+
className: "component-number-control",
|
|
37
|
+
suffix: /* @__PURE__ */ n(c, {})
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ n(p, { ...s, children: /* @__PURE__ */ n(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
className: "component-number-control__input",
|
|
43
|
+
type: "number",
|
|
44
|
+
inputMode: "numeric",
|
|
45
|
+
ref: o,
|
|
46
|
+
...m
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
h as NumberControl
|
|
52
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ControlFC } from '../base-control/props';
|
|
2
|
+
import { Optionable } from './options';
|
|
3
|
+
import * as Ariakit from "@ariakit/react";
|
|
4
|
+
interface SelectControlProps extends Ariakit.SelectOptions {
|
|
5
|
+
options?: Optionable[];
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const SelectControl: ControlFC<SelectControlProps>;
|
|
9
|
+
export {};
|