@sito/dashboard 0.0.65 → 0.0.67
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 +3 -2
- package/dist/Badge-CIeYthEy.js +9 -0
- package/dist/Badge-Z78MlGoQ.cjs +1 -0
- package/dist/Badge.cjs +1 -0
- package/dist/Badge.css +1 -0
- package/dist/Badge.d.ts +2 -0
- package/dist/Badge.js +4 -0
- package/dist/Button-BlYa3uPc.cjs +1 -0
- package/dist/Button-D73-swfo.js +24 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.css +1 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.js +4 -0
- package/dist/Chip-C5ogKbFn.js +37 -0
- package/dist/Chip-D17UJHW6.cjs +1 -0
- package/dist/Chip.cjs +1 -0
- package/dist/Chip.css +1 -0
- package/dist/Chip.d.ts +2 -0
- package/dist/Chip.js +4 -0
- package/dist/Close-O9P7wJGf.cjs +1 -0
- package/dist/Close-rKC9AcNX.js +17 -0
- package/dist/Dropdown-CAxauIXt.cjs +1 -0
- package/dist/Dropdown-CbaxuMbk.js +63 -0
- package/dist/Dropdown.cjs +1 -0
- package/dist/Dropdown.css +1 -0
- package/dist/Dropdown.d.ts +2 -0
- package/dist/Dropdown.js +4 -0
- package/dist/File-BuJndWMv.js +17 -0
- package/dist/File-_Hjw2d3F.cjs +1 -0
- package/dist/FileInput-Ch-GCxrS.cjs +1 -0
- package/dist/FileInput-DCR_Pyqe.js +91 -0
- package/dist/FileInput.css +1 -0
- package/dist/Filters-DL5jd8ps.js +78 -0
- package/dist/Filters-Dyee8QYH.cjs +1 -0
- package/dist/FiltersProvider-CY2fsw_F.js +57 -0
- package/dist/FiltersProvider-CYqLFEI9.cjs +1 -0
- package/dist/FiltersProvider.cjs +1 -0
- package/dist/FiltersProvider.d.ts +2 -0
- package/dist/FiltersProvider.js +8 -0
- package/dist/Form.cjs +1 -0
- package/dist/Form.d.ts +2 -0
- package/dist/Form.js +13 -0
- package/dist/IconButton-BpsTEj0z.js +29 -0
- package/dist/IconButton-CVnmT2E9.cjs +1 -0
- package/dist/IconButton.cjs +1 -0
- package/dist/IconButton.css +1 -0
- package/dist/IconButton.d.ts +2 -0
- package/dist/IconButton.js +4 -0
- package/dist/Loading-B_c_4XLr.js +26 -0
- package/dist/Loading-CNECRan-.cjs +1 -0
- package/dist/Loading.cjs +1 -0
- package/dist/Loading.css +1 -0
- package/dist/Loading.d.ts +2 -0
- package/dist/Loading.js +4 -0
- package/dist/SvgIcons.cjs +1 -0
- package/dist/SvgIcons.d.ts +2 -0
- package/dist/SvgIcons.js +13 -0
- package/dist/Table-BtZGG0d7.js +1056 -0
- package/dist/Table-DjIhOMXQ.cjs +1 -0
- package/dist/Table.cjs +1 -0
- package/dist/Table.css +1 -0
- package/dist/Table.d.ts +2 -0
- package/dist/Table.js +18 -0
- package/dist/TableOptions.cjs +1 -0
- package/dist/TableOptions.d.ts +2 -0
- package/dist/TableOptions.js +5 -0
- package/dist/TableOptionsProvider-BchUDA3B.cjs +1 -0
- package/dist/TableOptionsProvider-BfQS8l1N.js +50 -0
- package/dist/TextInput-BqW5YX-3.js +320 -0
- package/dist/TextInput-CY1fh4mf.cjs +1 -0
- package/dist/TextInput.css +1 -0
- package/dist/Tooltip-B4E-FRwY.js +37 -0
- package/dist/Tooltip-BSKAgRkc.cjs +1 -0
- package/dist/Tooltip.cjs +1 -0
- package/dist/Tooltip.css +1 -0
- package/dist/Tooltip.d.ts +2 -0
- package/dist/Tooltip.js +4 -0
- package/dist/Translation.cjs +1 -0
- package/dist/Translation.d.ts +2 -0
- package/dist/Translation.js +5 -0
- package/dist/TranslationProvider-51Pc9Xrr.cjs +1 -0
- package/dist/TranslationProvider-COebIyxr.js +19 -0
- package/dist/components/Actions/Action.d.ts +18 -0
- package/dist/components/Actions/Actions.d.ts +14 -0
- package/dist/components/Actions/Actions.stories.d.ts +20 -0
- package/dist/components/Actions/Actions.test.d.ts +1 -0
- package/dist/components/Actions/ActionsDropdown.d.ts +10 -0
- package/dist/components/Actions/ActionsDropdown.stories.d.ts +17 -0
- package/dist/components/Actions/ActionsDropdown.test.d.ts +1 -0
- package/dist/components/Actions/index.d.ts +4 -0
- package/dist/components/Actions/types.d.ts +17 -0
- package/dist/components/Button/Button.stories.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.stories.d.ts +1 -0
- package/dist/components/Dropdown/types.d.ts +1 -0
- package/dist/components/Form/FileInput/FileInput.test.d.ts +1 -0
- package/dist/components/Form/TextInput/TextInput.stories.d.ts +1 -0
- package/dist/components/Form/TextInput/TextInput.test.d.ts +1 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +1 -0
- package/dist/components/SvgIcons/Ellipsis.d.ts +7 -0
- package/dist/components/SvgIcons/index.d.ts +1 -0
- package/dist/components/Table/Table.stories.d.ts +1 -0
- package/dist/components/Table/types.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +1 -0
- package/dist/index.js +74 -0
- package/dist/lib.cjs +1 -0
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +6 -0
- package/dist/query-81BrXp3i.cjs +1 -0
- package/dist/query-CwuehjY1.js +4 -0
- package/dist/setupTests.d.ts +0 -0
- package/package.json +83 -9
- package/dist/dashboard.cjs +0 -1
- package/dist/dashboard.js +0 -1661
- package/dist/main.css +0 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## Highlights
|
|
6
6
|
|
|
7
7
|
- `Table` component with sorting, filtering, pagination, row selection, bulk actions, and expandable rows.
|
|
8
|
-
- Reusable UI pieces: `Badge`, `Button`, `Chip`, `Dropdown`, `IconButton`, `Loading`, `Tooltip`, and `
|
|
8
|
+
- Reusable UI pieces: `Badge`, `Button`, `Chip`, `Dropdown`, `IconButton`, `Loading`, `Tooltip`, `SvgIcons`, `Actions`, and `ActionsDropdown`.
|
|
9
9
|
- Form controls: `TextInput`, `SelectInput`, `AutocompleteInput`, `CheckInput`, and `FileInput`.
|
|
10
10
|
- Built-in providers for translations and table state (`TranslationProvider`, `TableOptionsProvider`).
|
|
11
11
|
|
|
@@ -77,6 +77,7 @@ export function UsersTable() {
|
|
|
77
77
|
tooltip: `View ${row.name}`,
|
|
78
78
|
icon: <span>View</span>,
|
|
79
79
|
onClick: () => console.log("View", row),
|
|
80
|
+
sticky: true, // always visible; omit to place in the ellipsis dropdown
|
|
80
81
|
},
|
|
81
82
|
]}
|
|
82
83
|
/>
|
|
@@ -113,7 +114,7 @@ export function UsersTable() {
|
|
|
113
114
|
|
|
114
115
|
Main package exports include:
|
|
115
116
|
|
|
116
|
-
- Components: `Badge`, `Button`, `Chip`, `Dropdown`, `Form`, `IconButton`, `Loading`, `SvgIcons`, `Table`, `Tooltip`.
|
|
117
|
+
- Components: `Action`, `Actions`, `ActionsDropdown`, `Badge`, `Button`, `Chip`, `Dropdown`, `Form`, `IconButton`, `Loading`, `SvgIcons`, `Table`, `Tooltip`.
|
|
117
118
|
- Providers: `FiltersProvider`, `TableOptionsProvider`, `TranslationProvider` and related hooks/types.
|
|
118
119
|
- Utilities and models: `FilterTypes`, `SortOrder`, `BaseDto`, and query/filter helpers from `lib`.
|
|
119
120
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=require("./Badge.css");const n=require("react/jsx-runtime"),t=s=>{const{count:e,className:a=""}=s;return n.jsx("span",{className:`${a} badge-main`,children:e})};exports.Badge=t;
|
package/dist/Badge.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Badge-Z78MlGoQ.cjs");exports.Badge=e.Badge;
|
package/dist/Badge.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}.badge-main{top:calc(var(--spacing,.25rem) * 1);right:calc(var(--spacing,.25rem) * 1);min-height:calc(var(--spacing,.25rem) * 4);min-width:calc(var(--spacing,.25rem) * 4);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));--tw-duration:.3s;--tw-ease:var(--ease-in-out,cubic-bezier(.4, 0, .2, 1));transition-duration:.3s;transition-timing-function:var(--ease-in-out,cubic-bezier(.4, 0, .2, 1));border-radius:3.40282e38px;justify-content:center;align-items:center;font-size:9px;line-height:0;display:flex;position:absolute}.badge-main.show{--tw-scale-x:100%!important;--tw-scale-y:100%!important;--tw-scale-z:100%!important;scale:var(--tw-scale-x) var(--tw-scale-y)!important}.badge-main.hide{--tw-scale-x:0%!important;--tw-scale-y:0%!important;--tw-scale-z:0%!important;scale:var(--tw-scale-x) var(--tw-scale-y)!important}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}
|
package/dist/Badge.d.ts
ADDED
package/dist/Badge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=require("./Button.css");const c=require("react/jsx-runtime"),a=t=>{const{children:e,type:n="button",variant:s="text",color:o="default",className:r="",...u}=t;return c.jsx("button",{type:n,className:`button ${s} ${o} ${r}`,...u,children:e})};exports.Button=a;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "./Button.css";
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
|
+
const m = (t) => {
|
|
4
|
+
const {
|
|
5
|
+
children: o,
|
|
6
|
+
type: r = "button",
|
|
7
|
+
variant: e = "text",
|
|
8
|
+
color: n = "default",
|
|
9
|
+
className: s = "",
|
|
10
|
+
...a
|
|
11
|
+
} = t;
|
|
12
|
+
return /* @__PURE__ */ c(
|
|
13
|
+
"button",
|
|
14
|
+
{
|
|
15
|
+
type: r,
|
|
16
|
+
className: `button ${e} ${n} ${s}`,
|
|
17
|
+
...a,
|
|
18
|
+
children: o
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
m as B
|
|
24
|
+
};
|
package/dist/Button.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Button-BlYa3uPc.cjs");exports.Button=t.Button;
|
package/dist/Button.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-duration:initial;--tw-border-style:solid}}}.button{justify-content:center;align-items:center;gap:calc(var(--spacing,.25rem) * 2);padding-inline:calc(var(--spacing,.25rem) * 4);padding-block:calc(var(--spacing,.25rem) * 2);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500);color:var(--color-text,#0d0d0d);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));--tw-duration:.3s;border-radius:3.40282e38px;transition-duration:.3s;display:flex}.button:enabled{cursor:pointer}.button:disabled{cursor:not-allowed;opacity:.5}@media(hover:hover){.button.close:enabled:hover{background-color:var(--color-secondary,#cd212a)}}.button.text{background-color:#0000}@media(hover:hover){.button.text:enabled:hover{background-color:var(--color-base,#f2f2f2)}}.button.text.primary{color:var(--color-primary,#041e42)}@media(hover:hover){.button.text.primary:enabled:hover{background-color:#041e421a}@supports (color:color-mix(in lab,red,red)){.button.text.primary:enabled:hover{background-color:color-mix(in oklab,var(--color-primary,#041e42) 10%,transparent)}}}.button.text.secondary{color:var(--color-secondary,#cd212a)}@media(hover:hover){.button.text.secondary:enabled:hover{background-color:#cd212a1a}@supports (color:color-mix(in lab,red,red)){.button.text.secondary:enabled:hover{background-color:color-mix(in oklab,var(--color-secondary,#cd212a) 10%,transparent)}}}.button.text.error{color:var(--color-bg-error,#c14444)}@media(hover:hover){.button.text.error:enabled:hover{background-color:#c144441a}@supports (color:color-mix(in lab,red,red)){.button.text.error:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-error,#c14444) 10%,transparent)}}}.button.text.warning{color:var(--color-bg-warning,orange)}@media(hover:hover){.button.text.warning:enabled:hover{background-color:#ffa5001a}@supports (color:color-mix(in lab,red,red)){.button.text.warning:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-warning,orange) 10%,transparent)}}}.button.text.success{color:var(--color-bg-success,#1d9a5b)}@media(hover:hover){.button.text.success:enabled:hover{background-color:#1d9a5b1a}@supports (color:color-mix(in lab,red,red)){.button.text.success:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-success,#1d9a5b) 10%,transparent)}}}.button.text.info{color:var(--color-bg-info,#0070ba)}@media(hover:hover){.button.text.info:enabled:hover{background-color:#0070ba1a}@supports (color:color-mix(in lab,red,red)){.button.text.info:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-info,#0070ba) 10%,transparent)}}}.button.outlined{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border,#ccc)}@media(hover:hover){.button.outlined:enabled:hover{background-color:var(--color-base-dark,#e6e6e6)}}.button.outlined.primary{border-color:var(--color-primary,#041e42)}@media(hover:hover){.button.outlined.primary:enabled:hover{border-color:var(--color-hover-primary,#0a2f66);background-color:var(--color-hover-primary,#0a2f66);color:var(--color-base-light,#fff)}}.button.outlined.secondary{border-color:var(--color-secondary,#cd212a);color:var(--color-secondary,#cd212a)}@media(hover:hover){.button.outlined.secondary:enabled:hover{border-color:var(--color-hover-secondary,#e03a42);background-color:var(--color-hover-secondary,#e03a42);color:var(--color-base-light,#fff)}}.button.outlined.error{border-color:var(--color-bg-error,#c14444);color:var(--color-bg-error,#c14444)}@media(hover:hover){.button.outlined.error:enabled:hover{background-color:var(--color-bg-error,#c14444);color:var(--color-error,#fbfbfb)}}.button.outlined.warning{border-color:var(--color-bg-warning,orange);color:var(--color-bg-warning,orange)}@media(hover:hover){.button.outlined.warning:enabled:hover{background-color:var(--color-bg-warning,orange);color:var(--color-warning,#000)}}.button.outlined.success{border-color:var(--color-bg-success,#1d9a5b);color:var(--color-bg-success,#1d9a5b)}@media(hover:hover){.button.outlined.success:enabled:hover{background-color:var(--color-bg-success,#1d9a5b);color:var(--color-success,#fbfbfb)}}.button.outlined.info{border-color:var(--color-bg-info,#0070ba);color:var(--color-bg-info,#0070ba)}@media(hover:hover){.button.outlined.info:enabled:hover{background-color:var(--color-bg-info,#0070ba);color:var(--color-info,#fbfbfb)}}.button.submit{background-color:var(--color-base,#f2f2f2)}@media(hover:hover){.button.submit:enabled:hover{background-color:var(--color-base-light,#fff)}}.button.submit.primary{background-color:var(--color-bg-primary,#021327);color:var(--color-base-light,#fff)}@media(hover:hover){.button.submit.primary:enabled:hover{background-color:var(--color-hover-primary,#0a2f66)}}.button.submit.secondary{background-color:var(--color-bg-secondary,#8f151b);color:var(--color-base-light,#fff)}@media(hover:hover){.button.submit.secondary:enabled:hover{background-color:var(--color-hover-secondary,#e03a42)}}.button.submit.error{background-color:var(--color-bg-error,#c14444);color:var(--color-error,#fbfbfb)}@media(hover:hover){.button.submit.error:enabled:hover{background-color:#c14444cc}@supports (color:color-mix(in lab,red,red)){.button.submit.error:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-error,#c14444) 80%,transparent)}}}.button.submit.warning{background-color:var(--color-bg-warning,orange);color:var(--color-warning,#000)}@media(hover:hover){.button.submit.warning:enabled:hover{background-color:#ffa500cc}@supports (color:color-mix(in lab,red,red)){.button.submit.warning:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-warning,orange) 80%,transparent)}}}.button.submit.success{background-color:var(--color-bg-success,#1d9a5b);color:var(--color-success,#fbfbfb)}@media(hover:hover){.button.submit.success:enabled:hover{background-color:#1d9a5bcc}@supports (color:color-mix(in lab,red,red)){.button.submit.success:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-success,#1d9a5b) 80%,transparent)}}}.button.submit.info{background-color:var(--color-bg-info,#0070ba);color:var(--color-info,#fbfbfb)}@media(hover:hover){.button.submit.info:enabled:hover{background-color:#0070bacc}@supports (color:color-mix(in lab,red,red)){.button.submit.info:enabled:hover{background-color:color-mix(in oklab,var(--color-bg-info,#0070ba) 80%,transparent)}}}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}
|
package/dist/Button.d.ts
ADDED
package/dist/Button.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "./Chip.css";
|
|
2
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { C as p } from "./Close-rKC9AcNX.js";
|
|
4
|
+
import { I as d } from "./IconButton-BpsTEj0z.js";
|
|
5
|
+
function N(a) {
|
|
6
|
+
const {
|
|
7
|
+
text: s,
|
|
8
|
+
onDelete: e,
|
|
9
|
+
children: i,
|
|
10
|
+
icon: n,
|
|
11
|
+
variant: o = "default",
|
|
12
|
+
iconClassName: l = "",
|
|
13
|
+
className: c = "",
|
|
14
|
+
textClassName: m = ""
|
|
15
|
+
} = a;
|
|
16
|
+
return /* @__PURE__ */ r(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: `chip-main ${o} ${e ? "deletable" : ""} ${c}`,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ t("span", { className: `chip-main-text ${m}`, children: s }),
|
|
22
|
+
i,
|
|
23
|
+
e ? /* @__PURE__ */ t(
|
|
24
|
+
d,
|
|
25
|
+
{
|
|
26
|
+
icon: n ?? /* @__PURE__ */ t(p, {}),
|
|
27
|
+
className: `chip-delete-button ${l}`,
|
|
28
|
+
onClick: e
|
|
29
|
+
}
|
|
30
|
+
) : null
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
N as C
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var x=require("./Chip.css");const e=require("react/jsx-runtime"),u=require("./Close-O9P7wJGf.cjs"),m=require("./IconButton-CVnmT2E9.cjs");function h(t){const{text:n,onDelete:s,children:i,icon:c,variant:a="default",iconClassName:l="",className:o="",textClassName:r=""}=t;return e.jsxs("div",{className:`chip-main ${a} ${s?"deletable":""} ${o}`,children:[e.jsx("span",{className:`chip-main-text ${r}`,children:n}),i,s?e.jsx(m.IconButton,{icon:c??e.jsx(u.Close,{}),className:`chip-delete-button ${l}`,onClick:s}):null]})}exports.Chip=h;
|
package/dist/Chip.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Chip-D17UJHW6.cjs");exports.Chip=e.Chip;
|
package/dist/Chip.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chip-main{border-radius:var(--radius-3xl,1.5rem);padding-inline:calc(var(--spacing,.25rem) * 4);padding-block:calc(var(--spacing,.25rem) * 2);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)));justify-content:flex-start;align-items:center;display:flex}.chip-main.deletable{padding-right:calc(var(--spacing,.25rem) * 2)}.chip-delete-button{margin-left:calc(var(--spacing,.25rem) * 2);cursor:pointer}.chip-delete-button svg{height:calc(var(--spacing,.25rem) * 3);width:calc(var(--spacing,.25rem) * 3)}
|
package/dist/Chip.d.ts
ADDED
package/dist/Chip.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime");function t(c){const{className:e=""}=c;return s.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"currentColor",children:s.jsx("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})})}exports.Close=t;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
function t(o) {
|
|
3
|
+
const { className: r = "" } = o;
|
|
4
|
+
return /* @__PURE__ */ s(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
className: r,
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
viewBox: "0 0 384 512",
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
children: /* @__PURE__ */ s("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" })
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
t as C
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E=require("./Dropdown.css");const h=require("react/jsx-runtime"),u=require("react"),g=require("react-dom"),d=8;function w(s,l){const e=l.getBoundingClientRect(),c=window.innerWidth,o=window.innerHeight;let n=s.bottom+4,r=s.left;return r+e.width>c-d&&(r=s.right-e.width),r<d&&(r=d),n+e.height>o-d&&(n=s.top-e.height-4),n<d&&(n=d),{top:n,left:r}}const v=s=>{const{children:l,open:e,onClose:c,anchorEl:o}=s,n=u.useRef(null);u.useLayoutEffect(()=>{const t=n.current;if(!e||!o||!t)return;const i=o.getBoundingClientRect(),{top:a,left:p}=w(i,t);t.style.top=`${a}px`,t.style.left=`${p}px`},[e,o]),u.useEffect(()=>{if(!e||!o)return;const t=n.current;if(!t)return;const i=()=>{const a=o.getBoundingClientRect(),{top:p,left:m}=w(a,t);t.style.top=`${p}px`,t.style.left=`${m}px`};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[e,o]);const r=u.useCallback(t=>{const i=n.current;!e||!i||o?.contains(t.target)||i.contains(t.target)||c()},[e,c,o]),f=u.useCallback(t=>{e&&t.key==="Escape"&&c()},[e,c]);return u.useEffect(()=>{if(e)return setTimeout(()=>n.current?.focus(),0),document.addEventListener("mousedown",r),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",f)}},[e,r,f]),g.createPortal(h.jsx("div",{ref:n,role:"menu","aria-hidden":!e,tabIndex:-1,className:`dropdown-main ${e?"opened":"closed"}`,onClick:t=>t.stopPropagation(),children:l}),document.body)};exports.Dropdown=v;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "./Dropdown.css";
|
|
2
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as v, useLayoutEffect as y, useEffect as m, useCallback as p } from "react";
|
|
4
|
+
import { createPortal as E } from "react-dom";
|
|
5
|
+
const d = 8;
|
|
6
|
+
function w(s, u) {
|
|
7
|
+
const e = u.getBoundingClientRect(), c = window.innerWidth, o = window.innerHeight;
|
|
8
|
+
let n = s.bottom + 4, r = s.left;
|
|
9
|
+
return r + e.width > c - d && (r = s.right - e.width), r < d && (r = d), n + e.height > o - d && (n = s.top - e.height - 4), n < d && (n = d), { top: n, left: r };
|
|
10
|
+
}
|
|
11
|
+
const k = (s) => {
|
|
12
|
+
const { children: u, open: e, onClose: c, anchorEl: o } = s, n = v(null);
|
|
13
|
+
y(() => {
|
|
14
|
+
const t = n.current;
|
|
15
|
+
if (!e || !o || !t) return;
|
|
16
|
+
const i = o.getBoundingClientRect(), { top: f, left: a } = w(i, t);
|
|
17
|
+
t.style.top = `${f}px`, t.style.left = `${a}px`;
|
|
18
|
+
}, [e, o]), m(() => {
|
|
19
|
+
if (!e || !o) return;
|
|
20
|
+
const t = n.current;
|
|
21
|
+
if (!t) return;
|
|
22
|
+
const i = () => {
|
|
23
|
+
const f = o.getBoundingClientRect(), { top: a, left: h } = w(f, t);
|
|
24
|
+
t.style.top = `${a}px`, t.style.left = `${h}px`;
|
|
25
|
+
};
|
|
26
|
+
return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
|
27
|
+
}, [e, o]);
|
|
28
|
+
const r = p(
|
|
29
|
+
(t) => {
|
|
30
|
+
const i = n.current;
|
|
31
|
+
!e || !i || o?.contains(t.target) || i.contains(t.target) || c();
|
|
32
|
+
},
|
|
33
|
+
[e, c, o]
|
|
34
|
+
), l = p(
|
|
35
|
+
(t) => {
|
|
36
|
+
e && t.key === "Escape" && c();
|
|
37
|
+
},
|
|
38
|
+
[e, c]
|
|
39
|
+
);
|
|
40
|
+
return m(() => {
|
|
41
|
+
if (e)
|
|
42
|
+
return setTimeout(() => n.current?.focus(), 0), document.addEventListener("mousedown", r), document.addEventListener("keydown", l), () => {
|
|
43
|
+
document.removeEventListener("mousedown", r), document.removeEventListener("keydown", l);
|
|
44
|
+
};
|
|
45
|
+
}, [e, r, l]), E(
|
|
46
|
+
/* @__PURE__ */ g(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
ref: n,
|
|
50
|
+
role: "menu",
|
|
51
|
+
"aria-hidden": !e,
|
|
52
|
+
tabIndex: -1,
|
|
53
|
+
className: `dropdown-main ${e ? "opened" : "closed"}`,
|
|
54
|
+
onClick: (t) => t.stopPropagation(),
|
|
55
|
+
children: u
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
document.body
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
k as D
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Dropdown-CAxauIXt.cjs");exports.Dropdown=o.Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}.dropdown-main{border-radius:var(--radius-lg,.5rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-border,#ccc);background-color:var(--color-base-light,#fff);padding:calc(var(--spacing,.25rem) * 2);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);transition:opacity .3s ease-in-out;position:fixed}.dropdown-main.opened{z-index:50;opacity:1}.dropdown-main.closed{pointer-events:none;z-index:-10;opacity:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
package/dist/Dropdown.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
function L(o) {
|
|
3
|
+
const { className: t = "" } = o;
|
|
4
|
+
return /* @__PURE__ */ r(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
className: t,
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
viewBox: "0 0 640 640",
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
children: /* @__PURE__ */ r("path", { d: "M192 64C156.7 64 128 92.7 128 128L128 512C128 547.3 156.7 576 192 576L448 576C483.3 576 512 547.3 512 512L512 234.5C512 217.5 505.3 201.2 493.3 189.2L386.7 82.7C374.7 70.7 358.5 64 341.5 64L192 64zM453.5 240L360 240C346.7 240 336 229.3 336 216L336 122.5L453.5 240z" })
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
L as F
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime");function r(e){const{className:t=""}=e;return s.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",children:s.jsx("path",{d:"M192 64C156.7 64 128 92.7 128 128L128 512C128 547.3 156.7 576 192 576L448 576C483.3 576 512 547.3 512 512L512 234.5C512 217.5 505.3 201.2 493.3 189.2L386.7 82.7C374.7 70.7 358.5 64 341.5 64L192 64zM453.5 240L360 240C346.7 240 336 229.3 336 216L336 122.5L453.5 240z"})})}exports.File=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var D=require("./FileInput.css");const e=require("react/jsx-runtime"),n=require("react"),C=require("./Tooltip-BSKAgRkc.cjs"),T=require("./File-_Hjw2d3F.cjs"),w=require("./Chip-D17UJHW6.cjs"),y=require("./IconButton-CVnmT2E9.cjs"),R=require("./Close-O9P7wJGf.cjs");function j(s,i=25){if(s.length<=i)return s;const a=s.lastIndexOf(".");if(a===-1)return s.slice(0,i-3)+"...";const h=s.slice(0,a),r=s.slice(a),p=i-r.length-3;return h.slice(0,p)+"..."+r}const B=n.forwardRef(function(s,i){const{children:a,label:h,containerClassName:r="",inputClassName:p="",labelClassName:N="",helperText:m="",helperTextClassName:g="",iconClassName:b="",multiple:q=!1,onChange:x,onClear:o,...d}=s,[t,f]=n.useState([]),k=n.useCallback(l=>{if(l.target.files){const c=Array.from(l.target.files);f(u=>[...u,...c])}x?.(l)},[x]),v=n.useCallback(l=>{f(c=>{const u=c.filter((A,$)=>$!==l);return u.length===0&&o?.(),u})},[o]),F=n.useCallback(()=>{f([]),o?.()},[o]),I=n.useCallback(l=>{l.currentTarget.value=""},[]);return e.jsxs("div",{className:`file-input-container ${r}`,children:[t.length===0&&e.jsxs("label",{htmlFor:d.name,className:`${N}`,children:[h,e.jsx("input",{type:"file",ref:i,multiple:q,onClick:I,onChange:k,className:`file-input ${p}`,...d}),d.required?" *":""]}),t.length>1&&e.jsx("ul",{className:"file-preview-list",children:t.map((l,c)=>e.jsx("li",{children:e.jsx(C.Tooltip,{content:l.name,children:e.jsx(w.Chip,{text:j(l.name,25),onDelete:()=>v(c)})})},`${l.name}-${l.lastModified}`))}),t.length===1&&e.jsxs("div",{className:"file-preview",children:[e.jsx(T.File,{className:`file-icon ${b}`}),e.jsx(C.Tooltip,{content:t[0]?.name??"",children:e.jsx("span",{className:"file-preview-name",children:j(t[0]?.name??"",25)})}),e.jsx(y.IconButton,{icon:e.jsx(R.Close,{}),onClick:F,type:"button"})]}),a,!!m&&e.jsx("p",{className:`file-input-helper-text ${g}`,children:m})]})});exports.FileInput=B;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import "./FileInput.css";
|
|
2
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as j, useState as R, useCallback as m } from "react";
|
|
4
|
+
import { T as g } from "./Tooltip-B4E-FRwY.js";
|
|
5
|
+
import { F as q } from "./File-BuJndWMv.js";
|
|
6
|
+
import { C as A } from "./Chip-C5ogKbFn.js";
|
|
7
|
+
import { I as B } from "./IconButton-BpsTEj0z.js";
|
|
8
|
+
import { C as D } from "./Close-rKC9AcNX.js";
|
|
9
|
+
function x(t, s = 25) {
|
|
10
|
+
if (t.length <= s) return t;
|
|
11
|
+
const i = t.lastIndexOf(".");
|
|
12
|
+
if (i === -1)
|
|
13
|
+
return t.slice(0, s - 3) + "...";
|
|
14
|
+
const p = t.slice(0, i), r = t.slice(i), f = s - r.length - 3;
|
|
15
|
+
return p.slice(0, f) + "..." + r;
|
|
16
|
+
}
|
|
17
|
+
const K = j(function(t, s) {
|
|
18
|
+
const {
|
|
19
|
+
children: i,
|
|
20
|
+
label: p,
|
|
21
|
+
containerClassName: r = "",
|
|
22
|
+
inputClassName: f = "",
|
|
23
|
+
labelClassName: v = "",
|
|
24
|
+
helperText: C = "",
|
|
25
|
+
helperTextClassName: F = "",
|
|
26
|
+
iconClassName: $ = "",
|
|
27
|
+
multiple: b = !1,
|
|
28
|
+
onChange: N,
|
|
29
|
+
onClear: o,
|
|
30
|
+
...h
|
|
31
|
+
} = t, [n, d] = R([]), I = m(
|
|
32
|
+
(e) => {
|
|
33
|
+
if (e.target.files) {
|
|
34
|
+
const a = Array.from(e.target.files);
|
|
35
|
+
d((c) => [...c, ...a]);
|
|
36
|
+
}
|
|
37
|
+
N?.(e);
|
|
38
|
+
},
|
|
39
|
+
[N]
|
|
40
|
+
), w = m(
|
|
41
|
+
(e) => {
|
|
42
|
+
d((a) => {
|
|
43
|
+
const c = a.filter((M, y) => y !== e);
|
|
44
|
+
return c.length === 0 && o?.(), c;
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
[o]
|
|
48
|
+
), T = m(() => {
|
|
49
|
+
d([]), o?.();
|
|
50
|
+
}, [o]), k = m(
|
|
51
|
+
(e) => {
|
|
52
|
+
e.currentTarget.value = "";
|
|
53
|
+
},
|
|
54
|
+
[]
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ u("div", { className: `file-input-container ${r}`, children: [
|
|
57
|
+
n.length === 0 && /* @__PURE__ */ u("label", { htmlFor: h.name, className: `${v}`, children: [
|
|
58
|
+
p,
|
|
59
|
+
/* @__PURE__ */ l(
|
|
60
|
+
"input",
|
|
61
|
+
{
|
|
62
|
+
type: "file",
|
|
63
|
+
ref: s,
|
|
64
|
+
multiple: b,
|
|
65
|
+
onClick: k,
|
|
66
|
+
onChange: I,
|
|
67
|
+
className: `file-input ${f}`,
|
|
68
|
+
...h
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
h.required ? " *" : ""
|
|
72
|
+
] }),
|
|
73
|
+
n.length > 1 && /* @__PURE__ */ l("ul", { className: "file-preview-list", children: n.map((e, a) => /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(g, { content: e.name, children: /* @__PURE__ */ l(
|
|
74
|
+
A,
|
|
75
|
+
{
|
|
76
|
+
text: x(e.name, 25),
|
|
77
|
+
onDelete: () => w(a)
|
|
78
|
+
}
|
|
79
|
+
) }) }, `${e.name}-${e.lastModified}`)) }),
|
|
80
|
+
n.length === 1 && /* @__PURE__ */ u("div", { className: "file-preview", children: [
|
|
81
|
+
/* @__PURE__ */ l(q, { className: `file-icon ${$}` }),
|
|
82
|
+
/* @__PURE__ */ l(g, { content: n[0]?.name ?? "", children: /* @__PURE__ */ l("span", { className: "file-preview-name", children: x(n[0]?.name ?? "", 25) }) }),
|
|
83
|
+
/* @__PURE__ */ l(B, { icon: /* @__PURE__ */ l(D, {}), onClick: T, type: "button" })
|
|
84
|
+
] }),
|
|
85
|
+
i,
|
|
86
|
+
!!C && /* @__PURE__ */ l("p", { className: `file-input-helper-text ${F}`, children: C })
|
|
87
|
+
] });
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
K as F
|
|
91
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid}}}.file-input-container{z-index:0;margin-bottom:calc(var(--spacing,.25rem) * 5);cursor:pointer;border-radius:var(--radius-lg,.5rem);border-style:var(--tw-border-style);--tw-border-style:dashed;border-style:dashed;border-width:1px;border-color:var(--color-border,#ccc);width:100%;padding:calc(var(--spacing,.25rem) * 3);justify-content:center;align-items:center;display:flex;position:relative}@media(hover:hover){.file-input-container:hover{border-color:var(--color-text-muted,#4d4d4d)}}.file-input{visibility:hidden;position:absolute}.file-preview-list{margin-top:calc(var(--spacing,.25rem) * 2);gap:calc(var(--spacing,.25rem) * 2);flex-wrap:wrap;display:flex}.file-preview{align-items:center;gap:calc(var(--spacing,.25rem) * 5);display:flex}.file-icon{height:calc(var(--spacing,.25rem) * 10);width:calc(var(--spacing,.25rem) * 10)}.file-preview-name{cursor:default!important}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
function l(r) {
|
|
3
|
+
const { className: n = "" } = r;
|
|
4
|
+
return /* @__PURE__ */ s(
|
|
5
|
+
"svg",
|
|
6
|
+
{
|
|
7
|
+
className: n,
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
viewBox: "0 0 512 512",
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
children: /* @__PURE__ */ s("path", { d: "M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z" })
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function c(r) {
|
|
16
|
+
const { className: n = "" } = r;
|
|
17
|
+
return /* @__PURE__ */ s(
|
|
18
|
+
"svg",
|
|
19
|
+
{
|
|
20
|
+
className: n,
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
viewBox: "0 0 320 512",
|
|
23
|
+
fill: "currentColor",
|
|
24
|
+
children: /* @__PURE__ */ s("path", { d: "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z" })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function o(r) {
|
|
29
|
+
const { className: n = "" } = r;
|
|
30
|
+
return /* @__PURE__ */ s(
|
|
31
|
+
"svg",
|
|
32
|
+
{
|
|
33
|
+
className: n,
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
viewBox: "0 0 320 512",
|
|
36
|
+
fill: "currentColor",
|
|
37
|
+
children: /* @__PURE__ */ s("path", { d: "M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z" })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
function e(r) {
|
|
42
|
+
const { className: n = "" } = r;
|
|
43
|
+
return /* @__PURE__ */ s(
|
|
44
|
+
"svg",
|
|
45
|
+
{
|
|
46
|
+
className: n,
|
|
47
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
48
|
+
viewBox: "0 0 512 512",
|
|
49
|
+
fill: "currentColor",
|
|
50
|
+
children: /* @__PURE__ */ s("path", { d: "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z" })
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function a(r) {
|
|
55
|
+
const { className: n = "" } = r;
|
|
56
|
+
return /* @__PURE__ */ s(
|
|
57
|
+
"svg",
|
|
58
|
+
{
|
|
59
|
+
className: n,
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
viewBox: "0 0 640 640",
|
|
62
|
+
fill: "currentColor",
|
|
63
|
+
children: /* @__PURE__ */ s("path", { d: "M320 208C289.1 208 264 182.9 264 152C264 121.1 289.1 96 320 96C350.9 96 376 121.1 376 152C376 182.9 350.9 208 320 208zM320 432C350.9 432 376 457.1 376 488C376 518.9 350.9 544 320 544C289.1 544 264 518.9 264 488C264 457.1 289.1 432 320 432zM376 320C376 350.9 350.9 376 320 376C289.1 376 264 350.9 264 320C264 289.1 289.1 264 320 264C350.9 264 376 289.1 376 320z" })
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
const i = (r) => {
|
|
68
|
+
const { className: n = "" } = r;
|
|
69
|
+
return /* @__PURE__ */ s("svg", { className: n, viewBox: "0 0 16 16", children: /* @__PURE__ */ s("path", { d: "M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z" }) });
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
l as C,
|
|
73
|
+
a as E,
|
|
74
|
+
i as F,
|
|
75
|
+
c as a,
|
|
76
|
+
o as b,
|
|
77
|
+
e as c
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime");function t(n){const{className:r=""}=n;return s.jsx("svg",{className:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:s.jsx("path",{d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})})}function l(n){const{className:r=""}=n;return s.jsx("svg",{className:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:s.jsx("path",{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"})})}function e(n){const{className:r=""}=n;return s.jsx("svg",{className:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",fill:"currentColor",children:s.jsx("path",{d:"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"})})}function o(n){const{className:r=""}=n;return s.jsx("svg",{className:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:s.jsx("path",{d:"M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"})})}function c(n){const{className:r=""}=n;return s.jsx("svg",{className:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 640",fill:"currentColor",children:s.jsx("path",{d:"M320 208C289.1 208 264 182.9 264 152C264 121.1 289.1 96 320 96C350.9 96 376 121.1 376 152C376 182.9 350.9 208 320 208zM320 432C350.9 432 376 457.1 376 488C376 518.9 350.9 544 320 544C289.1 544 264 518.9 264 488C264 457.1 289.1 432 320 432zM376 320C376 350.9 350.9 376 320 376C289.1 376 264 350.9 264 320C264 289.1 289.1 264 320 264C350.9 264 376 289.1 376 320z"})})}const i=n=>{const{className:r=""}=n;return s.jsx("svg",{className:r,viewBox:"0 0 16 16",children:s.jsx("path",{d:"M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z"})})};exports.ChevronDown=t;exports.ChevronLeft=l;exports.ChevronRight=e;exports.ChevronUp=o;exports.Ellipsis=c;exports.Filters=i;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer as p, useEffect as f, createContext as l, useContext as m } from "react";
|
|
3
|
+
import { u as v } from "./TableOptionsProvider-BfQS8l1N.js";
|
|
4
|
+
var n = /* @__PURE__ */ ((e) => (e[e.update = 0] = "update", e[e.reset = 1] = "reset", e))(n || {});
|
|
5
|
+
const a = (e) => {
|
|
6
|
+
if (e) {
|
|
7
|
+
const t = {};
|
|
8
|
+
return Object.keys(e)?.forEach((s) => {
|
|
9
|
+
t[s] = { value: e[s] };
|
|
10
|
+
}), t;
|
|
11
|
+
}
|
|
12
|
+
return {};
|
|
13
|
+
};
|
|
14
|
+
function x(e, t) {
|
|
15
|
+
const { type: r } = t;
|
|
16
|
+
switch (r) {
|
|
17
|
+
case n.reset:
|
|
18
|
+
return {};
|
|
19
|
+
case n.update: {
|
|
20
|
+
const { toUpdate: s } = t;
|
|
21
|
+
return { ...e, ...s };
|
|
22
|
+
}
|
|
23
|
+
default:
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const c = l({}), C = (e) => {
|
|
28
|
+
const { children: t } = e, { filters: r } = v(), [s, o] = p(
|
|
29
|
+
x,
|
|
30
|
+
a(r)
|
|
31
|
+
);
|
|
32
|
+
f(() => {
|
|
33
|
+
o({ type: n.reset });
|
|
34
|
+
const u = a(r);
|
|
35
|
+
Object.keys(u).length && o({
|
|
36
|
+
type: n.update,
|
|
37
|
+
toUpdate: u
|
|
38
|
+
});
|
|
39
|
+
}, [r]);
|
|
40
|
+
const i = {
|
|
41
|
+
currentFilters: s,
|
|
42
|
+
setCurrentFilters: o
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ d(c.Provider, { value: i, children: t });
|
|
45
|
+
}, w = () => {
|
|
46
|
+
const e = m(c);
|
|
47
|
+
if (e === void 0)
|
|
48
|
+
throw new Error("tableOptionsContext must be used within a Provider");
|
|
49
|
+
return e;
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
C as F,
|
|
53
|
+
n as a,
|
|
54
|
+
x as f,
|
|
55
|
+
a as i,
|
|
56
|
+
w as u
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=require("react/jsx-runtime"),i=require("react"),f=require("./TableOptionsProvider-BchUDA3B.cjs");var n=(e=>(e[e.update=0]="update",e[e.reset=1]="reset",e))(n||{});const u=e=>{if(e){const t={};return Object.keys(e)?.forEach(s=>{t[s]={value:e[s]}}),t}return{}};function a(e,t){const{type:r}=t;switch(r){case n.reset:return{};case n.update:{const{toUpdate:s}=t;return{...e,...s}}default:return e}}const d=i.createContext({}),v=e=>{const{children:t}=e,{filters:r}=f.useTableOptions(),[s,o]=i.useReducer(a,u(r));i.useEffect(()=>{o({type:n.reset});const c=u(r);Object.keys(c).length&&o({type:n.update,toUpdate:c})},[r]);const l={currentFilters:s,setCurrentFilters:o};return p.jsx(d.Provider,{value:l,children:t})},x=()=>{const e=i.useContext(d);if(e===void 0)throw new Error("tableOptionsContext must be used within a Provider");return e};exports.FiltersActions=n;exports.FiltersProvider=v;exports.filtersReducer=a;exports.initializer=u;exports.useFilters=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FiltersProvider-CYqLFEI9.cjs");exports.FiltersActions=e.FiltersActions;exports.FiltersProvider=e.FiltersProvider;exports.filtersReducer=e.filtersReducer;exports.initializer=e.initializer;exports.useFilters=e.useFilters;
|
package/dist/Form.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TextInput-CY1fh4mf.cjs"),t=require("./FileInput-Ch-GCxrS.cjs");exports.AutocompleteInput=e.AutocompleteInput;exports.CheckInput=e.CheckInput;exports.SelectInput=e.SelectInput;exports.State=e.State;exports.TextInput=e.TextInput;exports.helperTextStateClassName=e.helperTextStateClassName;exports.inputStateClassName=e.inputStateClassName;exports.labelStateClassName=e.labelStateClassName;exports.FileInput=t.FileInput;
|
package/dist/Form.d.ts
ADDED
package/dist/Form.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { A as e, C as s, S as l, a as p, T as u, h as m, i as n, l as o } from "./TextInput-BqW5YX-3.js";
|
|
2
|
+
import { F as r } from "./FileInput-DCR_Pyqe.js";
|
|
3
|
+
export {
|
|
4
|
+
e as AutocompleteInput,
|
|
5
|
+
s as CheckInput,
|
|
6
|
+
r as FileInput,
|
|
7
|
+
l as SelectInput,
|
|
8
|
+
p as State,
|
|
9
|
+
u as TextInput,
|
|
10
|
+
m as helperTextStateClassName,
|
|
11
|
+
n as inputStateClassName,
|
|
12
|
+
o as labelStateClassName
|
|
13
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "./IconButton.css";
|
|
2
|
+
import { jsxs as l, jsx as m } from "react/jsx-runtime";
|
|
3
|
+
const d = (t) => {
|
|
4
|
+
const {
|
|
5
|
+
children: n,
|
|
6
|
+
icon: o,
|
|
7
|
+
type: s = "button",
|
|
8
|
+
className: a = "",
|
|
9
|
+
variant: c = "text",
|
|
10
|
+
color: e = "default",
|
|
11
|
+
iconClassName: r = "",
|
|
12
|
+
...i
|
|
13
|
+
} = t;
|
|
14
|
+
return /* @__PURE__ */ l(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: s,
|
|
18
|
+
className: `icon-button ${a} ${c} ${e}`,
|
|
19
|
+
...i,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ m("span", { className: r, children: o }),
|
|
22
|
+
n
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
d as I
|
|
29
|
+
};
|