@stamcat/craftsman 0.0.23-alpha.8 → 0.0.23

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.
Files changed (99) hide show
  1. package/AGENTS.md +372 -0
  2. package/Components.d.ts +2 -0
  3. package/Components.esm.js +20 -3
  4. package/Styles.d.ts +2 -0
  5. package/Styles.esm.js +8 -0
  6. package/Utilities.d.ts +2 -0
  7. package/Utilities.esm.js +2 -0
  8. package/_virtual/_rolldown/runtime.esm.js +11 -0
  9. package/package.json +49 -11
  10. package/src/components/Button.d.ts +7 -0
  11. package/src/components/Button.esm.js +27 -0
  12. package/src/components/Button.module.css +1 -0
  13. package/src/components/Button.module.esm.js +9 -0
  14. package/src/components/Button.module.scss +5 -0
  15. package/src/components/Checkbox.d.ts +7 -0
  16. package/src/components/Checkbox.esm.js +10 -0
  17. package/src/components/Input.d.ts +11 -0
  18. package/src/components/Input.esm.js +40 -0
  19. package/src/components/Input.module.css +1 -0
  20. package/src/components/Input.module.esm.js +11 -0
  21. package/src/components/Input.module.scss +141 -0
  22. package/src/components/InputPassword.d.ts +6 -0
  23. package/src/components/InputPassword.esm.js +32 -0
  24. package/src/components/Loader.d.ts +8 -0
  25. package/src/components/Loader.esm.js +20 -0
  26. package/src/components/Modal.d.ts +22 -0
  27. package/src/components/Modal.esm.js +61 -0
  28. package/src/components/Modal.module.css +1 -0
  29. package/src/components/Modal.module.esm.js +13 -0
  30. package/src/components/Modal.module.scss +133 -0
  31. package/src/components/RadioButton.d.ts +7 -0
  32. package/src/components/RadioButton.esm.js +10 -0
  33. package/src/components/index.d.ts +7 -0
  34. package/src/main.d.ts +1 -0
  35. package/src/styles/components/ThemeProvider.d.ts +7 -0
  36. package/src/styles/components/ThemeProvider.esm.js +8 -0
  37. package/src/styles/global/components/_button.scss +64 -0
  38. package/src/styles/global/components/_checkbox.scss +78 -0
  39. package/src/styles/global/components/_code.scss +19 -0
  40. package/src/styles/global/components/_input.scss +46 -0
  41. package/src/styles/global/components/_mixins.scss +2 -0
  42. package/src/styles/global/components/_modal.scss +9 -0
  43. package/src/styles/global/components/_radioButton.scss +33 -0
  44. package/src/styles/global/components/_typography.scss +7 -0
  45. package/src/styles/global/components/button.d.ts +7 -0
  46. package/src/styles/global/components/loaders.d.ts +15 -0
  47. package/src/styles/global/components/loaders.esm.js +54 -0
  48. package/src/styles/global/components/loaders.module.css +1 -0
  49. package/src/styles/global/components/loaders.module.esm.js +21 -0
  50. package/src/styles/global/components/loaders.module.scss +246 -0
  51. package/src/styles/global/globalStyles.d.ts +1 -0
  52. package/src/styles/global/globalStyles.esm.js +4 -0
  53. package/src/styles/global/globalStyles.module.scss +129 -0
  54. package/src/styles/global/variables.d.ts +2 -0
  55. package/src/styles/global/variables.esm.js +11 -0
  56. package/src/styles/index.d.ts +7 -0
  57. package/{styles → src/styles}/theme/components.d.ts +1 -1
  58. package/src/styles/theme/components.esm.js +12 -0
  59. package/src/styles/theme/constants.d.ts +1 -0
  60. package/src/styles/theme/constants.esm.js +4 -0
  61. package/src/styles/theme/theme.d.ts +2 -0
  62. package/src/styles/theme/theme.esm.js +56 -0
  63. package/{styles → src/styles}/theme/types.d.ts +10 -3
  64. package/src/styles/theme/utilities.d.ts +3 -0
  65. package/src/styles/theme/utilities.esm.js +48 -0
  66. package/src/styles/utilities/color.d.ts +174 -0
  67. package/src/styles/utilities/color.esm.js +15 -0
  68. package/src/styles/utilities/constants.d.ts +172 -0
  69. package/src/styles/utilities/constants.esm.js +183 -0
  70. package/src/styles/utilities/layout.d.ts +17 -0
  71. package/src/styles/utilities/layout.esm.js +47 -0
  72. package/src/styles/utilities/types.d.ts +85 -0
  73. package/src/styles/utilities/types.esm.js +54 -0
  74. package/src/utilities/index.d.ts +1 -0
  75. package/src/utilities/validations.esm.js +9 -0
  76. package/Button.esm.js +0 -5
  77. package/Input.esm.js +0 -5
  78. package/components/Button.d.ts +0 -2
  79. package/components/Input.d.ts +0 -2
  80. package/components/index.d.ts +0 -2
  81. package/icons/IconCalendar.d.ts +0 -3
  82. package/icons/IconChevronRight.d.ts +0 -2
  83. package/icons/IconCircleAlert.d.ts +0 -2
  84. package/icons/IconCircleCheck.d.ts +0 -2
  85. package/icons/IconCircleHelp.d.ts +0 -2
  86. package/icons/IconCircleInfo.d.ts +0 -2
  87. package/icons/IconEye.d.ts +0 -2
  88. package/icons/IconEyeClosed.d.ts +0 -2
  89. package/icons/IconX.d.ts +0 -2
  90. package/stories/Button.stories.d.ts +0 -8
  91. package/styles/global/colors.d.ts +0 -1
  92. package/styles/global/components/button.d.ts +0 -1
  93. package/styles/global/globalStyles.d.ts +0 -1
  94. package/styles/theme/components/button.d.ts +0 -1
  95. package/styles/theme/constants.d.ts +0 -2
  96. package/styles/theme/theme.d.ts +0 -8
  97. package/styles/utilities/color.d.ts +0 -69
  98. /package/{main.d.ts → src/components/Progress.d.ts} +0 -0
  99. /package/{utilities → src/utilities}/validations.d.ts +0 -0
