@md-code/components 0.0.0-stage → 0.0.1
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/CHANGELOG.md +12 -0
- package/README.md +11 -2
- package/dist/CentralModal-ButM9Ggi.js +159 -0
- package/dist/assets/favicon.ico +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/atoms/Loading/ouroboros.svg +41 -0
- package/dist/atoms/Logo/logo.jpg +0 -0
- package/dist/avatar.js +8 -0
- package/dist/badge.js +25 -0
- package/dist/breadcrumbs.js +60 -0
- package/dist/button.js +188 -0
- package/dist/calendar.js +100 -0
- package/dist/card.js +81 -0
- package/dist/carousel.js +110 -0
- package/dist/central-modal.js +1 -0
- package/dist/circle-image.js +22 -0
- package/dist/code-preview.js +38 -0
- package/dist/code-view.js +96 -0
- package/dist/conditional-wrapper.js +5 -0
- package/dist/containers.js +115 -0
- package/dist/dist-DD9Lv2Ja.js +130 -0
- package/dist/div-input.js +101 -0
- package/dist/form-label.js +19 -0
- package/dist/form.js +17 -0
- package/dist/full-screen-modal.js +1 -0
- package/dist/header.js +19 -0
- package/dist/html-editor.js +74 -0
- package/dist/icons.js +44 -0
- package/dist/input.js +62 -0
- package/dist/link.js +35 -0
- package/dist/loading.js +87 -0
- package/dist/logo.js +12 -0
- package/dist/modals.js +1 -0
- package/dist/molecules/Carousel/arrow.svg +5 -0
- package/dist/molecules/Select/arrow_down.svg +3 -0
- package/dist/pagination.js +119 -0
- package/dist/progress-bar.js +26 -0
- package/dist/radio.js +72 -0
- package/dist/report-ui.js +280 -0
- package/dist/search-input.js +78 -0
- package/dist/select.js +161 -0
- package/dist/separator.js +10 -0
- package/dist/status-label.js +59 -0
- package/dist/submit.js +57 -0
- package/dist/switch.js +98 -0
- package/dist/table.js +108 -0
- package/dist/tabs.js +155 -0
- package/dist/text-checkbox.js +64 -0
- package/dist/textarea.js +56 -0
- package/dist/textures/Cloud/clouds.svg +52 -0
- package/dist/textures.js +170 -0
- package/dist/themes-zS3KQYdw-DIqyzjFD.js +184 -0
- package/dist/toasts.js +79 -0
- package/dist/toggle.js +66 -0
- package/dist/token-input-field.js +56 -0
- package/dist/tooltip.js +93 -0
- package/dist/types/atoms/Avatar/index.d.ts +6 -0
- package/dist/types/atoms/Avatar/index.d.ts.map +1 -0
- package/dist/types/atoms/Breadcrumbs/index.d.ts +10 -0
- package/dist/types/atoms/Breadcrumbs/index.d.ts.map +1 -0
- package/dist/types/atoms/Breadcrumbs/styles.d.ts +95 -0
- package/dist/types/atoms/Breadcrumbs/styles.d.ts.map +1 -0
- package/dist/types/atoms/Calendar/index.d.ts +4 -0
- package/dist/types/atoms/Calendar/index.d.ts.map +1 -0
- package/dist/types/atoms/Calendar/styles.d.ts +12 -0
- package/dist/types/atoms/Calendar/styles.d.ts.map +1 -0
- package/dist/types/atoms/CentralModal/index.d.ts +3 -0
- package/dist/types/atoms/CentralModal/index.d.ts.map +1 -0
- package/dist/types/atoms/CircleImage/index.d.ts +13 -0
- package/dist/types/atoms/CircleImage/index.d.ts.map +1 -0
- package/dist/types/atoms/CodePreview/index.d.ts +23 -0
- package/dist/types/atoms/CodePreview/index.d.ts.map +1 -0
- package/dist/types/atoms/ConditionalWrapper/index.d.ts +8 -0
- package/dist/types/atoms/ConditionalWrapper/index.d.ts.map +1 -0
- package/dist/types/atoms/Containers/index.d.ts +3 -0
- package/dist/types/atoms/Containers/index.d.ts.map +1 -0
- package/dist/types/atoms/Containers/styles.d.ts +87 -0
- package/dist/types/atoms/Containers/styles.d.ts.map +1 -0
- package/dist/types/atoms/DivInput/index.d.ts +18 -0
- package/dist/types/atoms/DivInput/index.d.ts.map +1 -0
- package/dist/types/atoms/Form/Form.d.ts +15 -0
- package/dist/types/atoms/Form/Form.d.ts.map +1 -0
- package/dist/types/atoms/Form/index.d.ts +13 -0
- package/dist/types/atoms/Form/index.d.ts.map +1 -0
- package/dist/types/atoms/FormLabel/index.d.ts +13 -0
- package/dist/types/atoms/FormLabel/index.d.ts.map +1 -0
- package/dist/types/atoms/FullScreenModal/index.d.ts +3 -0
- package/dist/types/atoms/FullScreenModal/index.d.ts.map +1 -0
- package/dist/types/atoms/Header/index.d.ts +3 -0
- package/dist/types/atoms/Header/index.d.ts.map +1 -0
- package/dist/types/atoms/Header/styles.d.ts +18 -0
- package/dist/types/atoms/Header/styles.d.ts.map +1 -0
- package/dist/types/atoms/Icons/index.d.ts +28 -0
- package/dist/types/atoms/Icons/index.d.ts.map +1 -0
- package/dist/types/atoms/Input/index.d.ts +3 -0
- package/dist/types/atoms/Input/index.d.ts.map +1 -0
- package/dist/types/atoms/Input/styles.d.ts +20 -0
- package/dist/types/atoms/Input/styles.d.ts.map +1 -0
- package/dist/types/atoms/Link/index.d.ts +3 -0
- package/dist/types/atoms/Link/index.d.ts.map +1 -0
- package/dist/types/atoms/Link/styles.d.ts +133 -0
- package/dist/types/atoms/Link/styles.d.ts.map +1 -0
- package/dist/types/atoms/Loading/index.d.ts +21 -0
- package/dist/types/atoms/Loading/index.d.ts.map +1 -0
- package/dist/types/atoms/Loading/styles.d.ts +29 -0
- package/dist/types/atoms/Loading/styles.d.ts.map +1 -0
- package/dist/types/atoms/Logo/index.d.ts +3 -0
- package/dist/types/atoms/Logo/index.d.ts.map +1 -0
- package/dist/types/atoms/Pagination/index.d.ts +9 -0
- package/dist/types/atoms/Pagination/index.d.ts.map +1 -0
- package/dist/types/atoms/Pagination/styles.d.ts +38 -0
- package/dist/types/atoms/Pagination/styles.d.ts.map +1 -0
- package/dist/types/atoms/ProgressBar/index.d.ts +13 -0
- package/dist/types/atoms/ProgressBar/index.d.ts.map +1 -0
- package/dist/types/atoms/Radio/index.d.ts +12 -0
- package/dist/types/atoms/Radio/index.d.ts.map +1 -0
- package/dist/types/atoms/Separator/index.d.ts +12 -0
- package/dist/types/atoms/Separator/index.d.ts.map +1 -0
- package/dist/types/atoms/Submit/index.d.ts +10 -0
- package/dist/types/atoms/Submit/index.d.ts.map +1 -0
- package/dist/types/atoms/Switch/index.d.ts +12 -0
- package/dist/types/atoms/Switch/index.d.ts.map +1 -0
- package/dist/types/atoms/Switch/styles.d.ts +31 -0
- package/dist/types/atoms/Switch/styles.d.ts.map +1 -0
- package/dist/types/atoms/Tabs/index.d.ts +18 -0
- package/dist/types/atoms/Tabs/index.d.ts.map +1 -0
- package/dist/types/atoms/Tabs/styles.d.ts +40 -0
- package/dist/types/atoms/Tabs/styles.d.ts.map +1 -0
- package/dist/types/atoms/TextCheckbox/index.d.ts +9 -0
- package/dist/types/atoms/TextCheckbox/index.d.ts.map +1 -0
- package/dist/types/atoms/Textarea/index.d.ts +19 -0
- package/dist/types/atoms/Textarea/index.d.ts.map +1 -0
- package/dist/types/atoms/Toggle/index.d.ts +16 -0
- package/dist/types/atoms/Toggle/index.d.ts.map +1 -0
- package/dist/types/atoms/Toggle/styles.d.ts +32 -0
- package/dist/types/atoms/Toggle/styles.d.ts.map +1 -0
- package/dist/types/atoms/Tooltip/index.d.ts +15 -0
- package/dist/types/atoms/Tooltip/index.d.ts.map +1 -0
- package/dist/types/atoms/Tooltip/styles.d.ts +24 -0
- package/dist/types/atoms/Tooltip/styles.d.ts.map +1 -0
- package/dist/types/atoms/Typography/index.d.ts +3 -0
- package/dist/types/atoms/Typography/index.d.ts.map +1 -0
- package/dist/types/atoms/Typography/styles.d.ts +68 -0
- package/dist/types/atoms/Typography/styles.d.ts.map +1 -0
- package/dist/types/atoms/Validation/index.d.ts +9 -0
- package/dist/types/atoms/Validation/index.d.ts.map +1 -0
- package/dist/types/atoms/Validation/styles.d.ts +23 -0
- package/dist/types/atoms/Validation/styles.d.ts.map +1 -0
- package/dist/types/atoms/WideImage/index.d.ts +26 -0
- package/dist/types/atoms/WideImage/index.d.ts.map +1 -0
- package/dist/types/molecules/Badge/index.d.ts +25 -0
- package/dist/types/molecules/Badge/index.d.ts.map +1 -0
- package/dist/types/molecules/Button/index.d.ts +31 -0
- package/dist/types/molecules/Button/index.d.ts.map +1 -0
- package/dist/types/molecules/Button/styles.d.ts +15 -0
- package/dist/types/molecules/Button/styles.d.ts.map +1 -0
- package/dist/types/molecules/Card/index.d.ts +16 -0
- package/dist/types/molecules/Card/index.d.ts.map +1 -0
- package/dist/types/molecules/Card/styles.d.ts +70 -0
- package/dist/types/molecules/Card/styles.d.ts.map +1 -0
- package/dist/types/molecules/Carousel/index.d.ts +13 -0
- package/dist/types/molecules/Carousel/index.d.ts.map +1 -0
- package/dist/types/molecules/Carousel/styles.d.ts +31 -0
- package/dist/types/molecules/Carousel/styles.d.ts.map +1 -0
- package/dist/types/molecules/CodeView/highlight.d.ts +11 -0
- package/dist/types/molecules/CodeView/highlight.d.ts.map +1 -0
- package/dist/types/molecules/CodeView/index.d.ts +58 -0
- package/dist/types/molecules/CodeView/index.d.ts.map +1 -0
- package/dist/types/molecules/CodeView/styles.d.ts +44 -0
- package/dist/types/molecules/CodeView/styles.d.ts.map +1 -0
- package/dist/types/molecules/HtmlEditor/index.d.ts +16 -0
- package/dist/types/molecules/HtmlEditor/index.d.ts.map +1 -0
- package/dist/types/molecules/HtmlEditor/styles.d.ts +12 -0
- package/dist/types/molecules/HtmlEditor/styles.d.ts.map +1 -0
- package/dist/types/molecules/SearchInput/index.d.ts +11 -0
- package/dist/types/molecules/SearchInput/index.d.ts.map +1 -0
- package/dist/types/molecules/SearchInput/styles.d.ts +24 -0
- package/dist/types/molecules/SearchInput/styles.d.ts.map +1 -0
- package/dist/types/molecules/Select/index.d.ts +18 -0
- package/dist/types/molecules/Select/index.d.ts.map +1 -0
- package/dist/types/molecules/Select/styles.d.ts +51 -0
- package/dist/types/molecules/Select/styles.d.ts.map +1 -0
- package/dist/types/molecules/StatusLabel/index.d.ts +51 -0
- package/dist/types/molecules/StatusLabel/index.d.ts.map +1 -0
- package/dist/types/molecules/StatusLabel/styles.d.ts +18 -0
- package/dist/types/molecules/StatusLabel/styles.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/BrandCell.d.ts +9 -0
- package/dist/types/molecules/Table/TableCels/BrandCell.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/NavigationCell.d.ts +8 -0
- package/dist/types/molecules/Table/TableCels/NavigationCell.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/StatusCell.d.ts +9 -0
- package/dist/types/molecules/Table/TableCels/StatusCell.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/TextCell.d.ts +9 -0
- package/dist/types/molecules/Table/TableCels/TextCell.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/index.d.ts +7 -0
- package/dist/types/molecules/Table/TableCels/index.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/styles.d.ts +29 -0
- package/dist/types/molecules/Table/TableCels/styles.d.ts.map +1 -0
- package/dist/types/molecules/Table/index.d.ts +27 -0
- package/dist/types/molecules/Table/index.d.ts.map +1 -0
- package/dist/types/molecules/Table/styles.d.ts +15 -0
- package/dist/types/molecules/Table/styles.d.ts.map +1 -0
- package/dist/types/molecules/TokenInputField/index.d.ts +15 -0
- package/dist/types/molecules/TokenInputField/index.d.ts.map +1 -0
- package/dist/types/molecules/TokenInputField/styles.d.ts +24 -0
- package/dist/types/molecules/TokenInputField/styles.d.ts.map +1 -0
- package/dist/types/shared/modals/index.d.ts +33 -0
- package/dist/types/shared/modals/index.d.ts.map +1 -0
- package/dist/types/shared/modals/styles.d.ts +52 -0
- package/dist/types/shared/modals/styles.d.ts.map +1 -0
- package/dist/types/shared/modals/useModal.d.ts +4 -0
- package/dist/types/shared/modals/useModal.d.ts.map +1 -0
- package/dist/types/shared/report-ui/DecisionPanel.d.ts +53 -0
- package/dist/types/shared/report-ui/DecisionPanel.d.ts.map +1 -0
- package/dist/types/shared/report-ui/DecisionPanel.styles.d.ts +31 -0
- package/dist/types/shared/report-ui/DecisionPanel.styles.d.ts.map +1 -0
- package/dist/types/shared/report-ui/Shell.styles.d.ts +26 -0
- package/dist/types/shared/report-ui/Shell.styles.d.ts.map +1 -0
- package/dist/types/shared/report-ui/index.d.ts +6 -0
- package/dist/types/shared/report-ui/index.d.ts.map +1 -0
- package/dist/types/shared/report-ui/ui.d.ts +30 -0
- package/dist/types/shared/report-ui/ui.d.ts.map +1 -0
- package/dist/types/shared/report-ui/ui.styles.d.ts +50 -0
- package/dist/types/shared/report-ui/ui.styles.d.ts.map +1 -0
- package/dist/types/shared/toasts/index.d.ts +23 -0
- package/dist/types/shared/toasts/index.d.ts.map +1 -0
- package/dist/types/shared/toasts/styles.d.ts +18 -0
- package/dist/types/shared/toasts/styles.d.ts.map +1 -0
- package/dist/types/textures/Cloud/index.d.ts +29 -0
- package/dist/types/textures/Cloud/index.d.ts.map +1 -0
- package/dist/types/textures/Paper/index.d.ts +8 -0
- package/dist/types/textures/Paper/index.d.ts.map +1 -0
- package/dist/types/textures/index.d.ts +4 -0
- package/dist/types/textures/index.d.ts.map +1 -0
- package/dist/typography.js +81 -0
- package/dist/validation.js +20 -0
- package/dist/wide-image.js +94 -0
- package/package.json +443 -4
package/dist/modals.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as CentralModal, r as CloseButton, m as FullScreenModal, i as ModalContainer, a as ModalContentContainer, h as ModalContext, n as ModalProvider, o as Overlay, s as StyledModal, c as centerZoomIn, l as centerZoomOut, u as collapseAnimation, d as expandAnimation, f as fadeIn, p as fadeOut, g as useModal } from "./CentralModal-ButM9Ggi.js";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import i from "styled-components";
|
|
4
|
+
// atoms/Pagination/styles.ts
|
|
5
|
+
var a = i.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: ${({ theme: e }) => e.offsets.elementContent} 0;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
gap: ${({ theme: e }) => e.offsets.elementContent};
|
|
12
|
+
`, o = i.button`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
height: ${({ theme: e }) => e.elements.form.height};
|
|
17
|
+
min-width: ${({ theme: e }) => e.elements.form.height};
|
|
18
|
+
margin: 0 ${({ theme: e }) => e.offsets.elementContent};
|
|
19
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
22
|
+
font-size: ${({ theme: e }) => e.font.sizes.regular};
|
|
23
|
+
text-transform: ${({ theme: e }) => e.font.transform.text};
|
|
24
|
+
font-weight: ${({ $active: e, theme: t }) => e ? "bold" : t.font.weight.text};
|
|
25
|
+
background-color: ${({ $active: e, theme: t }) => e ? t.colors.highlighted : t.colors.overlay};
|
|
26
|
+
color: ${({ $active: e, theme: t }) => e ? t.colors.highlightedContent : t.colors.sectionContent};
|
|
27
|
+
border: ${({ theme: e }) => e.border.size} solid
|
|
28
|
+
color-mix(in srgb, ${({ theme: e }) => e.colors.sectionContent} 25%, transparent);
|
|
29
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
30
|
+
clip-path: ${({ theme: e }) => e.geometry.shape};
|
|
31
|
+
background-image: ${({ theme: e }) => e.effects.texture};
|
|
32
|
+
backdrop-filter: ${({ theme: e }) => e.effects.texture};
|
|
33
|
+
box-shadow: ${({ theme: e }) => e.shadows.section};
|
|
34
|
+
transition:
|
|
35
|
+
color ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.standard},
|
|
36
|
+
background-color ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.standard},
|
|
37
|
+
box-shadow ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.standard};
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
background-color: ${({ theme: e }) => e.colors.highlighted};
|
|
41
|
+
color: ${({ theme: e }) => e.colors.highlightedContent};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:disabled {
|
|
45
|
+
${({ theme: e }) => e.effects.interaction.disabled}
|
|
46
|
+
}
|
|
47
|
+
`, s = i.button`
|
|
48
|
+
background-color: transparent;
|
|
49
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
50
|
+
border: none;
|
|
51
|
+
margin: 0 ${({ theme: e }) => e.offsets.elementContent};
|
|
52
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
55
|
+
font-size: ${({ theme: e }) => e.font.sizes.regular};
|
|
56
|
+
|
|
57
|
+
/* Arrow weight is component semantics: the baseline paints both arrows bold
|
|
58
|
+
* under every theme, so the label weight stays bold (documented deviation). */
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
text-transform: ${({ theme: e }) => e.font.transform.text};
|
|
61
|
+
letter-spacing: ${({ theme: e }) => e.font.spacing};
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
color: ${({ theme: e }) => e.colors.highlighted};
|
|
65
|
+
text-shadow: ${({ theme: e }) => e.shadows.content};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:disabled {
|
|
69
|
+
${({ theme: e }) => e.effects.interaction.disabled}
|
|
70
|
+
}
|
|
71
|
+
`, c = i.span`
|
|
72
|
+
margin: 0 ${({ theme: e }) => e.offsets.elementContent};
|
|
73
|
+
font-weight: bold;
|
|
74
|
+
`, l = ({ totalPages: i, currentPage: l, onPageChange: u }) => {
|
|
75
|
+
let [d, f] = t(!1);
|
|
76
|
+
return e(() => {
|
|
77
|
+
let e = () => f(window.innerWidth <= 768);
|
|
78
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
79
|
+
}, []), /* @__PURE__ */ r(a, { children: [
|
|
80
|
+
/* @__PURE__ */ n(s, {
|
|
81
|
+
onClick: () => u(l - 1),
|
|
82
|
+
disabled: l === 1,
|
|
83
|
+
children: "Prev"
|
|
84
|
+
}),
|
|
85
|
+
(() => {
|
|
86
|
+
let e = [], t = d ? 3 : 8;
|
|
87
|
+
if (i <= t) for (let t = 1; t <= i; t++) e.push(/* @__PURE__ */ n(o, {
|
|
88
|
+
$active: t === l,
|
|
89
|
+
onClick: () => u(t),
|
|
90
|
+
children: t
|
|
91
|
+
}, t));
|
|
92
|
+
else {
|
|
93
|
+
let r = 1, a = t;
|
|
94
|
+
l > 5 && (r = l - 4, a = l + 5), a > i && (r = i - t + 1, a = i), r > 1 && (e.push(/* @__PURE__ */ n(o, {
|
|
95
|
+
$active: l === 1,
|
|
96
|
+
onClick: () => u(1),
|
|
97
|
+
children: "1"
|
|
98
|
+
}, 1)), e.push(/* @__PURE__ */ n(c, { children: "..." }, "start-dots")));
|
|
99
|
+
for (let t = r; t <= a; t++) e.push(/* @__PURE__ */ n(o, {
|
|
100
|
+
$active: t === l,
|
|
101
|
+
onClick: () => u(t),
|
|
102
|
+
children: t
|
|
103
|
+
}, t));
|
|
104
|
+
a < i && (e.push(/* @__PURE__ */ n(c, { children: "..." }, "end-dots")), e.push(/* @__PURE__ */ n(o, {
|
|
105
|
+
$active: i === l,
|
|
106
|
+
onClick: () => u(i),
|
|
107
|
+
children: i
|
|
108
|
+
}, i)));
|
|
109
|
+
}
|
|
110
|
+
return e;
|
|
111
|
+
})(),
|
|
112
|
+
/* @__PURE__ */ n(s, {
|
|
113
|
+
onClick: () => u(l + 1),
|
|
114
|
+
disabled: l === i,
|
|
115
|
+
children: "Next"
|
|
116
|
+
})
|
|
117
|
+
] });
|
|
118
|
+
};
|
|
119
|
+
export { l as Pagination };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { a as e, r as t } from "./dist-DD9Lv2Ja.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import r from "styled-components";
|
|
5
|
+
// atoms/ProgressBar/index.tsx
|
|
6
|
+
var i = r.div`
|
|
7
|
+
background-color: ${({ theme: e }) => e.colors.overlay};
|
|
8
|
+
border: ${({ theme: e }) => e.border.size} solid ${({ theme: e }) => e.colors.sectionContent};
|
|
9
|
+
height: ${({ theme: e }) => `calc(${e.border.size} * 8)`};
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
13
|
+
margin-right: ${t};
|
|
14
|
+
margin-bottom: ${e};
|
|
15
|
+
`, a = r.div`
|
|
16
|
+
background-color: ${({ theme: e }) => e.colors.highlighted};
|
|
17
|
+
width: ${({ $percentage: e }) => e}%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
`, o = ({ percentage: e, $offsetBottom: t, $offsetRight: r, $fullWidth: o, ...s }) => /* @__PURE__ */ n(i, {
|
|
20
|
+
$offsetBottom: t,
|
|
21
|
+
$offsetRight: r,
|
|
22
|
+
$fullWidth: o,
|
|
23
|
+
...s,
|
|
24
|
+
children: /* @__PURE__ */ n(a, { $percentage: e })
|
|
25
|
+
});
|
|
26
|
+
export { o as ProgressBar };
|
package/dist/radio.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { a as e, r as t } from "./dist-DD9Lv2Ja.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import i from "styled-components";
|
|
5
|
+
// atoms/Radio/index.tsx
|
|
6
|
+
var a = i.label`
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
width: ${({ theme: e }) => `calc(${e.elements.form.height} / 1.5)`};
|
|
11
|
+
height: ${({ theme: e }) => `calc(${e.elements.form.height} / 1.5)`};
|
|
12
|
+
margin-right: ${t};
|
|
13
|
+
margin-bottom: ${e};
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
position: relative;
|
|
16
|
+
user-select: none;
|
|
17
|
+
`, o = i.input.attrs({ type: "radio" })`
|
|
18
|
+
position: absolute;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
height: 0;
|
|
22
|
+
width: 0;
|
|
23
|
+
`, s = i.div`
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
display: grid;
|
|
27
|
+
place-items: center;
|
|
28
|
+
background-color: ${({ theme: e }) => e.colors.overlay};
|
|
29
|
+
background-image: ${({ theme: e }) => e.effects.texture};
|
|
30
|
+
backdrop-filter: ${({ theme: e }) => e.effects.texture};
|
|
31
|
+
border: ${({ theme: e }) => e.border.size} solid
|
|
32
|
+
color-mix(in srgb, ${({ theme: e }) => e.colors.sectionContent} 25%, transparent);
|
|
33
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
34
|
+
clip-path: ${({ theme: e }) => e.geometry.shape};
|
|
35
|
+
box-shadow: ${({ theme: e }) => e.shadows.section};
|
|
36
|
+
transition: background-color ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.standard};
|
|
37
|
+
|
|
38
|
+
&::before {
|
|
39
|
+
content: '';
|
|
40
|
+
width: 50%;
|
|
41
|
+
height: 50%;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
background-color: currentcolor;
|
|
44
|
+
opacity: 0;
|
|
45
|
+
transform: scale(0);
|
|
46
|
+
transition: transform ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.spring};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${o}:checked + & {
|
|
50
|
+
background-color: ${({ theme: e }) => e.colors.highlighted};
|
|
51
|
+
border-color: ${({ theme: e }) => e.colors.highlighted};
|
|
52
|
+
color: ${({ theme: e }) => e.colors.highlightedContent};
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
transform: scale(1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`, c = ({ name: e, id: t, value: i, checked: c, onChange: l, $offsetBottom: u, $offsetRight: d, $fullWidth: f, ...p }) => /* @__PURE__ */ r(a, {
|
|
60
|
+
$offsetBottom: u,
|
|
61
|
+
$offsetRight: d,
|
|
62
|
+
$fullWidth: f,
|
|
63
|
+
children: [/* @__PURE__ */ n(o, {
|
|
64
|
+
id: t,
|
|
65
|
+
name: e,
|
|
66
|
+
value: i,
|
|
67
|
+
checked: c,
|
|
68
|
+
onChange: l,
|
|
69
|
+
...p
|
|
70
|
+
}), /* @__PURE__ */ n(s, {})]
|
|
71
|
+
});
|
|
72
|
+
export { c as Radio };
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "styled-components";
|
|
4
|
+
// shared/report-ui/ui.styles.ts
|
|
5
|
+
var i = r.section`
|
|
6
|
+
background: ${(e) => e.theme.colors.section};
|
|
7
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
8
|
+
border-radius: ${(e) => e.theme.border.radius};
|
|
9
|
+
padding: ${(e) => e.theme.offsets.section};
|
|
10
|
+
min-width: 0;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
${(e) => e.$accent ? `border-left: 3px solid ${e.$accent};` : ""}
|
|
13
|
+
`, a = r.header`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: baseline;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
gap: ${(e) => e.theme.offsets.betweenElements};
|
|
18
|
+
margin-bottom: ${(e) => e.theme.offsets.betweenElements};
|
|
19
|
+
min-width: 0;
|
|
20
|
+
`, o = r.h2`
|
|
21
|
+
font-size: 15px;
|
|
22
|
+
font-weight: 650;
|
|
23
|
+
margin: 0;
|
|
24
|
+
letter-spacing: 0.2px;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
overflow-wrap: anywhere;
|
|
28
|
+
`, s = r.span`
|
|
29
|
+
color: ${(e) => e.theme.colors.status?.faint?.content ?? e.theme.colors.sectionContent};
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
`, c = r.code`
|
|
32
|
+
font-family: ${(e) => e.theme.font.family.text};
|
|
33
|
+
font-size: 12.5px;
|
|
34
|
+
overflow-wrap: anywhere;
|
|
35
|
+
color: ${(e) => e.theme.colors.sectionContent};
|
|
36
|
+
`, l = r.span`
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 5px;
|
|
40
|
+
padding: 2px 8px;
|
|
41
|
+
border-radius: 999px;
|
|
42
|
+
font-size: 11.5px;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
letter-spacing: 0.2px;
|
|
45
|
+
white-space: ${(e) => e.$nowrap ? "nowrap" : "normal"};
|
|
46
|
+
max-width: 100%;
|
|
47
|
+
color: ${(e) => e.$color ?? e.theme.colors.status?.dim?.content ?? e.theme.colors.sectionContent};
|
|
48
|
+
background: ${(e) => e.$color ? `${e.$color}1f` : `${e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted}88`};
|
|
49
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.$color ? `${e.$color}55` : e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
50
|
+
`, u = r.input`
|
|
51
|
+
width: 100%;
|
|
52
|
+
background: ${(e) => e.theme.colors.overlay};
|
|
53
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
54
|
+
border-radius: ${(e) => e.theme.border.radius};
|
|
55
|
+
color: ${(e) => e.theme.colors.sectionContent};
|
|
56
|
+
padding: 8px 11px;
|
|
57
|
+
font-size: 13px;
|
|
58
|
+
outline: none;
|
|
59
|
+
&:focus { border-color: ${(e) => e.theme.colors.highlighted}; }
|
|
60
|
+
&::placeholder { color: ${(e) => e.theme.colors.status?.faint?.content ?? e.theme.colors.sectionContent}; }
|
|
61
|
+
`, d = r.div`
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
|
|
64
|
+
gap: ${(e) => e.theme.offsets.elementContent};
|
|
65
|
+
`, f = r.div`
|
|
66
|
+
background: ${(e) => e.theme.colors.overlay};
|
|
67
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
68
|
+
border-radius: ${(e) => e.theme.border.radius};
|
|
69
|
+
padding: 10px 12px;
|
|
70
|
+
`, p = r.div`
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
gap: ${(e) => e.theme.offsets.betweenElements};
|
|
74
|
+
min-width: 0;
|
|
75
|
+
`, m = r.div`
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: baseline;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: ${(e) => e.theme.offsets.elementContent};
|
|
80
|
+
min-width: 0;
|
|
81
|
+
`, h = r.div`
|
|
82
|
+
padding: calc(${(e) => e.theme.offsets.section} + ${(e) => e.theme.offsets.betweenElements}) ${(e) => e.theme.offsets.elementContent};
|
|
83
|
+
text-align: center;
|
|
84
|
+
color: ${(e) => e.theme.colors.status?.faint?.content ?? e.theme.colors.sectionContent};
|
|
85
|
+
font-size: 13px;
|
|
86
|
+
`, g = r.div`
|
|
87
|
+
font-size: 21px;
|
|
88
|
+
font-weight: 700;
|
|
89
|
+
color: ${(e) => e.$color ?? e.theme.colors.sectionContent};
|
|
90
|
+
line-height: 1.2;
|
|
91
|
+
`, _ = r.div`
|
|
92
|
+
font-size: 11px;
|
|
93
|
+
color: ${(e) => e.theme.colors.status?.dim?.content ?? e.theme.colors.sectionContent};
|
|
94
|
+
text-transform: uppercase;
|
|
95
|
+
letter-spacing: 0.6px;
|
|
96
|
+
`, v = ({ children: e, color: n, nowrap: r, ...i }) => /* @__PURE__ */ t(l, {
|
|
97
|
+
$color: n,
|
|
98
|
+
$nowrap: r,
|
|
99
|
+
...i,
|
|
100
|
+
children: e
|
|
101
|
+
}), y = ({ children: e }) => /* @__PURE__ */ t(h, { children: e }), b = ({ value: e, onChange: n, placeholder: r = "Filter…" }) => /* @__PURE__ */ t(u, {
|
|
102
|
+
value: e,
|
|
103
|
+
onChange: (e) => n(e.target.value),
|
|
104
|
+
placeholder: r,
|
|
105
|
+
"aria-label": r
|
|
106
|
+
}), x = ({ label: e, value: r, color: i }) => /* @__PURE__ */ n(f, { children: [/* @__PURE__ */ t(g, {
|
|
107
|
+
$color: i,
|
|
108
|
+
children: r
|
|
109
|
+
}), /* @__PURE__ */ t(_, { children: e })] }), S = ({ children: e }) => /* @__PURE__ */ t(d, { children: e }), C = r.div`
|
|
110
|
+
display: grid;
|
|
111
|
+
grid-template-columns: 96px minmax(0, 1fr) 120px;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: ${(e) => e.theme.offsets.elementContent};
|
|
114
|
+
margin-bottom: 6px;
|
|
115
|
+
`, w = r.div`
|
|
116
|
+
position: relative;
|
|
117
|
+
height: 10px;
|
|
118
|
+
border-radius: 999px;
|
|
119
|
+
background: ${(e) => e.theme.colors.overlay};
|
|
120
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
`, T = r.div`
|
|
123
|
+
position: absolute;
|
|
124
|
+
inset: 0 auto 0 0;
|
|
125
|
+
width: ${(e) => `${Math.round(e.$score * 100)}%`};
|
|
126
|
+
background: ${(e) => e.$color};
|
|
127
|
+
opacity: ${(e) => e.$applied ? 1 : .25};
|
|
128
|
+
`, E = r.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-wrap: wrap;
|
|
131
|
+
gap: 4px;
|
|
132
|
+
margin: 0 0 10px 0;
|
|
133
|
+
`, D = r.span`
|
|
134
|
+
font-family: ${(e) => e.theme.font.family.text};
|
|
135
|
+
font-size: 11px;
|
|
136
|
+
padding: 1px 6px;
|
|
137
|
+
border-radius: 4px;
|
|
138
|
+
color: ${(e) => e.theme.colors.status?.dim?.content ?? e.theme.colors.sectionContent};
|
|
139
|
+
background: ${(e) => e.theme.colors.overlay};
|
|
140
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
141
|
+
`, O = r.ul`
|
|
142
|
+
margin: 0;
|
|
143
|
+
padding-left: 18px;
|
|
144
|
+
font-size: 12.5px;
|
|
145
|
+
color: ${(e) => e.theme.colors.status?.dim?.content ?? e.theme.colors.sectionContent};
|
|
146
|
+
`, k = r.li`
|
|
147
|
+
margin-bottom: 3px;
|
|
148
|
+
color: ${(e) => e.$tone === "veto" ? e.theme.colors.status?.warn?.content ?? e.theme.colors.sectionContent : e.theme.colors.status?.dim?.content ?? e.theme.colors.sectionContent};
|
|
149
|
+
`, A = r.strong`
|
|
150
|
+
color: ${(e) => e.theme.colors.status?.ok?.content ?? e.theme.colors.sectionContent};
|
|
151
|
+
`, j = (e) => Number.isFinite(e) ? e.toFixed(2) : "—", M = (e) => Number.isFinite(e) ? `${Math.round(e * 100)}%` : "—", N = ({ decision: r }) => /* @__PURE__ */ t(e, { children: (r?.signals ?? []).map((e) => /* @__PURE__ */ n(v, {
|
|
152
|
+
color: e.color,
|
|
153
|
+
nowrap: !0,
|
|
154
|
+
title: `${String(e.label)} ${j(e.score)} · ${M(e.weight)} weight · ${M(e.contribution)} of the verdict`,
|
|
155
|
+
children: [
|
|
156
|
+
e.short,
|
|
157
|
+
" ",
|
|
158
|
+
j(e.score)
|
|
159
|
+
]
|
|
160
|
+
}, e.key)) }), P = ({ decision: e, fix: r, title: c = "Why this verdict", accent: l }) => e ? /* @__PURE__ */ n(i, {
|
|
161
|
+
$accent: l,
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ n(a, { children: [
|
|
164
|
+
/* @__PURE__ */ t(o, { children: c }),
|
|
165
|
+
/* @__PURE__ */ n(v, {
|
|
166
|
+
color: l,
|
|
167
|
+
nowrap: !0,
|
|
168
|
+
children: [
|
|
169
|
+
"confidence ",
|
|
170
|
+
j(e.confidence),
|
|
171
|
+
" (",
|
|
172
|
+
M(e.confidence),
|
|
173
|
+
")"
|
|
174
|
+
]
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ n(s, { children: [
|
|
177
|
+
"duplicate ≥ ",
|
|
178
|
+
j(e.thresholds.duplicate),
|
|
179
|
+
" · similar ≥",
|
|
180
|
+
" ",
|
|
181
|
+
j(e.thresholds.similar)
|
|
182
|
+
] })
|
|
183
|
+
] }),
|
|
184
|
+
(e.signals ?? []).map((e) => /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ n(C, {
|
|
185
|
+
title: e.what,
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ t("span", {
|
|
188
|
+
style: {
|
|
189
|
+
color: e.color,
|
|
190
|
+
fontWeight: 600
|
|
191
|
+
},
|
|
192
|
+
children: e.label
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(T, {
|
|
195
|
+
$score: e.score,
|
|
196
|
+
$color: e.color,
|
|
197
|
+
$applied: e.applied
|
|
198
|
+
}) }),
|
|
199
|
+
/* @__PURE__ */ n(s, { children: [
|
|
200
|
+
j(e.score),
|
|
201
|
+
" · w ",
|
|
202
|
+
M(e.weight),
|
|
203
|
+
" ·",
|
|
204
|
+
" ",
|
|
205
|
+
M(e.contribution)
|
|
206
|
+
] })
|
|
207
|
+
]
|
|
208
|
+
}), e.evidence?.length ? /* @__PURE__ */ t(E, { children: e.evidence.map((e) => /* @__PURE__ */ n(D, {
|
|
209
|
+
title: e.key,
|
|
210
|
+
children: [
|
|
211
|
+
e.label,
|
|
212
|
+
": ",
|
|
213
|
+
e.value
|
|
214
|
+
]
|
|
215
|
+
}, e.key)) }) : null] }, e.key)),
|
|
216
|
+
/* @__PURE__ */ t(O, { children: (e.why ?? []).map((e, n) => /* @__PURE__ */ t(k, {
|
|
217
|
+
$tone: e.tone,
|
|
218
|
+
children: e.text
|
|
219
|
+
}, n)) }),
|
|
220
|
+
r ? /* @__PURE__ */ n("div", {
|
|
221
|
+
style: {
|
|
222
|
+
marginTop: 12,
|
|
223
|
+
fontSize: 13
|
|
224
|
+
},
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ t(A, { children: "Fix." }),
|
|
227
|
+
" ",
|
|
228
|
+
r.text
|
|
229
|
+
]
|
|
230
|
+
}) : null
|
|
231
|
+
]
|
|
232
|
+
}) : null, F = r.div`
|
|
233
|
+
max-width: none;
|
|
234
|
+
margin: 0 auto;
|
|
235
|
+
padding: calc(${(e) => e.theme.offsets.section} + ${(e) => e.theme.offsets.elementContent} / 2) ${(e) => e.theme.offsets.section} calc(${(e) => e.theme.offsets.section} * 4);
|
|
236
|
+
`, I = r.header`
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-wrap: wrap;
|
|
239
|
+
align-items: baseline;
|
|
240
|
+
gap: ${(e) => e.theme.offsets.betweenElements};
|
|
241
|
+
padding-bottom: ${(e) => e.theme.offsets.betweenElements};
|
|
242
|
+
border-bottom: ${(e) => e.theme.border.size} solid ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
243
|
+
margin-bottom: ${(e) => e.theme.offsets.section};
|
|
244
|
+
`, L = r.h1`
|
|
245
|
+
font-size: 18px;
|
|
246
|
+
margin: 0;
|
|
247
|
+
letter-spacing: 0.2px;
|
|
248
|
+
`, R = r.nav`
|
|
249
|
+
display: flex;
|
|
250
|
+
flex-wrap: wrap;
|
|
251
|
+
gap: 4px;
|
|
252
|
+
margin-bottom: ${(e) => e.theme.offsets.section};
|
|
253
|
+
`, z = r.a`
|
|
254
|
+
padding: 6px 12px;
|
|
255
|
+
border-radius: ${(e) => e.theme.border.radius};
|
|
256
|
+
font-size: 13px;
|
|
257
|
+
font-weight: 600;
|
|
258
|
+
color: ${(e) => e.$active ? e.theme.colors.sectionContent : e.theme.colors.status?.dim?.content ?? e.theme.colors.sectionContent};
|
|
259
|
+
background: ${(e) => e.$active ? e.theme.colors.overlay : "transparent"};
|
|
260
|
+
border: ${(e) => e.theme.border.size} solid ${(e) => e.$active ? e.theme.colors.highlighted : "transparent"};
|
|
261
|
+
&:hover { text-decoration: none; color: ${(e) => e.theme.colors.sectionContent}; }
|
|
262
|
+
`, B = r.div`
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-wrap: wrap;
|
|
265
|
+
gap: ${(e) => e.theme.offsets.betweenElements};
|
|
266
|
+
margin-top: ${(e) => e.theme.offsets.betweenElements};
|
|
267
|
+
padding-top: ${(e) => e.theme.offsets.betweenElements};
|
|
268
|
+
border-top: ${(e) => e.theme.border.size} dashed ${(e) => e.theme.colors.status?.edge?.background ?? e.theme.colors.highlighted};
|
|
269
|
+
font-size: 12px;
|
|
270
|
+
color: ${(e) => e.theme.colors.status?.faint?.content ?? e.theme.colors.sectionContent};
|
|
271
|
+
`, V = r.span`
|
|
272
|
+
display: inline-block;
|
|
273
|
+
width: 10px;
|
|
274
|
+
height: 10px;
|
|
275
|
+
border-radius: 2px;
|
|
276
|
+
background: ${(e) => e.$color};
|
|
277
|
+
margin-right: 5px;
|
|
278
|
+
vertical-align: baseline;
|
|
279
|
+
`;
|
|
280
|
+
export { v as Badge, l as BadgeBox, C as Bar, D as Chip, E as ChipRow, P as DecisionPanel, y as Empty, h as EmptyBox, T as Fill, A as FixMark, F as Frame, I as Head, B as Legend, c as Mono, i as Panel, a as PanelHead, L as Repo, m as Row, b as SearchBox, u as SearchInput, N as SignalPills, p as Stack, x as Stat, f as StatCell, d as StatGrid, _ as StatLabel, g as StatValue, S as Stats, s as Subtle, V as Swatch, z as TabLink, R as Tabs, o as Title, w as Track, O as Why, k as WhyLine };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { a as e, r as t } from "./dist-DD9Lv2Ja.js";
|
|
2
|
+
import { useCallback as n, useState as r } from "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
import o, { css as s } from "styled-components";
|
|
5
|
+
import { Input as c } from "@md-code/components/input";
|
|
6
|
+
import { FiSearch as l, FiX as u } from "react-icons/fi";
|
|
7
|
+
import { Button as d } from "@md-code/components/button";
|
|
8
|
+
// molecules/SearchInput/styles.ts
|
|
9
|
+
var f = o(d)`
|
|
10
|
+
border: none;
|
|
11
|
+
`, p = o(l)`
|
|
12
|
+
visibility: visible;
|
|
13
|
+
opacity: 1;
|
|
14
|
+
transition: visibility 0s, opacity ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.linear};
|
|
15
|
+
`, m = o(u)`
|
|
16
|
+
display: none;
|
|
17
|
+
`, h = o.div`
|
|
18
|
+
position: relative;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
${({ $isOpen: e, theme: t }) => e ? s`width: 100%;` : s`width: ${t.elements.form.height};`}
|
|
24
|
+
height: ${({ theme: e }) => e.elements.form.height};
|
|
25
|
+
margin-right: ${t};
|
|
26
|
+
margin-bottom: ${e};
|
|
27
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
28
|
+
background-color: ${({ theme: e }) => e.colors.section};
|
|
29
|
+
/*
|
|
30
|
+
* effects.texture is one string per theme (README §4.1, §5.3): noise themes
|
|
31
|
+
* supply a url() for background-image, glass themes supply blur() for
|
|
32
|
+
* backdrop-filter. The bar cannot know which theme is active, so it hands
|
|
33
|
+
* the value to BOTH properties; each property keeps only the value it
|
|
34
|
+
* understands and ignores the other (blur() in background-image computes to
|
|
35
|
+
* none, and url() left in backdrop-filter is visually inert — verified in
|
|
36
|
+
* Chromium). Both themes therefore texture the bar without a name check.
|
|
37
|
+
*/
|
|
38
|
+
background-image: ${({ theme: e }) => e.effects.texture};
|
|
39
|
+
backdrop-filter: ${({ theme: e }) => e.effects.texture};
|
|
40
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
41
|
+
clip-path: ${({ theme: e }) => e.geometry.shape};
|
|
42
|
+
box-shadow: ${({ theme: e }) => e.shadows.section};
|
|
43
|
+
transition: all ${({ theme: e }) => e.animation.speed.normal} ${({ theme: e }) => e.animation.easing.standard};
|
|
44
|
+
|
|
45
|
+
${m} {
|
|
46
|
+
display: ${({ $isOpen: e }) => e && "block"};
|
|
47
|
+
}
|
|
48
|
+
${p} {
|
|
49
|
+
display: ${({ $isOpen: e }) => e && "none"};
|
|
50
|
+
}
|
|
51
|
+
`, g = ({ id: e, name: t, value: o, onChangeValue: s, $offsetBottom: l, $offsetRight: u, $fullWidth: d, ...g }) => {
|
|
52
|
+
let [_, v] = r(!1), y = n((e) => {
|
|
53
|
+
let t = e.currentTarget.value;
|
|
54
|
+
s(t);
|
|
55
|
+
}, [s]), b = () => {
|
|
56
|
+
v(!_), _ && s();
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ a(h, {
|
|
59
|
+
$isOpen: _,
|
|
60
|
+
$offsetBottom: l,
|
|
61
|
+
$offsetRight: u,
|
|
62
|
+
children: [_ && /* @__PURE__ */ i(c, {
|
|
63
|
+
placeholder: "Search for an order",
|
|
64
|
+
id: e,
|
|
65
|
+
name: t,
|
|
66
|
+
autoFocus: !0,
|
|
67
|
+
value: o,
|
|
68
|
+
onChange: y,
|
|
69
|
+
$fullWidth: d,
|
|
70
|
+
...g
|
|
71
|
+
}), /* @__PURE__ */ a(f, {
|
|
72
|
+
onClick: b,
|
|
73
|
+
tone: "active",
|
|
74
|
+
children: [/* @__PURE__ */ i(p, {}), /* @__PURE__ */ i(m, {})]
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export { g as SearchInput };
|