@md-code/components 0.0.0-stage → 0.0.2
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/LICENSE +202 -0
- package/README.md +77 -2
- 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 +203 -0
- package/dist/calendar.js +101 -0
- package/dist/caption.js +14 -0
- package/dist/card.js +82 -0
- package/dist/carousel.js +125 -0
- package/dist/central-modal.js +22 -0
- package/dist/chip.js +42 -0
- package/dist/circle-image.js +22 -0
- package/dist/code-preview.js +38 -0
- package/dist/code-view-tokenizer.js +35 -0
- package/dist/code-view.js +96 -0
- package/dist/conditional-wrapper.js +5 -0
- package/dist/containers.js +115 -0
- package/dist/diff-legend.js +31 -0
- package/dist/div-input.js +103 -0
- package/dist/empty.js +12 -0
- package/dist/filter-bar.js +15 -0
- package/dist/form-label.js +19 -0
- package/dist/form.js +17 -0
- package/dist/full-screen-modal.js +27 -0
- package/dist/header.js +19 -0
- package/dist/html-editor.js +81 -0
- package/dist/icons.js +42 -0
- package/dist/input.js +62 -0
- package/dist/link.js +35 -0
- package/dist/loading.js +182 -0
- package/dist/logo.js +12 -0
- package/dist/modals.js +130 -0
- package/dist/molecules/Carousel/arrow.svg +5 -0
- package/dist/molecules/Select/arrow_down.svg +3 -0
- package/dist/mono-text.js +16 -0
- package/dist/nav-tabs.js +33 -0
- package/dist/page-header.js +20 -0
- package/dist/pagination.js +119 -0
- package/dist/progress-bar.js +26 -0
- package/dist/radio.js +73 -0
- package/dist/report-ui.js +358 -0
- package/dist/row.js +15 -0
- package/dist/score-panel.js +125 -0
- package/dist/score-pills.js +25 -0
- package/dist/search-input.js +84 -0
- package/dist/select.js +164 -0
- package/dist/separator.js +16 -0
- package/dist/slider-field.js +34 -0
- package/dist/stack.js +16 -0
- package/dist/stat-grid.js +10 -0
- package/dist/stat.js +24 -0
- package/dist/status-label.js +63 -0
- package/dist/status-text.js +13 -0
- package/dist/submit.js +57 -0
- package/dist/subtle-text.js +14 -0
- package/dist/surface.js +39 -0
- package/dist/switch.js +99 -0
- package/dist/table.js +132 -0
- package/dist/tabs.js +156 -0
- package/dist/text-checkbox.js +64 -0
- package/dist/text-link.js +20 -0
- package/dist/textarea.js +56 -0
- package/dist/textures/Cloud/clouds.svg +52 -0
- package/dist/textures.js +170 -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 +95 -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/Caption/index.d.ts +9 -0
- package/dist/types/atoms/Caption/index.d.ts.map +1 -0
- package/dist/types/atoms/Caption/styles.d.ts +9 -0
- package/dist/types/atoms/Caption/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/Chip/index.d.ts +39 -0
- package/dist/types/atoms/Chip/index.d.ts.map +1 -0
- package/dist/types/atoms/Chip/styles.d.ts +19 -0
- package/dist/types/atoms/Chip/styles.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/Empty/index.d.ts +10 -0
- package/dist/types/atoms/Empty/index.d.ts.map +1 -0
- package/dist/types/atoms/Empty/styles.d.ts +9 -0
- package/dist/types/atoms/Empty/styles.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 +49 -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 +27 -0
- package/dist/types/atoms/Loading/index.d.ts.map +1 -0
- package/dist/types/atoms/Loading/styles.d.ts +31 -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/MonoText/index.d.ts +23 -0
- package/dist/types/atoms/MonoText/index.d.ts.map +1 -0
- package/dist/types/atoms/MonoText/styles.d.ts +13 -0
- package/dist/types/atoms/MonoText/styles.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/Row/index.d.ts +8 -0
- package/dist/types/atoms/Row/index.d.ts.map +1 -0
- package/dist/types/atoms/Row/styles.d.ts +9 -0
- package/dist/types/atoms/Row/styles.d.ts.map +1 -0
- package/dist/types/atoms/Separator/index.d.ts +24 -0
- package/dist/types/atoms/Separator/index.d.ts.map +1 -0
- package/dist/types/atoms/Separator/styles.d.ts +14 -0
- package/dist/types/atoms/Separator/styles.d.ts.map +1 -0
- package/dist/types/atoms/Stack/index.d.ts +17 -0
- package/dist/types/atoms/Stack/index.d.ts.map +1 -0
- package/dist/types/atoms/Stack/styles.d.ts +12 -0
- package/dist/types/atoms/Stack/styles.d.ts.map +1 -0
- package/dist/types/atoms/Stat/index.d.ts +24 -0
- package/dist/types/atoms/Stat/index.d.ts.map +1 -0
- package/dist/types/atoms/Stat/styles.d.ts +19 -0
- package/dist/types/atoms/Stat/styles.d.ts.map +1 -0
- package/dist/types/atoms/StatusText/index.d.ts +17 -0
- package/dist/types/atoms/StatusText/index.d.ts.map +1 -0
- package/dist/types/atoms/StatusText/styles.d.ts +13 -0
- package/dist/types/atoms/StatusText/styles.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/SubtleText/index.d.ts +17 -0
- package/dist/types/atoms/SubtleText/index.d.ts.map +1 -0
- package/dist/types/atoms/SubtleText/styles.d.ts +12 -0
- package/dist/types/atoms/SubtleText/styles.d.ts.map +1 -0
- package/dist/types/atoms/Surface/index.d.ts +34 -0
- package/dist/types/atoms/Surface/index.d.ts.map +1 -0
- package/dist/types/atoms/Surface/styles.d.ts +27 -0
- package/dist/types/atoms/Surface/styles.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/TextLink/index.d.ts +22 -0
- package/dist/types/atoms/TextLink/index.d.ts.map +1 -0
- package/dist/types/atoms/TextLink/styles.d.ts +15 -0
- package/dist/types/atoms/TextLink/styles.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 +72 -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/Carousel/useIsMobile.d.ts +3 -0
- package/dist/types/molecules/Carousel/useIsMobile.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/CodeView/tokenizer.d.ts +21 -0
- package/dist/types/molecules/CodeView/tokenizer.d.ts.map +1 -0
- package/dist/types/molecules/DiffLegend/index.d.ts +20 -0
- package/dist/types/molecules/DiffLegend/index.d.ts.map +1 -0
- package/dist/types/molecules/DiffLegend/styles.d.ts +19 -0
- package/dist/types/molecules/DiffLegend/styles.d.ts.map +1 -0
- package/dist/types/molecules/FilterBar/index.d.ts +20 -0
- package/dist/types/molecules/FilterBar/index.d.ts.map +1 -0
- package/dist/types/molecules/FilterBar/styles.d.ts +15 -0
- package/dist/types/molecules/FilterBar/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/NavTabs/index.d.ts +24 -0
- package/dist/types/molecules/NavTabs/index.d.ts.map +1 -0
- package/dist/types/molecules/NavTabs/styles.d.ts +15 -0
- package/dist/types/molecules/NavTabs/styles.d.ts.map +1 -0
- package/dist/types/molecules/PageHeader/index.d.ts +15 -0
- package/dist/types/molecules/PageHeader/index.d.ts.map +1 -0
- package/dist/types/molecules/PageHeader/styles.d.ts +13 -0
- package/dist/types/molecules/PageHeader/styles.d.ts.map +1 -0
- package/dist/types/molecules/ScorePanel/index.d.ts +70 -0
- package/dist/types/molecules/ScorePanel/index.d.ts.map +1 -0
- package/dist/types/molecules/ScorePanel/styles.d.ts +63 -0
- package/dist/types/molecules/ScorePanel/styles.d.ts.map +1 -0
- package/dist/types/molecules/ScorePills/index.d.ts +25 -0
- package/dist/types/molecules/ScorePills/index.d.ts.map +1 -0
- package/dist/types/molecules/ScorePills/styles.d.ts +8 -0
- package/dist/types/molecules/ScorePills/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/SliderField/index.d.ts +26 -0
- package/dist/types/molecules/SliderField/index.d.ts.map +1 -0
- package/dist/types/molecules/SliderField/styles.d.ts +20 -0
- package/dist/types/molecules/SliderField/styles.d.ts.map +1 -0
- package/dist/types/molecules/StatGrid/index.d.ts +12 -0
- package/dist/types/molecules/StatGrid/index.d.ts.map +1 -0
- package/dist/types/molecules/StatGrid/styles.d.ts +9 -0
- package/dist/types/molecules/StatGrid/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/ContentCell.d.ts +13 -0
- package/dist/types/molecules/Table/TableCels/ContentCell.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 +8 -0
- package/dist/types/molecules/Table/TableCels/index.d.ts.map +1 -0
- package/dist/types/molecules/Table/TableCels/styles.d.ts +52 -0
- package/dist/types/molecules/Table/TableCels/styles.d.ts.map +1 -0
- package/dist/types/molecules/Table/index.d.ts +38 -0
- package/dist/types/molecules/Table/index.d.ts.map +1 -0
- package/dist/types/molecules/Table/styles.d.ts +25 -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/Pagination.d.ts +13 -0
- package/dist/types/shared/report-ui/Pagination.d.ts.map +1 -0
- package/dist/types/shared/report-ui/Pagination.styles.d.ts +13 -0
- package/dist/types/shared/report-ui/Pagination.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 +8 -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 +82 -0
- package/dist/validation.js +20 -0
- package/dist/wide-image.js +97 -0
- package/package.json +2100 -5
package/dist/button.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { LucideIcon as e } from "@md-code/components/icons";
|
|
3
|
+
import { Loader as t } from "@md-code/components/loading";
|
|
4
|
+
import n, { css as r } from "styled-components";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
// molecules/Button/styles.ts
|
|
7
|
+
var o = n.button`
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
|
|
12
|
+
/* Structural anchor for geometry.imprint, which the theme places into ::after. */
|
|
13
|
+
position: relative;
|
|
14
|
+
border: none;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
${({ $fullWidth: e }) => e && r`
|
|
17
|
+
width: 100%;
|
|
18
|
+
`}
|
|
19
|
+
height: ${({ theme: e }) => e.elements.form.height};
|
|
20
|
+
${({ $size: e, theme: t }) => e !== "icon" && r`
|
|
21
|
+
gap: ${t.offsets.betweenElements};
|
|
22
|
+
`}
|
|
23
|
+
|
|
24
|
+
&:disabled {
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
cursor: not-allowed;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
${(e) => {
|
|
30
|
+
let { theme: t, $tone: n, $weight: i, $size: a } = e, o = r`
|
|
31
|
+
/* empty */
|
|
32
|
+
`, s = n === "active" ? {
|
|
33
|
+
background: t.colors.highlighted,
|
|
34
|
+
content: t.colors.highlightedContent
|
|
35
|
+
} : n === "passive" ? {
|
|
36
|
+
background: t.colors.section,
|
|
37
|
+
content: t.colors.sectionContent
|
|
38
|
+
} : t.colors.status?.[n] ?? {
|
|
39
|
+
background: t.colors.section,
|
|
40
|
+
content: t.colors.sectionContent
|
|
41
|
+
}, c = s.background, l = s.content;
|
|
42
|
+
switch (i) {
|
|
43
|
+
case "bold":
|
|
44
|
+
o = r`
|
|
45
|
+
background-color: ${c};
|
|
46
|
+
color: ${l};
|
|
47
|
+
`;
|
|
48
|
+
break;
|
|
49
|
+
case "outline":
|
|
50
|
+
case "hollow":
|
|
51
|
+
o = r`
|
|
52
|
+
border: ${t.border.size} solid ${l};
|
|
53
|
+
background-color: transparent;
|
|
54
|
+
color: ${l};
|
|
55
|
+
`;
|
|
56
|
+
break;
|
|
57
|
+
case "light":
|
|
58
|
+
o = r`
|
|
59
|
+
background-color: transparent;
|
|
60
|
+
color: ${l};
|
|
61
|
+
`;
|
|
62
|
+
break;
|
|
63
|
+
case "link":
|
|
64
|
+
o = r`
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
color: ${l};
|
|
67
|
+
text-decoration: underline;
|
|
68
|
+
`;
|
|
69
|
+
break;
|
|
70
|
+
case "none":
|
|
71
|
+
o = r`
|
|
72
|
+
background-color: transparent;
|
|
73
|
+
color: inherit;
|
|
74
|
+
`;
|
|
75
|
+
break;
|
|
76
|
+
default: o = r`
|
|
77
|
+
background-color: ${c};
|
|
78
|
+
color: ${l};
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
let u = r`
|
|
82
|
+
/* empty */
|
|
83
|
+
`;
|
|
84
|
+
switch (a) {
|
|
85
|
+
case "small":
|
|
86
|
+
u = r`
|
|
87
|
+
padding: ${t.offsets.elementContent};
|
|
88
|
+
font-size: ${t.font.sizes.small};
|
|
89
|
+
`;
|
|
90
|
+
break;
|
|
91
|
+
case "medium":
|
|
92
|
+
u = r`
|
|
93
|
+
padding: ${t.offsets.elementContent};
|
|
94
|
+
font-size: ${t.font.sizes.regular};
|
|
95
|
+
`;
|
|
96
|
+
break;
|
|
97
|
+
case "large":
|
|
98
|
+
u = r`
|
|
99
|
+
padding: ${t.offsets.section};
|
|
100
|
+
font-size: ${t.font.sizes.regular};
|
|
101
|
+
`;
|
|
102
|
+
break;
|
|
103
|
+
case "icon":
|
|
104
|
+
u = r`
|
|
105
|
+
padding: ${t.offsets.elementContent};
|
|
106
|
+
width: ${t.elements.icons.width};
|
|
107
|
+
height: ${t.elements.icons.height};
|
|
108
|
+
`;
|
|
109
|
+
break;
|
|
110
|
+
default: u = r`
|
|
111
|
+
padding: ${t.offsets.elementContent};
|
|
112
|
+
font-size: ${t.font.sizes.regular};
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
return r`
|
|
116
|
+
${o}
|
|
117
|
+
${u}
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
* Everything below is read from theme-contract fields only. The Button
|
|
121
|
+
* never inspects the active theme's name, so any theme that supplies
|
|
122
|
+
* geometry/effects/font values renders correctly — a custom theme gets
|
|
123
|
+
* these decorations for free. The former depth/glow scales collapse into
|
|
124
|
+
* the resting section shadow plus one weak accent glow derived from the
|
|
125
|
+
* highlighted colour (README §5.3): glow is a shadow in the accent colour,
|
|
126
|
+
* not a stored scale.
|
|
127
|
+
*/
|
|
128
|
+
border-radius: ${t.border.radius};
|
|
129
|
+
clip-path: ${t.geometry.shape};
|
|
130
|
+
|
|
131
|
+
/*
|
|
132
|
+
* effects.texture is ONE string per theme (README §4.1, §5.3): a paper/
|
|
133
|
+
* noise theme supplies a url() that is legal only in background-image;
|
|
134
|
+
* a glass theme supplies blur() that is legal only in backdrop-filter.
|
|
135
|
+
* The Button must stay theme-agnostic (no theme-name gates), so the same
|
|
136
|
+
* value is handed to BOTH properties. Each property independently keeps
|
|
137
|
+
* the value it understands and ignores the other: blur(10px) in
|
|
138
|
+
* background-image computes to none, and the noise url() left in
|
|
139
|
+
* backdrop-filter is visually inert (verified in Chromium: a render is
|
|
140
|
+
* byte-identical to backdrop-filter none). Every theme therefore
|
|
141
|
+
* textures the surface through its own property without a name check.
|
|
142
|
+
*/
|
|
143
|
+
background-image: ${t.effects.texture};
|
|
144
|
+
backdrop-filter: ${t.effects.texture};
|
|
145
|
+
box-shadow:
|
|
146
|
+
${t.shadows.section},
|
|
147
|
+
0 0 10px color-mix(in srgb, ${t.colors.highlighted} 20%, transparent);
|
|
148
|
+
font-family: ${t.font.family.text};
|
|
149
|
+
|
|
150
|
+
/* Typographic role comes from the theme (README §4.2, §5.5, §6): viking
|
|
151
|
+
* paints its text uppercase at 700, liquidGlass sentence-case at 400. */
|
|
152
|
+
font-weight: ${t.font.weight.text};
|
|
153
|
+
text-transform: ${t.font.transform.text};
|
|
154
|
+
letter-spacing: ${t.font.spacing};
|
|
155
|
+
|
|
156
|
+
/*
|
|
157
|
+
* geometry.imprint is theme DATA, not component code (README §5.4, §6):
|
|
158
|
+
* a ready CSS fragment the theme builds from its own silhouette/colour/
|
|
159
|
+
* border values — viking's engraved accent outline, liquidGlass's glass
|
|
160
|
+
* frame. The Button only attaches it to ::after; it never constructs it
|
|
161
|
+
* or branches on a theme name, so any theme gets its own imprint for free.
|
|
162
|
+
* The position: relative on the base rule anchors this pseudo-element.
|
|
163
|
+
*/
|
|
164
|
+
&::after {
|
|
165
|
+
${t.geometry.imprint}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/*
|
|
169
|
+
* States belong to the theme (README §4.3): the Button only attaches the
|
|
170
|
+
* interaction fragments and owns no motion values of its own.
|
|
171
|
+
*/
|
|
172
|
+
&:hover {
|
|
173
|
+
${t.effects.interaction.hover}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&:active {
|
|
177
|
+
${t.effects.interaction.active}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&:focus-visible {
|
|
181
|
+
${t.effects.interaction.focus}
|
|
182
|
+
}
|
|
183
|
+
`;
|
|
184
|
+
}}
|
|
185
|
+
`, s = ({ icon: n, iconPosition: r = "left", iconLeft: s, iconRight: c, text: l, isLoading: u = !1, children: d, disabled: f = !1, className: p, size: m = "medium", tone: h = "active", weight: g = "bold", $fullWidth: _ = !1, ...v }) => {
|
|
186
|
+
let y = !!(l || d), b = s || (n && r === "left" ? n : void 0), x = c || (n && r === "right" ? n : void 0);
|
|
187
|
+
return /* @__PURE__ */ a(o, {
|
|
188
|
+
className: p,
|
|
189
|
+
$tone: h,
|
|
190
|
+
$weight: g,
|
|
191
|
+
$size: (b || x) && !y && !u ? "icon" : m,
|
|
192
|
+
$fullWidth: _,
|
|
193
|
+
disabled: f || u,
|
|
194
|
+
...v,
|
|
195
|
+
children: [
|
|
196
|
+
u && /* @__PURE__ */ i(t, {}),
|
|
197
|
+
!u && b && /* @__PURE__ */ i(e, { name: b }),
|
|
198
|
+
y && /* @__PURE__ */ a("span", { children: [l, d] }),
|
|
199
|
+
!u && x && /* @__PURE__ */ i(e, { name: x })
|
|
200
|
+
]
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
export { s as Button };
|
package/dist/calendar.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "styled-components";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
// atoms/Calendar/styles.ts
|
|
5
|
+
var r = e.div`
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: repeat(7, 1fr);
|
|
8
|
+
gap: ${({ theme: e }) => e.offsets.elementContent};
|
|
9
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
10
|
+
background: ${({ theme: e }) => e.colors.section};
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* effects.texture is one string per theme (README §4.1, §5.3): noise themes
|
|
14
|
+
* supply a url() for background-image, glass themes supply blur() for
|
|
15
|
+
* backdrop-filter. The grid cannot know which theme is active, so it hands
|
|
16
|
+
* the value to BOTH properties; each property keeps only the value it
|
|
17
|
+
* understands and ignores the other (blur() in background-image computes to
|
|
18
|
+
* none, and url() left in backdrop-filter is visually inert — verified in
|
|
19
|
+
* Chromium). Both themes therefore texture the grid without a name check.
|
|
20
|
+
*/
|
|
21
|
+
background-image: ${({ theme: e }) => e.effects.texture};
|
|
22
|
+
backdrop-filter: ${({ theme: e }) => e.effects.texture};
|
|
23
|
+
border: ${({ theme: e }) => e.border.size} solid
|
|
24
|
+
color-mix(in srgb, ${({ theme: e }) => e.colors.sectionContent} 25%, transparent);
|
|
25
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* A weekday header: a centred label on the section surface, closed by an
|
|
29
|
+
* accent rule. Its family and casing are the theme's text role.
|
|
30
|
+
*/
|
|
31
|
+
.header-cell {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
36
|
+
background-color: ${({ theme: e }) => e.colors.section};
|
|
37
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
38
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
39
|
+
font-weight: ${({ theme: e }) => e.font.weight.text};
|
|
40
|
+
text-transform: ${({ theme: e }) => e.font.transform.text};
|
|
41
|
+
border-bottom: ${({ theme: e }) => e.border.size} solid ${({ theme: e }) => e.colors.highlighted};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* A day cell: a square muted-outlined tile on the section surface. The
|
|
46
|
+
* hover state may invert to the accent pair (state selectors are exempt from
|
|
47
|
+
* proper-naming, README §4.3) and carries a derived accent glow (README
|
|
48
|
+
* §5.3). Previous-month days recede through opacity over the content colour.
|
|
49
|
+
*/
|
|
50
|
+
.day-cell {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
width: 100%;
|
|
56
|
+
aspect-ratio: 1;
|
|
57
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
60
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
61
|
+
border: ${({ theme: e }) => e.border.size} solid
|
|
62
|
+
color-mix(in srgb, ${({ theme: e }) => e.colors.sectionContent} 25%, transparent);
|
|
63
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
64
|
+
transition:
|
|
65
|
+
background-color ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.standard},
|
|
66
|
+
color ${({ theme: e }) => e.animation.speed.fast} ${({ theme: e }) => e.animation.easing.standard};
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
background-color: ${({ theme: e }) => e.colors.highlighted};
|
|
70
|
+
color: ${({ theme: e }) => e.colors.highlightedContent};
|
|
71
|
+
box-shadow: 0 0 ${({ theme: e }) => e.offsets.elementContent}
|
|
72
|
+
color-mix(in srgb, ${({ theme: e }) => e.colors.highlighted} 40%, transparent);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.prev-month {
|
|
76
|
+
opacity: 0.5;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`, i = (e) => String(e).padStart(2, "0"), a = (e) => `${String(e.getFullYear()).padStart(4, "0")}-${i(e.getMonth() + 1)}-${i(e.getDate())}`, o = () => {
|
|
80
|
+
let e = new Intl.DateTimeFormat("en-US", { weekday: "short" }), t = [];
|
|
81
|
+
for (let n = 0; n < 7; n++) t.push(e.format(new Date(2024, 0, 7 + n)));
|
|
82
|
+
return t;
|
|
83
|
+
}, s = (e = /* @__PURE__ */ new Date()) => {
|
|
84
|
+
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = new Date(e.getFullYear(), e.getMonth(), 1 - t.getDay()), r = [];
|
|
85
|
+
for (let t = 0; t < 42; t++) r.push({
|
|
86
|
+
key: a(n),
|
|
87
|
+
dayOfMonth: String(n.getDate()),
|
|
88
|
+
isCurrentMonth: n.getMonth() === e.getMonth()
|
|
89
|
+
}), n.setDate(n.getDate() + 1);
|
|
90
|
+
return r;
|
|
91
|
+
}, c = () => {
|
|
92
|
+
let e = o(), i = s();
|
|
93
|
+
return /* @__PURE__ */ n(r, { children: [e.map((e) => /* @__PURE__ */ t("div", {
|
|
94
|
+
className: "header-cell",
|
|
95
|
+
children: e
|
|
96
|
+
}, e)), i.map((e) => /* @__PURE__ */ t("div", {
|
|
97
|
+
className: e.isCurrentMonth ? "day-cell" : "day-cell prev-month",
|
|
98
|
+
children: e.dayOfMonth
|
|
99
|
+
}, e.key))] });
|
|
100
|
+
};
|
|
101
|
+
export { c as default };
|
package/dist/caption.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "styled-components";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
// atoms/Caption/styles.ts
|
|
5
|
+
var n = e.div`
|
|
6
|
+
font-size: calc(${({ theme: e }) => e.font.sizes.small} - ${({ theme: e }) => e.border.size});
|
|
7
|
+
color: ${({ theme: e }) => e.colors.status?.dim?.content ?? e.colors.sectionContent};
|
|
8
|
+
text-transform: uppercase;
|
|
9
|
+
letter-spacing: calc(${({ theme: e }) => e.font.spacing} * 3);
|
|
10
|
+
`, r = ({ children: e, ...r }) => /* @__PURE__ */ t(n, {
|
|
11
|
+
...r,
|
|
12
|
+
children: e
|
|
13
|
+
});
|
|
14
|
+
export { r as Caption };
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { PlainText as e } from "@md-code/components/typography";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Link as t } from "@md-code/components/link";
|
|
4
|
+
import { withOffsetBottom as n, withOffsetsRight as r } from "@md-code/styles";
|
|
5
|
+
import i from "styled-components";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
// molecules/Card/styles.ts
|
|
8
|
+
var s = i.div`
|
|
9
|
+
margin-right: ${r};
|
|
10
|
+
margin-bottom: ${n};
|
|
11
|
+
background-color: ${({ theme: e }) => e.colors.section};
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* effects.texture is one string per theme (README §4.1, §5.3): noise themes
|
|
15
|
+
* supply a url() for background-image, glass themes supply blur() for
|
|
16
|
+
* backdrop-filter. The card cannot know which theme is active, so it hands
|
|
17
|
+
* the value to BOTH properties; each property keeps only the value it
|
|
18
|
+
* understands and ignores the other (blur() in background-image computes to
|
|
19
|
+
* none, and url() left in backdrop-filter is visually inert — verified in
|
|
20
|
+
* Chromium). Both themes therefore texture the card without a name check.
|
|
21
|
+
*/
|
|
22
|
+
background-image: ${({ theme: e }) => e.effects.texture};
|
|
23
|
+
backdrop-filter: ${({ theme: e }) => e.effects.texture};
|
|
24
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
25
|
+
clip-path: ${({ theme: e }) => e.geometry.shape};
|
|
26
|
+
box-shadow: ${({ theme: e }) => e.shadows.section};
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
transition: all ${({ theme: e }) => e.animation.speed.normal} ${({ theme: e }) => e.animation.easing.standard};
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
${({ theme: e }) => e.effects.interaction.hover}
|
|
35
|
+
}
|
|
36
|
+
`, c = i.img`
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: auto;
|
|
39
|
+
object-fit: cover;
|
|
40
|
+
`, l = i.div`
|
|
41
|
+
padding: ${({ theme: e }) => e.offsets.elementContent};
|
|
42
|
+
`, u = i.h3`
|
|
43
|
+
font-size: ${({ theme: e }) => e.font.sizes.large};
|
|
44
|
+
margin-bottom: ${({ theme: e }) => e.offsets.elementContent};
|
|
45
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
46
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
47
|
+
`, d = i.p`
|
|
48
|
+
font-size: ${({ theme: e }) => e.font.sizes.regular};
|
|
49
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
50
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
51
|
+
line-height: 1.5;
|
|
52
|
+
`, f = i.div`
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
align-items: center;
|
|
56
|
+
padding: 0 ${({ theme: e }) => e.offsets.elementContent} ${({ theme: e }) => e.offsets.elementContent};
|
|
57
|
+
font-size: ${({ theme: e }) => e.font.sizes.small};
|
|
58
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
59
|
+
`, p = i(t)`
|
|
60
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
61
|
+
color: ${({ theme: e }) => e.colors.highlighted};
|
|
62
|
+
font-weight: bold;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
text-decoration: underline;
|
|
67
|
+
}
|
|
68
|
+
`, m = ({ image: t, title: n, description: r, date: i, link: m, ...h }) => /* @__PURE__ */ o(s, {
|
|
69
|
+
...h,
|
|
70
|
+
children: [
|
|
71
|
+
t && /* @__PURE__ */ a(c, {
|
|
72
|
+
src: t,
|
|
73
|
+
alt: n
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ o(l, { children: [/* @__PURE__ */ a(u, { children: n }), /* @__PURE__ */ a(d, { children: r })] }),
|
|
76
|
+
/* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(e, { children: i }), /* @__PURE__ */ a(p, {
|
|
77
|
+
href: m,
|
|
78
|
+
children: "Read more →"
|
|
79
|
+
})] })
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
export { m as Card };
|
package/dist/carousel.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
import { Column as r, ColumnsContainer as i } from "@md-code/components/containers";
|
|
3
|
+
import a from "@md-code/components/conditional-wrapper";
|
|
4
|
+
import o from "@md-code/components/circle-image";
|
|
5
|
+
import { PlainText as s, SectionTitle as c } from "@md-code/components/typography";
|
|
6
|
+
import { debounce as l } from "@md-code/utils";
|
|
7
|
+
import u from "styled-components";
|
|
8
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
// molecules/Carousel/arrow.svg
|
|
10
|
+
var m = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100.96%2084.55'%3e%3cpolyline%20points='53.89%203.99%202.46%2046.71%2053.89%2083.33'/%3e%3cpolyline%20points='53.84%2013.88%2015.22%2045.95%2053.84%2073.44'/%3e%3c/svg%3e", h = () => {
|
|
11
|
+
let [t, r] = n(null);
|
|
12
|
+
return e(() => {
|
|
13
|
+
let e = () => {
|
|
14
|
+
let e = navigator.userAgent;
|
|
15
|
+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);
|
|
16
|
+
};
|
|
17
|
+
r(e());
|
|
18
|
+
let t = () => {
|
|
19
|
+
r(e());
|
|
20
|
+
};
|
|
21
|
+
return window.addEventListener("resize", t), window.addEventListener("orientationchange", t), () => {
|
|
22
|
+
window.removeEventListener("resize", t), window.removeEventListener("orientationchange", t);
|
|
23
|
+
};
|
|
24
|
+
}, []), t;
|
|
25
|
+
}, g = u.div`
|
|
26
|
+
position: relative;
|
|
27
|
+
z-index: ${({ theme: e }) => e.zIndex.content};
|
|
28
|
+
height: 100%;
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: repeat(${({ $slidsCount: e }) => e}, 100%);
|
|
31
|
+
grid-template-rows: 1fr;
|
|
32
|
+
${({ $isMobile: e }) => e ? "\n overflow-x: scroll;\n " : "\n overflow-x: hidden;\n "}
|
|
33
|
+
overflow-y: hidden;
|
|
34
|
+
scroll-snap-type: x mandatory;
|
|
35
|
+
scrollbar-color: transparent transparent;
|
|
36
|
+
|
|
37
|
+
/* Smooth scroll is the component's own mechanic. */
|
|
38
|
+
scroll-behavior: smooth;
|
|
39
|
+
|
|
40
|
+
&.active {
|
|
41
|
+
scroll-snap-type: unset;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&::-webkit-scrollbar {
|
|
45
|
+
display: none; /* Safari and Chrome */
|
|
46
|
+
}
|
|
47
|
+
`, _ = u.div`
|
|
48
|
+
scroll-snap-align: center;
|
|
49
|
+
display: flex;
|
|
50
|
+
`, v = u.div`
|
|
51
|
+
position: relative;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
`, y = u.div`
|
|
56
|
+
z-index: ${({ theme: e }) => e.zIndex.alert};
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 50%;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
transform: translateY(-50%);
|
|
61
|
+
user-select: none;
|
|
62
|
+
color: ${({ theme: e }) => e.colors.sectionContent};
|
|
63
|
+
opacity: ${({ $isActive: e }) => e ? 1 : .4};
|
|
64
|
+
|
|
65
|
+
${({ $side: e, theme: t }) => ({
|
|
66
|
+
prev: `
|
|
67
|
+
left: ${t.offsets.section};
|
|
68
|
+
`,
|
|
69
|
+
next: `
|
|
70
|
+
right: ${t.offsets.section};
|
|
71
|
+
transform: translateY(-50%) scaleX(-1);
|
|
72
|
+
`
|
|
73
|
+
})[e]};
|
|
74
|
+
|
|
75
|
+
& polyline {
|
|
76
|
+
fill: transparent;
|
|
77
|
+
stroke-miterlimit: 10;
|
|
78
|
+
stroke-width: calc(${({ theme: e }) => e.border.size} * 3);
|
|
79
|
+
stroke: currentcolor;
|
|
80
|
+
cursor: ${({ $isActive: e }) => e ? "pointer" : "default"};
|
|
81
|
+
}
|
|
82
|
+
`, b = ({ slides: e, reversed: u = !1 }) => {
|
|
83
|
+
let b = t(0), [x, S] = n(0), C = h(), w = t(null), T = (t) => {
|
|
84
|
+
if (!w.current) return;
|
|
85
|
+
let n = w.current.offsetWidth, r = w.current.scrollLeft;
|
|
86
|
+
if (t === "next") {
|
|
87
|
+
if (e.length - 1 <= x) return;
|
|
88
|
+
S(Math.min(x + 1, e.length - 1)), w.current.scrollLeft = r + n;
|
|
89
|
+
} else {
|
|
90
|
+
if (x <= 0) return;
|
|
91
|
+
S(Math.max(x - 1, 0)), w.current.scrollLeft = r - n;
|
|
92
|
+
}
|
|
93
|
+
}, E = l((t) => {
|
|
94
|
+
if (!C || !w.current) return;
|
|
95
|
+
let n = t.target.scrollLeft, r = n - b.current;
|
|
96
|
+
r < 0 ? S(Math.max(x - 1, 0)) : r > 0 && S(Math.min(x + 1, e.length - 1)), b.current = n;
|
|
97
|
+
}, 50);
|
|
98
|
+
return /* @__PURE__ */ p(v, { children: [
|
|
99
|
+
/* @__PURE__ */ f(y, {
|
|
100
|
+
$side: "prev",
|
|
101
|
+
onClick: () => T("prev"),
|
|
102
|
+
dangerouslySetInnerHTML: { __html: m },
|
|
103
|
+
$isActive: x > 0
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ f(g, {
|
|
106
|
+
ref: (e) => {
|
|
107
|
+
w.current = e;
|
|
108
|
+
},
|
|
109
|
+
onScroll: E,
|
|
110
|
+
$slidsCount: e.length,
|
|
111
|
+
$isMobile: C,
|
|
112
|
+
children: e.map((e) => /* @__PURE__ */ f(_, { children: /* @__PURE__ */ f(a, {
|
|
113
|
+
Wrapper: C ? r : i,
|
|
114
|
+
children: C || u ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(r, { children: /* @__PURE__ */ f(o, { src: e.url }) }), /* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(c, { children: e.title }), /* @__PURE__ */ f(s, { children: e.text })] })] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(c, { children: e.title }), /* @__PURE__ */ f(s, { children: e.text })] }), /* @__PURE__ */ f(r, { children: /* @__PURE__ */ f(o, { src: e.url }) })] })
|
|
115
|
+
}) }, e.url))
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ f(y, {
|
|
118
|
+
$side: "next",
|
|
119
|
+
onClick: () => T("next"),
|
|
120
|
+
dangerouslySetInnerHTML: { __html: m },
|
|
121
|
+
$isActive: x < e.length - 1
|
|
122
|
+
})
|
|
123
|
+
] });
|
|
124
|
+
};
|
|
125
|
+
export { b as Carousel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
import t from "react-dom";
|
|
3
|
+
import { ModalContainer as n, ModalContentContainer as r, Overlay as i, StyledModal as a, useModal as o } from "@md-code/components/modals";
|
|
4
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
// atoms/CentralModal/index.tsx
|
|
6
|
+
var u = () => {
|
|
7
|
+
let { modalData: u, setModalData: d } = o(), [f, p] = e(!1);
|
|
8
|
+
return u ? t.createPortal(/* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(i, {
|
|
9
|
+
onClick: () => {
|
|
10
|
+
p(!0), setTimeout(() => {
|
|
11
|
+
d(null), p(!1);
|
|
12
|
+
}, 200);
|
|
13
|
+
},
|
|
14
|
+
$isClosing: f
|
|
15
|
+
}), /* @__PURE__ */ c(n, {
|
|
16
|
+
"data-test-id": "central-modal-container",
|
|
17
|
+
$isClosing: f,
|
|
18
|
+
$fullScreen: !1,
|
|
19
|
+
children: /* @__PURE__ */ c(a, { children: /* @__PURE__ */ c(r, { children: u.content }) })
|
|
20
|
+
})] }), document.body) : null;
|
|
21
|
+
};
|
|
22
|
+
export { u as CentralModal };
|
package/dist/chip.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import e from "styled-components";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
// atoms/Chip/styles.ts
|
|
5
|
+
var n = e.span`
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: calc(${({ theme: e }) => e.offsets.elementContent} * 0.625);
|
|
9
|
+
padding: calc(${({ theme: e }) => e.offsets.elementContent} / 4) ${({ theme: e }) => e.offsets.elementContent};
|
|
10
|
+
border: ${({ theme: e }) => e.border.size} solid
|
|
11
|
+
${({ $status: e, theme: t }) => (e ? t.colors.status?.[e] : void 0)?.paint ?? t.colors.status?.edge?.background ?? t.colors.highlighted};
|
|
12
|
+
border-radius: ${({ theme: e }) => e.border.radius};
|
|
13
|
+
font-size: ${({ theme: e }) => e.font.sizes.small};
|
|
14
|
+
font-weight: ${({ theme: e }) => e.font.weight.title};
|
|
15
|
+
letter-spacing: ${({ theme: e }) => e.font.spacing};
|
|
16
|
+
white-space: ${({ $nowrap: e }) => e ? "nowrap" : "normal"};
|
|
17
|
+
cursor: ${({ $interactive: e }) => e ? "pointer" : "inherit"};
|
|
18
|
+
background: ${({ $active: e, $status: t, theme: n }) => e ? n.colors.highlighted : (t ? n.colors.status?.[t] : void 0)?.background ?? n.colors.status?.edge?.paint ?? n.colors.section};
|
|
19
|
+
color: ${({ $active: e, $status: t, theme: n }) => e ? n.colors.highlightedContent : (t ? n.colors.status?.[t] : void 0)?.content ?? n.colors.status?.dim?.content ?? n.colors.sectionContent};
|
|
20
|
+
`, r = (e) => {
|
|
21
|
+
if (e.as === "button") {
|
|
22
|
+
let { as: r, $status: i, $nowrap: a, $active: o, ...s } = e;
|
|
23
|
+
return /* @__PURE__ */ t(n, {
|
|
24
|
+
as: r,
|
|
25
|
+
type: "button",
|
|
26
|
+
$interactive: !0,
|
|
27
|
+
$status: i,
|
|
28
|
+
$nowrap: a,
|
|
29
|
+
$active: o,
|
|
30
|
+
...s
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
let { as: r, $status: i, $nowrap: a, $active: o, ...s } = e;
|
|
34
|
+
return /* @__PURE__ */ t(n, {
|
|
35
|
+
as: r,
|
|
36
|
+
$status: i,
|
|
37
|
+
$nowrap: a,
|
|
38
|
+
$active: o,
|
|
39
|
+
...s
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
export { r as Chip };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import e from "next-image-export-optimizer";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import n from "styled-components";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
// atoms/CircleImage/index.tsx
|
|
6
|
+
var i = n(e)`
|
|
7
|
+
width: auto;
|
|
8
|
+
height: auto;
|
|
9
|
+
max-height: 100%;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
z-index: ${({ theme: e, $zIndex: t }) => t ? e.zIndex[t] : e.zIndex.content};
|
|
12
|
+
`, a = t(({ src: e, alt: t = "huge image of landscape on background", width: n = 2040, height: a = 1152, priority: o = !1, zIndex: s }, c) => /* @__PURE__ */ r(i, {
|
|
13
|
+
src: e,
|
|
14
|
+
alt: t,
|
|
15
|
+
width: n,
|
|
16
|
+
height: a,
|
|
17
|
+
priority: o,
|
|
18
|
+
$zIndex: s,
|
|
19
|
+
ref: c
|
|
20
|
+
}));
|
|
21
|
+
a.displayName = "CircleImage";
|
|
22
|
+
export { a as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect as e } from "react";
|
|
2
|
+
import t from "prismjs";
|
|
3
|
+
import n, { ThemeProvider as r } from "styled-components";
|
|
4
|
+
import { codeEditor as i } from "@md-code/styles";
|
|
5
|
+
import "prism-themes/themes/prism-one-light.css";
|
|
6
|
+
import "prismjs/components/prism-json";
|
|
7
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
8
|
+
// atoms/CodePreview/index.tsx
|
|
9
|
+
var o = n.pre`
|
|
10
|
+
margin: 0;
|
|
11
|
+
background: ${({ theme: e }) => e.colors.section};
|
|
12
|
+
height: 100%;
|
|
13
|
+
overflow: auto;
|
|
14
|
+
white-space: pre-wrap;
|
|
15
|
+
overflow-wrap: break-word;
|
|
16
|
+
|
|
17
|
+
code {
|
|
18
|
+
font-family: ${({ theme: e }) => e.font.family.text};
|
|
19
|
+
font-size: ${({ theme: e }) => e.font.sizes.regular};
|
|
20
|
+
line-height: 1.5;
|
|
21
|
+
white-space: pre-wrap;
|
|
22
|
+
overflow-wrap: break-word;
|
|
23
|
+
display: block;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
`, s = ({ rawValue: n, className: s }) => (e(() => {
|
|
27
|
+
t.highlightAll();
|
|
28
|
+
}, [n]), n ? /* @__PURE__ */ a(r, {
|
|
29
|
+
theme: i,
|
|
30
|
+
children: /* @__PURE__ */ a(o, {
|
|
31
|
+
className: s,
|
|
32
|
+
children: /* @__PURE__ */ a("code", {
|
|
33
|
+
className: "language-json",
|
|
34
|
+
children: typeof n == "string" ? n : JSON.stringify(n, null, 2)
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}) : null);
|
|
38
|
+
export { o as CodeBlock, s as CodePreview };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import e from "prismjs";
|
|
2
|
+
import "prismjs/components/prism-javascript.js";
|
|
3
|
+
import "prismjs/components/prism-typescript.js";
|
|
4
|
+
import "prismjs/components/prism-jsx.js";
|
|
5
|
+
import "prismjs/components/prism-tsx.js";
|
|
6
|
+
import "prismjs/components/prism-json.js";
|
|
7
|
+
// molecules/CodeView/tokenizer.ts
|
|
8
|
+
var t = {
|
|
9
|
+
ts: "typescript",
|
|
10
|
+
tsx: "tsx",
|
|
11
|
+
js: "javascript",
|
|
12
|
+
jsx: "jsx",
|
|
13
|
+
json: "json"
|
|
14
|
+
}, n = "typescript", r = (r) => {
|
|
15
|
+
let i = t[r] ?? r;
|
|
16
|
+
return e.languages[i] ? i : n;
|
|
17
|
+
}, i = (t, n) => {
|
|
18
|
+
let i = (e, t, n) => {
|
|
19
|
+
if (typeof e == "string") {
|
|
20
|
+
n.push({
|
|
21
|
+
text: e,
|
|
22
|
+
type: t
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (Array.isArray(e)) {
|
|
27
|
+
for (let r of e) i(r, t, n);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let r = typeof e.type == "string" ? e.type : t;
|
|
31
|
+
i(e.content, r, n);
|
|
32
|
+
}, a = r(n), o = [];
|
|
33
|
+
return i(e.tokenize(t, e.languages[a]), "", o), o.filter((e) => e.text.length > 0);
|
|
34
|
+
}, a = (e) => (t) => i(t, e);
|
|
35
|
+
export { a as tokenizerFor, i as tokensOf };
|