@@ -0,0 +1,11 @@
1
+ import './Input.module.css';//#region src/components/Input.module.scss
2
+ var e = "_wrapper_h3ihm_1", t = "_inputLabel_h3ihm_8", n = "_input_h3ihm_8", r = "_inputField_h3ihm_58", i = "_inputAdornment_h3ihm_89", a = "_error_h3ihm_100", o = {
3
+ wrapper: e,
4
+ inputLabel: t,
5
+ input: n,
6
+ inputField: r,
7
+ inputAdornment: i,
8
+ error: a
9
+ };
10
+ //#endregion
11
+ export { o as default, a as error, n as input, i as inputAdornment, r as inputField, t as inputLabel, e as wrapper };
@@ -0,0 +1,141 @@
1
+ @use "../styles/global/components/input";
2
+
3
+ .wrapper {
4
+ label {
5
+ .inputLabel {
6
+ margin-bottom: calc(var(--w-gutter, 16px) * 0.25);
7
+ }
8
+ }
9
+
10
+ &[data-required="true"] {
11
+ label {
12
+ .inputLabel {
13
+ &::after {
14
+ content: "*";
15
+ color: var(--red700);
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ &[data-label-position="left"] {
22
+ label {
23
+ display: inline-flex;
24
+ align-items: center;
25
+
26
+ .inputLabel {
27
+ width: fit-content;
28
+ margin-right: calc(var(--w-gutter, 16px) * 0.75);
29
+ }
30
+ }
31
+ }
32
+
33
+ &[data-label-position="bottom"] {
34
+ label {
35
+ display: inline-flex;
36
+ flex-direction: column-reverse;
37
+ align-items: flex-start;
38
+
39
+ .inputLabel {
40
+ margin-bottom: 0;
41
+ margin-top: calc(var(--w-gutter, 16px) * 0.25);
42
+ }
43
+ }
44
+ }
45
+
46
+ &[data-label-position="right"] {
47
+ label {
48
+ display: inline-flex;
49
+ flex-direction: row-reverse;
50
+ align-items: baseline;
51
+
52
+ .inputLabel {
53
+ margin-left: calc(var(--w-gutter, 16px) * 0.25);
54
+ margin-bottom: 0;
55
+ }
56
+ }
57
+ }
58
+
59
+ &[data-label-position="inside"] {
60
+ @extend %inside-input-label-base;
61
+
62
+ .inputLabel {
63
+ position: absolute;
64
+ background-color: var(--white);
65
+ z-index: 1;
66
+ width: fit-content;
67
+ padding: 0 5px;
68
+ top: calc(var(--w-gutter, 16px) * 0.25);
69
+ left: calc(var(--w-gutter, 16px) * 0.25);
70
+ pointer-events: none;
71
+ transition: top 150ms ease, left 150ms ease, font-size 150ms ease, color 150ms ease;
72
+ }
73
+
74
+ > label > .inputField > .input,
75
+ > .input {
76
+ transition: border-color 200ms ease;
77
+ }
78
+
79
+ &:focus-within {
80
+ .inputLabel {
81
+ @extend %inside-input-label-floating;
82
+ color: var(--blue500);
83
+ }
84
+
85
+ .input {
86
+ border-color: var(--blue500);
87
+ }
88
+
89
+ .input::placeholder {
90
+ opacity: 1;
91
+ }
92
+ }
93
+
94
+ &:has(.input:not(:placeholder-shown)),
95
+ &:has(.input:-webkit-autofill),
96
+ &[data-has-input="true"] {
97
+ .inputLabel {
98
+ @extend %inside-input-label-floating;
99
+ }
100
+ }
101
+
102
+ .input[type="tel"] {
103
+ width: 100%;
104
+ }
105
+
106
+ .input::placeholder {
107
+ opacity: 0;
108
+ transition: opacity 200ms ease;
109
+ }
110
+ }
111
+ }
112
+
113
+ .inputField {
114
+ position: relative;
115
+ display: inline-flex;
116
+ align-items: center;
117
+
118
+ &[data-has-end-adornment="true"] {
119
+ > .input {
120
+ width: 100%;
121
+ padding-right: calc(calc(var(--w-gutter, 16px) * 0.5) + 24px + calc(var(--w-gutter, 16px) * 0.5));
122
+ }
123
+ }
124
+ }
125
+
126
+ .inputAdornment {
127
+ position: absolute;
128
+ right: calc(var(--w-gutter, 16px) * 0.5);
129
+ top: 50%;
130
+ transform: translateY(-50%);
131
+ margin-top: 0;
132
+ z-index: 1;
133
+ display: inline-flex;
134
+ align-items: center;
135
+ }
136
+
137
+ .error {
138
+ margin-top: calc(var(--w-gutter, 16px) * 0.25);
139
+ font-size: calc(var(--w-text, 14px) * 0.75);
140
+ color: var(--red600);
141
+ }
@@ -0,0 +1,6 @@
1
+ import { TextInputType } from '../styles/utilities/types';
2
+ import { InputProps } from './Input';
3
+ export type InputPasswordProps = React.ComponentProps<"input"> & {} & Omit<InputProps, "type" | "endAdornment"> & {
4
+ type?: Extract<TextInputType, "password">;
5
+ };
6
+ export declare const InputPassword: React.FC<InputPasswordProps>;
@@ -0,0 +1,32 @@
1
+ import { Button as e } from "./Button.esm.js";
2
+ import { Input as t } from "./Input.esm.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { useState as r } from "react";
5
+ import { ImEye as i, ImEyeBlocked as a } from "react-icons/im";
6
+ //#region src/components/InputPassword.tsx
7
+ var o = {
8
+ padding: 0,
9
+ display: "inline-flex",
10
+ alignItems: "center",
11
+ lineHeight: 1
12
+ }, s = ({ visible: t, onToggle: r }) => /* @__PURE__ */ n(e, {
13
+ type: "button",
14
+ variant: "text",
15
+ onClick: r,
16
+ "aria-label": t ? "Hide password" : "Show password",
17
+ "aria-pressed": t,
18
+ styles: o,
19
+ children: n(t ? i : a, { size: 16 })
20
+ }), c = ({ type: e = "password", ...i }) => {
21
+ let [a, o] = r(!1), c = a ? "text" : e;
22
+ return /* @__PURE__ */ n(t, {
23
+ ...i,
24
+ type: c,
25
+ endAdornment: /* @__PURE__ */ n(s, {
26
+ visible: a,
27
+ onToggle: () => o((e) => !e)
28
+ })
29
+ });
30
+ };
31
+ //#endregion
32
+ export { c as InputPassword };
@@ -0,0 +1,8 @@
1
+ import { LoaderStyle } from '../styles/global/components/loaders';
2
+ export type LoaderProps = React.ComponentProps<"div"> & {
3
+ type: LoaderStyle;
4
+ color?: string;
5
+ width?: number;
6
+ styles?: React.CSSProperties;
7
+ };
8
+ export declare const Loader: React.FC<LoaderProps>;
@@ -0,0 +1,20 @@
1
+ import { clsx as e } from "../../node_modules/clsx/dist/clsx.esm.js";
2
+ import { isEmpty as t } from "../utilities/validations.esm.js";
3
+ import { loaders as n } from "../styles/global/components/loaders.esm.js";
4
+ import r from "../styles/global/components/loaders.module.esm.js";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/components/Loader.tsx
7
+ var a = (a) => {
8
+ let { type: o, color: s = "black", width: c, styles: l, className: u, style: d, ...f } = a, p = t(l) ? void 0 : l, m = n[o](s, c);
9
+ return /* @__PURE__ */ i("div", {
10
+ className: e(r[o], u),
11
+ style: {
12
+ ...m,
13
+ ...p,
14
+ ...d
15
+ },
16
+ ...f
17
+ });
18
+ };
19
+ //#endregion
20
+ export { a as Loader };
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ export type ModalType = "dialog" | "panel";
3
+ export interface ModalProps extends React.ComponentPropsWithoutRef<"div"> {
4
+ visible?: boolean;
5
+ onDismiss?: () => void;
6
+ type?: ModalType;
7
+ header?: string | React.ReactNode;
8
+ backgroundDismiss?: boolean;
9
+ hideDismissIcon?: boolean;
10
+ footer?: React.ReactNode;
11
+ styles?: React.CSSProperties;
12
+ }
13
+ type ModalState = {
14
+ isClosing: boolean;
15
+ };
16
+ export declare class Modal extends React.PureComponent<ModalProps, ModalState> {
17
+ readonly state: ModalState;
18
+ onDismiss: () => void;
19
+ onClickBackground: () => void;
20
+ render(): React.JSX.Element;
21
+ }
22
+ export {};
@@ -0,0 +1,61 @@
1
+ import { isEmpty as e } from "../utilities/validations.esm.js";
2
+ import { color as t } from "../styles/utilities/color.esm.js";
3
+ import { Button as n } from "./Button.esm.js";
4
+ import r from "./Modal.module.esm.js";
5
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import s from "react";
7
+ import { LuX as c } from "react-icons/lu";
8
+ //#region src/components/Modal.tsx
9
+ var l = {
10
+ textDecoration: "none",
11
+ height: 30,
12
+ width: 30,
13
+ borderRadius: "50%",
14
+ padding: 0,
15
+ display: "inline-flex",
16
+ justifyContent: "center"
17
+ }, u = class extends s.PureComponent {
18
+ state = { isClosing: !1 };
19
+ onDismiss = () => {
20
+ this.props.onDismiss && (this.setState({ isClosing: !0 }), setTimeout(() => {
21
+ this.props.onDismiss && this.props.onDismiss(), this.setState({ isClosing: !1 });
22
+ }, 280));
23
+ };
24
+ onClickBackground = () => {
25
+ (this.props.backgroundDismiss || !0) === !0 && this.onDismiss();
26
+ };
27
+ render() {
28
+ let s = e(this.props.styles) ? void 0 : this.props.styles;
29
+ return this.props.visible ? /* @__PURE__ */ o("div", {
30
+ className: r.wrapper,
31
+ style: s,
32
+ children: [/* @__PURE__ */ o("div", {
33
+ className: r.content,
34
+ "data-type": this.props.type || "dialog",
35
+ "data-is-closing": this.state.isClosing,
36
+ children: [
37
+ /* @__PURE__ */ o("header", { children: [this.props.header && /* @__PURE__ */ a(i, { children: this.props.header }), !this.props.hideDismissIcon && /* @__PURE__ */ a(n, {
38
+ variant: "primary",
39
+ styles: l,
40
+ onClick: this.onDismiss,
41
+ children: /* @__PURE__ */ a(c, {
42
+ fill: t("white"),
43
+ size: 18
44
+ })
45
+ })] }),
46
+ /* @__PURE__ */ a("section", { children: this.props.children }),
47
+ this.props.footer && /* @__PURE__ */ a("footer", {
48
+ className: r.actionContainer,
49
+ children: this.props.footer
50
+ })
51
+ ]
52
+ }), /* @__PURE__ */ a("div", {
53
+ className: r.background,
54
+ "data-is-closing": this.state.isClosing,
55
+ onClick: this.onClickBackground
56
+ })]
57
+ }) : /* @__PURE__ */ a(i, {});
58
+ }
59
+ };
60
+ //#endregion
61
+ export { u as Modal };
@@ -0,0 +1 @@
1
+ ._wrapper_16mh3_1,._background_16mh3_1{width:100%;height:100%;position:fixed;inset:0}@keyframes _fadeIn_16mh3_1{0%{opacity:0}to{opacity:1}}@keyframes _fadeOut_16mh3_1{0%{opacity:1}to{opacity:0}}@keyframes _slideIn_16mh3_1{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes _slideOut_16mh3_1{0%{transform:translateY(0)}to{transform:translateY(100%)}}._wrapper_16mh3_1{z-index:1000;justify-content:center;align-items:center;display:flex}._background_16mh3_1{z-index:1001;background-color:#00000080;animation-fill-mode:forwards}._background_16mh3_1[data-is-closing=true]{animation:.3s ease-in-out _fadeOut_16mh3_1}._background_16mh3_1[data-is-closing=false]{animation:.3s ease-in-out _fadeIn_16mh3_1}._content_16mh3_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_16mh3_62[data-is-closing=true]{animation:.3s ease-in-out _slideOut_16mh3_1}._content_16mh3_62[data-is-closing=false]{animation:.3s ease-in-out _slideIn_16mh3_1}._content_16mh3_62[data-type=panel]{height:100%;position:fixed;top:0;right:0}._content_16mh3_62[data-type=dialog]{border-radius:8px}._content_16mh3_62>header{width:100%;margin-bottom:calc(var(--w-gutter,16px) * .5);justify-content:space-between;display:inline-flex}._actionContainer_16mh3_94{margin-top:calc(var(--w-gutter,16px) * 2);background-color:var(--white);gap:var(--w-gutter,16px);height:fit-content;display:flex}@media (width>=0) and (width<=660px){._content_16mh3_62[data-type=panel],._content_16mh3_62[data-type=dialog]{width:100%;height:100%}}@media (width>=660px){._content_16mh3_62[data-type=panel]{width:calc(var(--w-column,60px) * 4 + var(--w-gutter,16px) * 3)}._content_16mh3_62[data-type=dialog]{width:calc(var(--w-column,60px) * 6 + var(--w-gutter,16px) * 5)}}@media (width>=1040px){._content_16mh3_62[data-type=dialog]{width:calc(var(--w-column,60px) * 8 + var(--w-gutter,16px) * 7)}}
@@ -0,0 +1,13 @@
1
+ import './Modal.module.css';//#region src/components/Modal.module.scss
2
+ var e = "_wrapper_16mh3_1", t = "_background_16mh3_1", n = "_fadeOut_16mh3_1", r = "_fadeIn_16mh3_1", i = "_content_16mh3_62", a = "_slideOut_16mh3_1", o = "_slideIn_16mh3_1", s = "_actionContainer_16mh3_94", c = {
3
+ wrapper: e,
4
+ background: t,
5
+ fadeOut: n,
6
+ fadeIn: r,
7
+ content: i,
8
+ slideOut: a,
9
+ slideIn: o,
10
+ actionContainer: s
11
+ };
12
+ //#endregion
13
+ export { s as actionContainer, t as background, i as content, c as default, r as fadeIn, n as fadeOut, o as slideIn, a as slideOut, e as wrapper };
@@ -0,0 +1,133 @@
1
+ @use "../styles/global/components/modal";
2
+
3
+ @keyframes fadeIn {
4
+ from {
5
+ opacity: 0;
6
+ }
7
+
8
+ to {
9
+ opacity: 1;
10
+ }
11
+ }
12
+
13
+ @keyframes fadeOut {
14
+ from {
15
+ opacity: 1;
16
+ }
17
+
18
+ to {
19
+ opacity: 0;
20
+ }
21
+ }
22
+
23
+ @keyframes slideIn {
24
+ from {
25
+ transform: translateY(100%);
26
+ }
27
+
28
+ to {
29
+ transform: translateY(0);
30
+ }
31
+ }
32
+
33
+ @keyframes slideOut {
34
+ from {
35
+ transform: translateY(0);
36
+ }
37
+
38
+ to {
39
+ transform: translateY(100%);
40
+ }
41
+ }
42
+
43
+ .wrapper {
44
+ @extend %modal-overlay;
45
+ z-index: 1000;
46
+ display: flex;
47
+ justify-content: center;
48
+ align-items: center;
49
+ }
50
+
51
+ .background {
52
+ @extend %modal-overlay;
53
+ z-index: 1001;
54
+ background-color: rgba(0, 0, 0, 0.5);
55
+ animation-fill-mode: forwards;
56
+
57
+ &[data-is-closing="true"] {
58
+ animation: fadeOut 0.3s ease-in-out;
59
+ }
60
+
61
+ &[data-is-closing="false"] {
62
+ animation: fadeIn 0.3s ease-in-out;
63
+ }
64
+ }
65
+
66
+ .content {
67
+ padding: var(--w-gutter, 16px);
68
+ z-index: 1002;
69
+ background-color: var(--white);
70
+ max-height: 80vh;
71
+ overflow-y: auto;
72
+ -webkit-overflow-scrolling: touch;
73
+ touch-action: pan-y;
74
+ animation-fill-mode: forwards;
75
+
76
+ &[data-is-closing="true"] {
77
+ animation: slideOut 0.3s ease-in-out;
78
+ }
79
+
80
+ &[data-is-closing="false"] {
81
+ animation: slideIn 0.3s ease-in-out;
82
+ }
83
+
84
+ &[data-type="panel"] {
85
+ position: fixed;
86
+ top: 0;
87
+ right: 0;
88
+ height: 100%;
89
+ }
90
+
91
+ &[data-type="dialog"] {
92
+ border-radius: 8px;
93
+ }
94
+
95
+ > header {
96
+ display: inline-flex;
97
+ width: 100%;
98
+ justify-content: space-between;
99
+ margin-bottom: calc(var(--w-gutter, 16px) * 0.5);
100
+ }
101
+ }
102
+
103
+ .actionContainer {
104
+ margin-top: calc(var(--w-gutter, 16px) * 2);
105
+ background-color: var(--white);
106
+ height: fit-content;
107
+ display: flex;
108
+ gap: var(--w-gutter, 16px);
109
+ }
110
+
111
+ @media (min-width: 0px) and (max-width: 659.99999px) {
112
+ .content[data-type="panel"],
113
+ .content[data-type="dialog"] {
114
+ width: 100%;
115
+ height: 100%;
116
+ }
117
+ }
118
+
119
+ @media (min-width: 660px) {
120
+ .content[data-type="panel"] {
121
+ width: calc((var(--w-column, 60px) * 4) + (var(--w-gutter, 16px) * 3));
122
+ }
123
+
124
+ .content[data-type="dialog"] {
125
+ width: calc((var(--w-column, 60px) * 6) + (var(--w-gutter, 16px) * 5));
126
+ }
127
+ }
128
+
129
+ @media (min-width: 1040px) {
130
+ .content[data-type="dialog"] {
131
+ width: calc((var(--w-column, 60px) * 8) + (var(--w-gutter, 16px) * 7));
132
+ }
133
+ }
@@ -0,0 +1,7 @@
1
+ import { InputProps } from './Input';
2
+ type RadioButtonProps = InputProps & {
3
+ type?: "radio";
4
+ labelPosition?: "left" | "right";
5
+ };
6
+ export declare const RadioButton: React.FC<RadioButtonProps>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Input as e } from "./Input.esm.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ //#region src/components/RadioButton.tsx
4
+ var n = ({ type: n = "radio", labelPosition: r = "right", ...i }) => /* @__PURE__ */ t(e, {
5
+ type: n,
6
+ labelPosition: r,
7
+ ...i
8
+ });
9
+ //#endregion
10
+ export { n as RadioButton };
@@ -0,0 +1,7 @@
1
+ export { Button } from './Button';
2
+ export { Input } from './Input';
3
+ export { InputPassword } from './InputPassword';
4
+ export { Loader } from './Loader';
5
+ export { RadioButton } from './RadioButton';
6
+ export { Checkbox } from './Checkbox';
7
+ export { Modal } from './Modal';
package/src/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Theme } from '../theme/types';
2
+ type ThemeProviderProps = {
3
+ theme?: Theme;
4
+ children?: React.ReactNode;
5
+ };
6
+ export declare function ThemeProvider({ theme, children }: ThemeProviderProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { themeBuilder as e } from "../theme/theme.esm.js";
2
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ //#region src/styles/components/ThemeProvider.tsx
4
+ function i({ theme: i, children: a }) {
5
+ return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("style", { dangerouslySetInnerHTML: { __html: e(i || {}) } }), a] });
6
+ }
7
+ //#endregion
8
+ export { i as ThemeProvider };
@@ -0,0 +1,64 @@
1
+ %text-link {
2
+ padding: 0;
3
+ border: none;
4
+ background: none;
5
+ color: var(--blue500);
6
+
7
+ &:not(:disabled):not(.disabled):hover {
8
+ color: var(--teal700);
9
+ background-color: transparent;
10
+ text-decoration: underline;
11
+ cursor: pointer;
12
+ }
13
+ }
14
+
15
+ %button-styles {
16
+ --btn-pad-y: calc(var(--w-gutter, 16px) * 0.5);
17
+ --btn-pad-x: calc(var(--w-gutter, 16px) * 0.75);
18
+ --btn-border-radius: calc(var(--w-gutter, 16px) * 0.75);
19
+ color: var(--blue600);
20
+ border: none;
21
+ cursor: pointer;
22
+ display: inline-flex;
23
+ flex-flow: row wrap;
24
+ align-items: center;
25
+ font-weight: 500;
26
+ transition: 0.125s;
27
+ padding: var(--btn-pad-y) var(--btn-pad-x);
28
+ border-radius: var(--btn-border-radius);
29
+ border: 1px solid var(--blue500);
30
+ background-color: var(--white);
31
+
32
+ &:not(:disabled):not(.disabled):hover {
33
+ background-color: var(--teal200);
34
+ }
35
+
36
+ &.text,
37
+ &[data-variant="text"] {
38
+ @extend %text-link;
39
+ }
40
+
41
+ &:disabled,
42
+ &.disabled {
43
+ cursor: not-allowed;
44
+ border-color: var(--gray200);
45
+ color: var(--gray400);
46
+
47
+ &.primary,
48
+ &[data-variant="primary"] {
49
+ border-color: var(--gray200);
50
+ background-color: var(--gray400);
51
+ color: var(--gray200);
52
+ }
53
+ }
54
+
55
+ &.primary,
56
+ &[data-variant="primary"] {
57
+ color: var(--white);
58
+ background-color: var(--blue500);
59
+
60
+ &:not(:disabled):not(.disabled):hover {
61
+ background-color: var(--blue700);
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,78 @@
1
+ %checkbox {
2
+ appearance: none;
3
+ box-sizing: border-box;
4
+ position: relative;
5
+ display: inline-block;
6
+ vertical-align: baseline;
7
+ top: 0.08em;
8
+ margin: 0;
9
+ padding: 0;
10
+ height: 16px;
11
+ width: 16px;
12
+ border-radius: 4px;
13
+ border: 1px solid var(--blue500);
14
+ background: #fff;
15
+
16
+ &::before {
17
+ content: "";
18
+ position: absolute;
19
+ inset: 0;
20
+ border-radius: 4px;
21
+ background: transparent;
22
+ transition: background-color 0.15s ease;
23
+ }
24
+
25
+ &::after {
26
+ position: absolute;
27
+ left: 50%;
28
+ top: 45%;
29
+ width: 5px;
30
+ height: 8px;
31
+ content: "";
32
+ display: block;
33
+ border: solid white;
34
+ border-width: 0 2px 2px 0;
35
+ transform: translate(-50%, -58%) rotate(45deg) scale(0);
36
+ transform-origin: center;
37
+ transition: transform 0.15s ease;
38
+ }
39
+
40
+ &:checked {
41
+ border-color: var(--blue500);
42
+
43
+ &::before {
44
+ background-color: var(--blue500);
45
+ border-radius: unset;
46
+ }
47
+
48
+ &::after {
49
+ transform: translate(-50%, -58%) rotate(45deg) scale(1);
50
+ }
51
+ }
52
+
53
+ &:disabled {
54
+ border-color: var(--gray500);
55
+
56
+ &::before {
57
+ background-color: var(--gray200);
58
+ }
59
+
60
+ &::after {
61
+ border-color: var(--gray200);
62
+ transform: translate(-50%, -58%) rotate(45deg) scale(1);
63
+ }
64
+ }
65
+
66
+ &:checked:disabled {
67
+ border-color: var(--gray400);
68
+
69
+ &::before {
70
+ background: var(--gray400);
71
+ }
72
+
73
+ &::after {
74
+ border-color: var(--white);
75
+ transform: translate(-50%, -58%) rotate(45deg) scale(1);
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,19 @@
1
+ %code {
2
+ background-color: var(--gray200);
3
+ color: var(--gray800);
4
+ padding: calc(var(--w-gutter, 16px) * 0.125) calc(var(--w-gutter, 16px) * 0.25);
5
+ margin: calc(var(--w-gutter, 16px) * 0.125);
6
+ display: inline-block;
7
+ font-size: var(--w-text, 14px);
8
+
9
+ &:has(pre) {
10
+ padding: var(--w-gutter, 16px);
11
+ border-radius: calc(var(--w-gutter, 16px) * 0.5);
12
+ background-color: var(--gray800);
13
+ color: var(--gray200);
14
+ }
15
+
16
+ &:has(pre) pre {
17
+ margin: 0;
18
+ }
19
+ }