@stamcat/craftsman 0.0.27-alpha.5 → 0.0.27-alpha.7
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/Components.esm.js +7 -5
- package/Styles.esm.js +5 -5
- package/package.json +5 -1
- package/src/components/Input/Input.module.css +1 -1
- package/src/components/Input/Input.module.esm.js +1 -1
- package/src/components/{Loader.d.ts → Loader/Loader.d.ts} +1 -1
- package/src/components/{Loader.esm.js → Loader/Loader.esm.js} +4 -4
- package/src/{styles/global/components → components/Loader}/loaders.module.esm.js +1 -1
- package/src/components/{Modal.esm.js → Modal/Modal.esm.js} +4 -4
- package/src/components/Modal/Modal.module.css +1 -0
- package/src/components/Modal/Modal.module.esm.js +16 -0
- package/src/components/{Modal.module.scss → Modal/Modal.module.scss} +2 -2
- package/src/components/Text/Text.css +1 -0
- package/src/components/Text/Text.d.ts +10 -0
- package/src/components/Text/Text.scss +80 -0
- package/src/components/Text/Text2.esm.js +23 -0
- package/src/components/index.d.ts +3 -2
- package/src/styles/global/components/_typography.scss +85 -54
- package/src/styles/global/globalStyles.scss +58 -58
- package/src/styles/utilities/_functions.scss +3 -3
- package/src/utilities/types.d.ts +27 -0
- package/src/utilities/types.esm.js +22 -1
- package/src/components/Modal.module.css +0 -1
- package/src/components/Modal.module.esm.js +0 -16
- /package/src/{styles/global/components → components/Loader}/loaders.module.css +0 -0
- /package/src/{styles/global/components → components/Loader}/loaders.module.scss +0 -0
- /package/src/{styles/global/components/loaders.d.ts → components/Loader/types.d.ts} +0 -0
- /package/src/{styles/global/components/loaders.esm.js → components/Loader/types.esm.js} +0 -0
- /package/src/components/{Modal.d.ts → Modal/Modal.d.ts} +0 -0
package/Components.esm.js
CHANGED
|
@@ -2,21 +2,23 @@ import { __exportAll as e } from "./_virtual/_rolldown/runtime.esm.js";
|
|
|
2
2
|
import { Button as t } from "./src/components/Button.esm.js";
|
|
3
3
|
import { Input as n } from "./src/components/Input/Input.esm.js";
|
|
4
4
|
import { InputPassword as r } from "./src/components/Input/InputPassword.esm.js";
|
|
5
|
-
import { Loader as i } from "./src/components/Loader.esm.js";
|
|
5
|
+
import { Loader as i } from "./src/components/Loader/Loader.esm.js";
|
|
6
6
|
import { RadioButton as a } from "./src/components/Input/RadioButton.esm.js";
|
|
7
7
|
import { Checkbox as o } from "./src/components/Input/Checkbox.esm.js";
|
|
8
8
|
import { Textarea as s } from "./src/components/Input/Textarea.esm.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Text as c } from "./src/components/Text/Text2.esm.js";
|
|
10
|
+
import { Modal as l } from "./src/components/Modal/Modal.esm.js";
|
|
10
11
|
//#region src/components/index.ts
|
|
11
|
-
var
|
|
12
|
+
var u = /* @__PURE__ */ e({
|
|
12
13
|
Button: () => t,
|
|
13
14
|
Checkbox: () => o,
|
|
14
15
|
Input: () => n,
|
|
15
16
|
InputPassword: () => r,
|
|
16
17
|
Loader: () => i,
|
|
17
|
-
Modal: () =>
|
|
18
|
+
Modal: () => l,
|
|
18
19
|
RadioButton: () => a,
|
|
20
|
+
Text: () => c,
|
|
19
21
|
Textarea: () => s
|
|
20
22
|
});
|
|
21
23
|
//#endregion
|
|
22
|
-
export { t as Button, o as Checkbox, n as Input, r as InputPassword, i as Loader,
|
|
24
|
+
export { t as Button, o as Checkbox, n as Input, r as InputPassword, i as Loader, l as Modal, a as RadioButton, c as Text, s as Textarea, u as components_exports };
|
package/Styles.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defaultColors as e, defaultWidths as t } from "./src/styles/utilities/constants.esm.js";
|
|
2
2
|
import { color as n, colors as r, hexToRgba as i } from "./src/styles/utilities/color.esm.js";
|
|
3
|
-
import { BaseWidthSchema as a, BreakpointSchema as o, ButtonType as s, LayoutWidthsSchema as c, MaxScreenWidthSchema as l, ScreenWidthSchema as u,
|
|
4
|
-
import { breakpoint as
|
|
5
|
-
import { themeBuilder as
|
|
6
|
-
import { ThemeProvider as
|
|
7
|
-
export { a as BaseWidthSchema, o as BreakpointSchema, s as ButtonType, c as LayoutWidthsSchema, l as MaxScreenWidthSchema, u as ScreenWidthSchema,
|
|
3
|
+
import { BaseWidthSchema as a, BreakpointSchema as o, ButtonType as s, LayoutWidthsSchema as c, MaxScreenWidthSchema as l, ScreenWidthSchema as u, TextSize as d, TextTags as f, TextType as p, zLabelPosition as m, zTextInputExclusions as h, zTextInputType as g, zTextInputTypes as _ } from "./src/utilities/types.esm.js";
|
|
4
|
+
import { breakpoint as v, media as y, width as b, widths as x } from "./src/styles/utilities/layout.esm.js";
|
|
5
|
+
import { themeBuilder as S } from "./src/styles/theme/theme.esm.js";
|
|
6
|
+
import { ThemeProvider as C } from "./src/styles/components/ThemeProvider.esm.js";
|
|
7
|
+
export { a as BaseWidthSchema, o as BreakpointSchema, s as ButtonType, c as LayoutWidthsSchema, l as MaxScreenWidthSchema, u as ScreenWidthSchema, d as TextSize, f as TextTags, p as TextType, C as ThemeProvider, v as breakpoint, n as color, r as colors, e as defaultColors, t as defaultWidths, i as hexToRgba, y as media, S as themeBuilder, b as width, x as widths, m as zLabelPosition, h as zTextInputExclusions, g as zTextInputType, _ as zTextInputTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamcat/craftsman",
|
|
3
|
-
"version": "0.0.27-alpha.
|
|
3
|
+
"version": "0.0.27-alpha.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A powerful, lightweight framework for design systems",
|
|
6
6
|
"repository": {
|
|
@@ -88,6 +88,10 @@
|
|
|
88
88
|
"types": "./src/components/Textarea.d.ts",
|
|
89
89
|
"default": "./src/components/Textarea.esm.js"
|
|
90
90
|
},
|
|
91
|
+
"./Text": {
|
|
92
|
+
"types": "./src/components/Text.d.ts",
|
|
93
|
+
"default": "./src/components/Text.esm.js"
|
|
94
|
+
},
|
|
91
95
|
"./Modal": {
|
|
92
96
|
"types": "./src/components/Modal.d.ts",
|
|
93
97
|
"default": "./src/components/Modal.esm.js"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer craftsman-base{.
|
|
1
|
+
@layer craftsman-base{._wrapper_1xyh8_2[data-label-position=inside]{--react-international-phone-height:50px;--react-international-phone-border-radius:8px;--react-international-phone-border-color:silver;position:relative}}._wrapper_1xyh8_2 label ._inputLabel_1xyh8_9{margin-bottom:calc(var(--w-gutter) * .25)}._wrapper_1xyh8_2[data-required=true] label ._inputLabel_1xyh8_9:after{content:"*";color:var(--red700)}._wrapper_1xyh8_2[data-label-position=left] label{align-items:center;display:inline-flex}._wrapper_1xyh8_2[data-label-position=left] label ._inputLabel_1xyh8_9{width:fit-content;margin-right:calc(var(--w-gutter) * .75)}._wrapper_1xyh8_2[data-label-position=left]._textarea_1xyh8_24 label{align-items:flex-start}._wrapper_1xyh8_2[data-label-position=bottom] label{flex-direction:column-reverse;align-items:flex-start;display:inline-flex}._wrapper_1xyh8_2[data-label-position=bottom] label ._inputLabel_1xyh8_9{margin-bottom:0;margin-top:calc(var(--w-gutter) * .25)}._wrapper_1xyh8_2[data-label-position=right] label{flex-direction:row-reverse;align-items:baseline;display:inline-flex}._wrapper_1xyh8_2[data-label-position=right] label ._inputLabel_1xyh8_9{margin-left:calc(var(--w-gutter) * .25);margin-bottom:0}._wrapper_1xyh8_2[data-label-position=inside] ._inputLabel_1xyh8_9{background-color:var(--white);z-index:1;width:fit-content;top:calc(var(--w-gutter) * .25);left:calc(var(--w-gutter) * .25);pointer-events:none;padding:0 5px;transition:top .15s,left .15s,font-size .15s,color .15s;position:absolute}._wrapper_1xyh8_2[data-label-position=inside]>label>._inputField_1xyh8_56>._input_1xyh8_9,._wrapper_1xyh8_2[data-label-position=inside]>._input_1xyh8_9{transition:border-color .2s}._wrapper_1xyh8_2[data-label-position=inside]:focus-within ._inputLabel_1xyh8_9{top:-.5rem;left:calc(var(--w-gutter) * .125);font-size:calc(var(--w-text) * .75);color:var(--blue500)}._wrapper_1xyh8_2[data-label-position=inside]:focus-within ._input_1xyh8_9{border-color:var(--blue500)}._wrapper_1xyh8_2[data-label-position=inside]:focus-within ._input_1xyh8_9::placeholder{opacity:1}._wrapper_1xyh8_2[data-label-position=inside][data-has-input=true] ._inputLabel_1xyh8_9{top:-.5rem;left:calc(var(--w-gutter) * .125);font-size:calc(var(--w-text) * .75)}._wrapper_1xyh8_2[data-label-position=inside]:has(._input_1xyh8_9:not(:placeholder-shown)) ._inputLabel_1xyh8_9{top:-.5rem;left:calc(var(--w-gutter) * .125);font-size:calc(var(--w-text) * .75)}._wrapper_1xyh8_2[data-label-position=inside]:has(._input_1xyh8_9:-webkit-autofill) ._inputLabel_1xyh8_9{top:-.5rem;left:calc(var(--w-gutter) * .125);font-size:calc(var(--w-text) * .75)}._wrapper_1xyh8_2[data-label-position=inside] ._input_1xyh8_9[type=tel]{width:100%}._wrapper_1xyh8_2[data-label-position=inside] ._input_1xyh8_9::placeholder{opacity:0;transition:opacity .2s}._inputField_1xyh8_56{align-items:center;display:inline-flex;position:relative}._inputField_1xyh8_56[data-has-end-adornment=true]>._input_1xyh8_9{width:100%;padding-right:calc(var(--w-gutter) * 1.5)}._inputAdornment_1xyh8_95{right:calc(var(--w-gutter) * .5);z-index:1;align-items:center;margin-top:0;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}._error_1xyh8_106{margin-top:calc(var(--w-gutter) * .25);font-size:calc(var(--w-text) * .75);color:var(--red600)}._inputViewToggle_1xyh8_112{align-items:"center";padding:0;line-height:1;display:inline-flex}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './Input.module.css';//#region src/components/Input/Input.module.scss
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_wrapper_1xyh8_2", t = "_inputLabel_1xyh8_9", n = "_textarea_1xyh8_24", r = "_inputField_1xyh8_56", i = "_input_1xyh8_9", a = "_inputAdornment_1xyh8_95", o = "_error_1xyh8_106", s = "_inputViewToggle_1xyh8_112", c = {
|
|
3
3
|
wrapper: e,
|
|
4
4
|
inputLabel: t,
|
|
5
5
|
textarea: n,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { isEmpty as e } from "
|
|
3
|
-
import { loaders as t } from "
|
|
4
|
-
import n from "
|
|
2
|
+
import { isEmpty as e } from "../../utilities/validations.esm.js";
|
|
3
|
+
import { loaders as t } from "./types.esm.js";
|
|
4
|
+
import n from "./loaders.module.esm.js";
|
|
5
5
|
import r from "clsx";
|
|
6
6
|
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/Loader.tsx
|
|
7
|
+
//#region src/components/Loader/Loader.tsx
|
|
8
8
|
var a = (a) => {
|
|
9
9
|
let { type: o, color: s = "black", width: c, styles: l, className: u, style: d, ...f } = a, p = e(l) ? void 0 : l, m = t[o](s, c);
|
|
10
10
|
return /* @__PURE__ */ i("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './loaders.module.css';//#region src/
|
|
1
|
+
import './loaders.module.css';//#region src/components/Loader/loaders.module.scss
|
|
2
2
|
var e = "_dots_mugu5_2", t = "_l5_mugu5_1", n = "_dots-trace_mugu5_41", r = "_l1_mugu5_1", i = "_dots-orbit_mugu5_53", a = "_l22-0_mugu5_1", o = "_l22_mugu5_1", s = "_dashes_mugu5_83", c = "_spinner_mugu5_108", l = "_l2_mugu5_1", u = "_swirl_mugu5_121", d = "_l3_mugu5_1", f = "_ball_mugu5_141", p = "_l9_mugu5_1", m = "_boxy_mugu5_153", h = "_l7_mugu5_1", g = {
|
|
3
3
|
dots: e,
|
|
4
4
|
l5: t,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { isEmpty as e } from "
|
|
3
|
-
import { color as t } from "
|
|
4
|
-
import { Button as n } from "
|
|
2
|
+
import { isEmpty as e } from "../../utilities/validations.esm.js";
|
|
3
|
+
import { color as t } from "../../styles/utilities/color.esm.js";
|
|
4
|
+
import { Button as n } from "../Button.esm.js";
|
|
5
5
|
import r from "./Modal.module.esm.js";
|
|
6
6
|
import i from "clsx";
|
|
7
7
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
import c from "react";
|
|
9
9
|
import { LuX as l } from "react-icons/lu";
|
|
10
|
-
//#region src/components/Modal.tsx
|
|
10
|
+
//#region src/components/Modal/Modal.tsx
|
|
11
11
|
var u = class extends c.PureComponent {
|
|
12
12
|
state = { isClosing: !1 };
|
|
13
13
|
onDismiss = () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._wrapper_3m995_1,._background_3m995_1{width:100%;height:100%;position:fixed;inset:0}@keyframes _fadeIn_3m995_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_3m995_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_3m995_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideOut_3m995_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._wrapper_3m995_1{z-index:1000;justify-content:center;align-items:center;display:flex}._background_3m995_1{z-index:1001;background-color:#00000080;animation-fill-mode:forwards}._background_3m995_1[data-is-closing=true]{animation:.3s ease-in-out _fadeOut_3m995_1}._background_3m995_1[data-is-closing=false]{animation:.3s ease-in-out _fadeIn_3m995_1}._content_3m995_62{padding:var(--w-gutter);z-index:1002;background-color:var(--white);-webkit-overflow-scrolling:touch;touch-action:pan-y;max-height:80vh;animation-fill-mode:forwards;overflow-y:auto}._content_3m995_62[data-is-closing=true]{animation:.3s ease-in-out _slideOut_3m995_1}._content_3m995_62[data-is-closing=false]{animation:.3s ease-in-out _slideIn_3m995_1}._content_3m995_62._panel_3m995_78{height:100%;position:fixed;top:0;right:0}._content_3m995_62._dialog_3m995_84{border-radius:8px}._content_3m995_62>header{width:100%;margin-bottom:calc(var(--w-gutter) * .5);justify-content:space-between;display:inline-flex}._content_3m995_62>header>button:only-child{margin-left:auto}._actionContainer_3m995_97{margin-top:calc(var(--w-gutter) * 2);background-color:var(--white);gap:var(--w-gutter);height:fit-content;display:flex}._closeModal_3m995_105{border-radius:50%;justify-content:center;width:30px;height:30px;padding:0;text-decoration:none;display:inline-flex}@media (width>=0) and (width<=660px){._content_3m995_62._panel_3m995_78,._content_3m995_62._dialog_3m995_84{width:100%;height:100%}}@media (width>=660px){._content_3m995_62._panel_3m995_78{width:calc((var(--w-column) * 4) + (var(--w-gutter) * 3))}._content_3m995_62._dialog_3m995_84{width:calc((var(--w-column) * 6) + (var(--w-gutter) * 5))}}@media (width>=1040px){._content_3m995_62._dialog_3m995_84{width:calc((var(--w-column) * 8) + (var(--w-gutter) * 7))}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './Modal.module.css';//#region src/components/Modal/Modal.module.scss
|
|
2
|
+
var e = "_wrapper_3m995_1", t = "_background_3m995_1", n = "_fadeOut_3m995_1", r = "_fadeIn_3m995_1", i = "_content_3m995_62", a = "_slideOut_3m995_1", o = "_slideIn_3m995_1", s = "_panel_3m995_78", c = "_dialog_3m995_84", l = "_actionContainer_3m995_97", u = "_closeModal_3m995_105", d = {
|
|
3
|
+
wrapper: e,
|
|
4
|
+
background: t,
|
|
5
|
+
fadeOut: n,
|
|
6
|
+
fadeIn: r,
|
|
7
|
+
content: i,
|
|
8
|
+
slideOut: a,
|
|
9
|
+
slideIn: o,
|
|
10
|
+
panel: s,
|
|
11
|
+
dialog: c,
|
|
12
|
+
actionContainer: l,
|
|
13
|
+
closeModal: u
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { l as actionContainer, t as background, u as closeModal, i as content, d as default, c as dialog, r as fadeIn, n as fadeOut, s as panel, o as slideIn, a as slideOut, e as wrapper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer craftsman-base{h1{font-size:calc(var(--w-text) * 3.125);line-height:1.2}h2{font-size:calc(var(--w-text) * 2.625);font-weight:625;line-height:1.1}h3{font-size:calc(var(--w-text) * 1.625);line-height:1.1}h4{font-size:calc(var(--w-text) * 1.25);margin:calc(var(--w-gutter) * .5) 0;line-height:1.1}h5{font-size:var(--w-text);line-height:1.2}h6{font-size:calc(var(--w-text) * .875);font-weight:600;line-height:1.2}p{font-style:normal;font-size:var(--w-text);margin:0;line-height:1.5}small{font-size:calc(var(--w-text) * .75)}@media (width<=660px){h4{font-size:var(--w-text,14px)}p{font-size:calc(var(--w-text,14px) * .875)}}.text.display{font-size:calc(var(--w-text) * 1.625);line-height:1.1}.text.display.xlarge{font-size:calc(var(--w-text) * 3.125);line-height:1.2}.text.display.large{font-size:calc(var(--w-text) * 2.625);font-weight:625;line-height:1.1}.text.display.small{font-size:calc(var(--w-text) * 1.25);margin:calc(var(--w-gutter) * .5) 0;line-height:1.1}.text.heading{font-size:calc(var(--w-text) * 1.625);line-height:1.1}.text.heading.xlarge{font-size:calc(var(--w-text) * 3.125);line-height:1.2}.text.heading.large,.text.xlarge{font-size:calc(var(--w-text) * 2.625);font-weight:625;line-height:1.1}.text.heading.medium{font-size:calc(var(--w-text) * 1.625);line-height:1.1}.text.heading.small{font-size:calc(var(--w-text) * 1.25);margin:calc(var(--w-gutter) * .5) 0;line-height:1.1}.text.heading.xsmall{font-size:var(--w-text);line-height:1.2}.text.paragraph{font-style:normal;font-size:var(--w-text);margin:0;line-height:1.5}.text.paragraph.xlarge,.text.large{font-size:calc(var(--w-text) * 1.625);line-height:1.1}.text.paragraph.large{font-size:calc(var(--w-text) * 1.25);margin:calc(var(--w-gutter) * .5) 0;line-height:1.1}.text.paragraph.medium,.text.medium{font-style:normal;font-size:var(--w-text);margin:0;line-height:1.5}.text.paragraph.small,.text.small{font-size:calc(var(--w-text) * .75)}.text.paragraph.xsmall,.text.xsmall{font-size:calc(var(--w-text) * .5)}.text.caption{font-size:calc(var(--w-text) * .75)}.text.center{text-align:center}.text.left{text-align:left}.text.right{text-align:right}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextSize } from 'storybook/theming';
|
|
2
|
+
import { TextTags, TextType } from '../../utilities/types';
|
|
3
|
+
export type TextProps = React.HTMLAttributes<HTMLElement> & {
|
|
4
|
+
as?: TextTags;
|
|
5
|
+
richText?: boolean;
|
|
6
|
+
type?: TextType;
|
|
7
|
+
size?: TextSize;
|
|
8
|
+
alignment?: "center" | "left" | "right";
|
|
9
|
+
};
|
|
10
|
+
export declare const Text: React.FC<TextProps>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@use "../../styles/utilities/functions" as u;
|
|
2
|
+
@use "../../styles/global/components/typography" as t;
|
|
3
|
+
@layer craftsman-base {
|
|
4
|
+
.text {
|
|
5
|
+
// --- display ---
|
|
6
|
+
&.display {
|
|
7
|
+
@include t.h3;
|
|
8
|
+
}
|
|
9
|
+
&.display.xlarge {
|
|
10
|
+
@include t.h1;
|
|
11
|
+
}
|
|
12
|
+
&.display.large {
|
|
13
|
+
@include t.h2;
|
|
14
|
+
}
|
|
15
|
+
&.display.small {
|
|
16
|
+
@include t.h4;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// --- heading ---
|
|
20
|
+
&.heading {
|
|
21
|
+
@include t.h3;
|
|
22
|
+
}
|
|
23
|
+
&.heading.xlarge {
|
|
24
|
+
@include t.h1;
|
|
25
|
+
}
|
|
26
|
+
&.heading.large,
|
|
27
|
+
&.xlarge {
|
|
28
|
+
@include t.h2;
|
|
29
|
+
}
|
|
30
|
+
&.heading.medium {
|
|
31
|
+
@include t.h3;
|
|
32
|
+
}
|
|
33
|
+
&.heading.small {
|
|
34
|
+
@include t.h4;
|
|
35
|
+
}
|
|
36
|
+
&.heading.xsmall {
|
|
37
|
+
@include t.h5;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// --- paragraph ---
|
|
41
|
+
&.paragraph {
|
|
42
|
+
@include t.p;
|
|
43
|
+
}
|
|
44
|
+
&.paragraph.xlarge,
|
|
45
|
+
&.large {
|
|
46
|
+
@include t.h3;
|
|
47
|
+
}
|
|
48
|
+
&.paragraph.large {
|
|
49
|
+
@include t.h4;
|
|
50
|
+
}
|
|
51
|
+
&.paragraph.medium,
|
|
52
|
+
&.medium {
|
|
53
|
+
@include t.p;
|
|
54
|
+
}
|
|
55
|
+
&.paragraph.small,
|
|
56
|
+
&.small {
|
|
57
|
+
@include t.small;
|
|
58
|
+
}
|
|
59
|
+
&.paragraph.xsmall,
|
|
60
|
+
&.xsmall {
|
|
61
|
+
@include t.xsmall;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// --- caption ---
|
|
65
|
+
&.caption {
|
|
66
|
+
@include t.small;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// --- alignment ---
|
|
70
|
+
&.center {
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
&.left {
|
|
74
|
+
text-align: left;
|
|
75
|
+
}
|
|
76
|
+
&.right {
|
|
77
|
+
text-align: right;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './Text.css';/* empty css */
|
|
2
|
+
import e from "clsx";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import n from "dompurify";
|
|
5
|
+
//#region src/components/Text/Text.tsx
|
|
6
|
+
var r = ({ as: r = "div", children: i, type: a, size: o, className: s, alignment: c, richText: l, ...u }) => {
|
|
7
|
+
let d = e(a && a, o && o, c && c, "text", s);
|
|
8
|
+
if (l) {
|
|
9
|
+
let e = typeof i == "string" ? n.sanitize(i, { ADD_ATTR: ["target"] }) : i;
|
|
10
|
+
return /* @__PURE__ */ t("div", {
|
|
11
|
+
...u,
|
|
12
|
+
className: d,
|
|
13
|
+
dangerouslySetInnerHTML: { __html: e || "" }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ t(r, {
|
|
17
|
+
...u,
|
|
18
|
+
className: d,
|
|
19
|
+
children: i
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { r as Text };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { Button } from './Button';
|
|
2
2
|
export { Input } from './Input/Input';
|
|
3
3
|
export { InputPassword } from './Input/InputPassword';
|
|
4
|
-
export { Loader } from './Loader';
|
|
4
|
+
export { Loader } from './Loader/Loader';
|
|
5
5
|
export { RadioButton } from './Input/RadioButton';
|
|
6
6
|
export { Checkbox } from './Input/Checkbox';
|
|
7
7
|
export { Textarea } from './Input/Textarea';
|
|
8
|
-
export {
|
|
8
|
+
export { Text } from './Text/Text';
|
|
9
|
+
export { Modal } from './Modal/Modal';
|
|
@@ -1,62 +1,93 @@
|
|
|
1
1
|
@use "../../utilities/functions" as u;
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
%body-typography {
|
|
3
|
+
@mixin body-typography {
|
|
5
4
|
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
6
5
|
color: var(--text);
|
|
7
6
|
line-height: 1.5;
|
|
8
7
|
font-weight: 400;
|
|
9
8
|
font-size: var(--w-text, 14px);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin h1 {
|
|
12
|
+
font-size: #{u.width(text, 3.125)};
|
|
13
|
+
line-height: 1.2;
|
|
14
|
+
}
|
|
15
|
+
@mixin h2 {
|
|
16
|
+
font-size: #{u.width(text, 2.625)};
|
|
17
|
+
font-weight: 625;
|
|
18
|
+
line-height: 1.1;
|
|
19
|
+
}
|
|
20
|
+
@mixin h3 {
|
|
21
|
+
font-size: #{u.width(text, 1.625)};
|
|
22
|
+
line-height: 1.1;
|
|
23
|
+
}
|
|
24
|
+
@mixin h4 {
|
|
25
|
+
font-size: #{u.width(text, 1.25)};
|
|
26
|
+
line-height: 1.1;
|
|
27
|
+
margin: #{u.width(gutter, 0.5)} 0;
|
|
28
|
+
}
|
|
29
|
+
@mixin h5 {
|
|
30
|
+
font-size: var(--w-text);
|
|
31
|
+
line-height: 1.2;
|
|
32
|
+
}
|
|
33
|
+
@mixin h6 {
|
|
34
|
+
font-size: #{u.width(text, 0.875)};
|
|
35
|
+
line-height: 1.2;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
}
|
|
38
|
+
@mixin p {
|
|
39
|
+
font-style: normal;
|
|
40
|
+
font-size: var(--w-text);
|
|
41
|
+
line-height: 1.5;
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
@mixin small {
|
|
45
|
+
font-size: #{u.width(text, 0.75)};
|
|
46
|
+
}
|
|
47
|
+
@mixin xsmall {
|
|
48
|
+
font-size: #{u.width(text, 0.5)};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@layer craftsman-base {
|
|
52
|
+
// TODO: These h* declarations need to be moved somewhere not-terrible
|
|
53
|
+
h1 {
|
|
54
|
+
@include h1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
h2 {
|
|
58
|
+
@include h2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
h3 {
|
|
62
|
+
@include h3;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
h4 {
|
|
66
|
+
@include h4;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
h5 {
|
|
70
|
+
@include h5;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
h6 {
|
|
74
|
+
@include h6;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
p {
|
|
78
|
+
@include p;
|
|
79
|
+
}
|
|
80
|
+
small {
|
|
81
|
+
@include small;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include u.breakpoint(mobileMax) {
|
|
85
|
+
h4 {
|
|
86
|
+
font-size: var(--w-text, 14px);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
p {
|
|
90
|
+
font-size: calc(var(--w-text, 14px) * 0.875);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
62
93
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../config";
|
|
2
|
-
@use "./components/typography";
|
|
2
|
+
@use "./components/typography" as t;
|
|
3
3
|
@use "./components/code";
|
|
4
4
|
@use "./components/checkbox";
|
|
5
5
|
@use "./components/radioButton";
|
|
@@ -9,74 +9,74 @@
|
|
|
9
9
|
@layer craftsman-base, craftsman-theme;
|
|
10
10
|
|
|
11
11
|
@layer craftsman-base {
|
|
12
|
-
:root {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
12
|
+
:root {
|
|
13
|
+
color-scheme: light dark;
|
|
14
|
+
font-synthesis: none;
|
|
15
|
+
text-rendering: optimizeLegibility;
|
|
16
|
+
-webkit-font-smoothing: antialiased;
|
|
17
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
::-webkit-scrollbar {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
20
|
+
::-webkit-scrollbar {
|
|
21
|
+
width: 4px;
|
|
22
|
+
height: 4px;
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
::-webkit-scrollbar-track {
|
|
26
|
-
|
|
27
|
-
}
|
|
25
|
+
::-webkit-scrollbar-track {
|
|
26
|
+
background: #ddd;
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
::-webkit-scrollbar-thumb {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
29
|
+
::-webkit-scrollbar-thumb {
|
|
30
|
+
background: #000;
|
|
31
|
+
border-radius: 6px;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
|
-
::-webkit-scrollbar-thumb:hover {
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
body,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
::-webkit-scrollbar-thumb:hover {
|
|
35
|
+
background: #555;
|
|
36
|
+
}
|
|
37
|
+
body,
|
|
38
|
+
ul {
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
}
|
|
41
42
|
|
|
42
|
-
body {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
43
|
+
body {
|
|
44
|
+
@include t.body-typography;
|
|
45
|
+
background-color: #fff;
|
|
46
|
+
-webkit-overflow-scrolling: touch;
|
|
47
|
+
overscroll-behavior: contain;
|
|
48
|
+
}
|
|
48
49
|
|
|
49
|
-
fieldset {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
50
|
+
fieldset {
|
|
51
|
+
padding: 0;
|
|
52
|
+
border: 0;
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
code {
|
|
55
|
-
|
|
56
|
-
}
|
|
55
|
+
code {
|
|
56
|
+
@extend %code;
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
button {
|
|
59
|
-
|
|
60
|
-
}
|
|
59
|
+
button {
|
|
60
|
+
@extend %button-styles;
|
|
61
|
+
}
|
|
61
62
|
|
|
62
|
-
input {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
input {
|
|
64
|
+
&:not([type="radio"]):not([type="checkbox"]) {
|
|
65
|
+
@extend %input-base;
|
|
66
|
+
}
|
|
67
|
+
&[type="checkbox"] {
|
|
68
|
+
@extend %checkbox;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&[type="radio"] {
|
|
72
|
+
@extend %radio;
|
|
73
|
+
}
|
|
65
74
|
}
|
|
66
|
-
|
|
67
|
-
@extend %
|
|
75
|
+
textarea {
|
|
76
|
+
@extend %input-base;
|
|
68
77
|
}
|
|
69
78
|
|
|
70
|
-
|
|
71
|
-
@extend %
|
|
79
|
+
a {
|
|
80
|
+
@extend %text-link;
|
|
72
81
|
}
|
|
73
82
|
}
|
|
74
|
-
textarea {
|
|
75
|
-
@extend %input-base;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
a {
|
|
79
|
-
@extend %text-link;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
}
|
|
@@ -26,9 +26,9 @@ $width-defaults: (
|
|
|
26
26
|
@if not map.has-key($width-defaults, $name) {
|
|
27
27
|
@error "Unknown width key `#{$name}`.";
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@return string.unquote("var(--w-#{$name}, #{$fallback}px)");
|
|
29
|
+
@return string.unquote("var(--w-#{$name})");
|
|
30
|
+
// $fallback: map.get($width-defaults, $name);
|
|
31
|
+
// @return string.unquote("var(--w-#{$name}, #{$fallback}px)");
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
@function width($name, $multiplier: 1, $px: true) {
|
package/src/utilities/types.d.ts
CHANGED
|
@@ -89,3 +89,30 @@ export declare const ButtonType: z.ZodEnum<{
|
|
|
89
89
|
default: "default";
|
|
90
90
|
}>;
|
|
91
91
|
export type ButtonType = z.infer<typeof ButtonType>;
|
|
92
|
+
export declare const TextTags: z.ZodEnum<{
|
|
93
|
+
h1: "h1";
|
|
94
|
+
h2: "h2";
|
|
95
|
+
h3: "h3";
|
|
96
|
+
h4: "h4";
|
|
97
|
+
h5: "h5";
|
|
98
|
+
p: "p";
|
|
99
|
+
span: "span";
|
|
100
|
+
div: "div";
|
|
101
|
+
}>;
|
|
102
|
+
export type TextTags = z.infer<typeof TextTags>;
|
|
103
|
+
export declare const TextType: z.ZodEnum<{
|
|
104
|
+
display: "display";
|
|
105
|
+
heading: "heading";
|
|
106
|
+
paragraph: "paragraph";
|
|
107
|
+
caption: "caption";
|
|
108
|
+
"small-title": "small-title";
|
|
109
|
+
}>;
|
|
110
|
+
export type TextType = z.infer<typeof TextType>;
|
|
111
|
+
export declare const TextSize: z.ZodEnum<{
|
|
112
|
+
xlarge: "xlarge";
|
|
113
|
+
large: "large";
|
|
114
|
+
medium: "medium";
|
|
115
|
+
small: "small";
|
|
116
|
+
xsmall: "xsmall";
|
|
117
|
+
}>;
|
|
118
|
+
export type TextSize = z.infer<typeof TextSize>;
|
|
@@ -53,6 +53,27 @@ var t = e.enum(["gutter", "column"]), n = e.enum([
|
|
|
53
53
|
"primary",
|
|
54
54
|
"default",
|
|
55
55
|
"text"
|
|
56
|
+
]), d = e.enum([
|
|
57
|
+
"h1",
|
|
58
|
+
"h2",
|
|
59
|
+
"h3",
|
|
60
|
+
"h4",
|
|
61
|
+
"h5",
|
|
62
|
+
"p",
|
|
63
|
+
"span",
|
|
64
|
+
"div"
|
|
65
|
+
]), f = e.enum([
|
|
66
|
+
"display",
|
|
67
|
+
"heading",
|
|
68
|
+
"paragraph",
|
|
69
|
+
"caption",
|
|
70
|
+
"small-title"
|
|
71
|
+
]), p = e.enum([
|
|
72
|
+
"xlarge",
|
|
73
|
+
"large",
|
|
74
|
+
"medium",
|
|
75
|
+
"small",
|
|
76
|
+
"xsmall"
|
|
56
77
|
]);
|
|
57
78
|
//#endregion
|
|
58
|
-
export { t as BaseWidthSchema, i as BreakpointSchema, u as ButtonType, a as LayoutWidthsSchema, r as MaxScreenWidthSchema, n as ScreenWidthSchema, l as zLabelPosition, o as zTextInputExclusions, c as zTextInputType, s as zTextInputTypes };
|
|
79
|
+
export { t as BaseWidthSchema, i as BreakpointSchema, u as ButtonType, a as LayoutWidthsSchema, r as MaxScreenWidthSchema, n as ScreenWidthSchema, p as TextSize, d as TextTags, f as TextType, l as zLabelPosition, o as zTextInputExclusions, c as zTextInputType, s as zTextInputTypes };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._wrapper_1fsgx_1,._background_1fsgx_1{width:100%;height:100%;position:fixed;inset:0}@keyframes _fadeIn_1fsgx_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_1fsgx_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_1fsgx_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideOut_1fsgx_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._wrapper_1fsgx_1{z-index:1000;justify-content:center;align-items:center;display:flex}._background_1fsgx_1{z-index:1001;background-color:#00000080;animation-fill-mode:forwards}._background_1fsgx_1[data-is-closing=true]{animation:.3s ease-in-out _fadeOut_1fsgx_1}._background_1fsgx_1[data-is-closing=false]{animation:.3s ease-in-out _fadeIn_1fsgx_1}._content_1fsgx_62{padding:var(--w-gutter,16px);z-index:1002;background-color:var(--white);-webkit-overflow-scrolling:touch;touch-action:pan-y;max-height:80vh;animation-fill-mode:forwards;overflow-y:auto}._content_1fsgx_62[data-is-closing=true]{animation:.3s ease-in-out _slideOut_1fsgx_1}._content_1fsgx_62[data-is-closing=false]{animation:.3s ease-in-out _slideIn_1fsgx_1}._content_1fsgx_62._panel_1fsgx_78{height:100%;position:fixed;top:0;right:0}._content_1fsgx_62._dialog_1fsgx_84{border-radius:8px}._content_1fsgx_62>header{width:100%;margin-bottom:calc(var(--w-gutter,16px) * .5);justify-content:space-between;display:inline-flex}._content_1fsgx_62>header>button:only-child{margin-left:auto}._actionContainer_1fsgx_97{margin-top:calc(var(--w-gutter,16px) * 2);background-color:var(--white);gap:var(--w-gutter,16px);height:fit-content;display:flex}._closeModal_1fsgx_105{border-radius:50%;justify-content:center;width:30px;height:30px;padding:0;text-decoration:none;display:inline-flex}@media (width>=0) and (width<=660px){._content_1fsgx_62._panel_1fsgx_78,._content_1fsgx_62._dialog_1fsgx_84{width:100%;height:100%}}@media (width>=660px){._content_1fsgx_62._panel_1fsgx_78{width:calc((var(--w-column,60px) * 4) + (var(--w-gutter,16px) * 3))}._content_1fsgx_62._dialog_1fsgx_84{width:calc((var(--w-column,60px) * 6) + (var(--w-gutter,16px) * 5))}}@media (width>=1040px){._content_1fsgx_62._dialog_1fsgx_84{width:calc((var(--w-column,60px) * 8) + (var(--w-gutter,16px) * 7))}}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import './Modal.module.css';//#region src/components/Modal.module.scss
|
|
2
|
-
var e = "_wrapper_1fsgx_1", t = "_background_1fsgx_1", n = "_fadeOut_1fsgx_1", r = "_fadeIn_1fsgx_1", i = "_content_1fsgx_62", a = "_slideOut_1fsgx_1", o = "_slideIn_1fsgx_1", s = "_panel_1fsgx_78", c = "_dialog_1fsgx_84", l = "_actionContainer_1fsgx_97", u = "_closeModal_1fsgx_105", d = {
|
|
3
|
-
wrapper: e,
|
|
4
|
-
background: t,
|
|
5
|
-
fadeOut: n,
|
|
6
|
-
fadeIn: r,
|
|
7
|
-
content: i,
|
|
8
|
-
slideOut: a,
|
|
9
|
-
slideIn: o,
|
|
10
|
-
panel: s,
|
|
11
|
-
dialog: c,
|
|
12
|
-
actionContainer: l,
|
|
13
|
-
closeModal: u
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { l as actionContainer, t as background, u as closeModal, i as content, d as default, c as dialog, r as fadeIn, n as fadeOut, s as panel, o as slideIn, a as slideOut, e as wrapper };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|