@conveyorhq/arrow-ds 1.180.0 → 1.182.0
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/package.json +1 -1
- package/public/components/Toggle/Toggle.d.ts +2 -1
- package/public/components/Toggle/Toggle.js +9 -3
- package/public/css/styles.css +45 -7
- package/public/css/styles.min.css +1 -1
- package/public/css/styles.min.css.map +1 -1
- package/src/components/Markdown/index.css +8 -0
- package/src/components/Toggle/Toggle.stories.mdx +17 -0
- package/src/components/Toggle/Toggle.tsx +22 -2
- package/src/components/Toggle/index.css +0 -5
- package/src/css/utilities/animations.css +24 -0
package/package.json
CHANGED
|
@@ -9,5 +9,6 @@ export interface ToggleProps {
|
|
|
9
9
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
labelPosition?: "left" | "right";
|
|
12
|
+
size?: number;
|
|
12
13
|
}
|
|
13
|
-
export declare const Toggle: ({ checked, disabled, id, inputProps, className, onChange, onClick, children, labelPosition, ...rest }: ToggleProps) => React.JSX.Element;
|
|
14
|
+
export declare const Toggle: ({ checked, disabled, id, inputProps, className, onChange, onClick, children, labelPosition, size, ...rest }: ToggleProps) => React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
9
9
|
const Box_1 = require("../Box");
|
|
10
10
|
const bem_1 = require("../../utilities/bem");
|
|
11
11
|
const cn = (0, bem_1.bemHOF)("Toggle");
|
|
12
|
-
const Toggle = ({ checked = false, disabled = false, id, inputProps, className, onChange, onClick, children, labelPosition = "right", ...rest }) => {
|
|
12
|
+
const Toggle = ({ checked = false, disabled = false, id, inputProps, className, onChange, onClick, children, labelPosition = "right", size = 20, ...rest }) => {
|
|
13
13
|
const inputRef = react_1.default.useRef(null);
|
|
14
14
|
const handleChange = () => {
|
|
15
15
|
if (!disabled) {
|
|
@@ -28,8 +28,14 @@ const Toggle = ({ checked = false, disabled = false, id, inputProps, className,
|
|
|
28
28
|
}
|
|
29
29
|
}, ...rest },
|
|
30
30
|
react_1.default.createElement("input", { ref: inputRef, disabled: disabled, checked: checked, type: "checkbox", onChange: handleChange, value: checked ? "on" : "off", hidden: true, ...inputProps }),
|
|
31
|
-
react_1.default.createElement(Box_1.Box, { as: "span", className: cn({ e: "track" }), "aria-hidden": "true"
|
|
32
|
-
|
|
31
|
+
react_1.default.createElement(Box_1.Box, { as: "span", className: cn({ e: "track" }), "aria-hidden": "true", style: {
|
|
32
|
+
width: `${size * 2 - 4}px`,
|
|
33
|
+
} },
|
|
34
|
+
react_1.default.createElement(Box_1.Box, { as: "span", className: cn({ e: "thumb" }), style: {
|
|
35
|
+
width: `${size}px`,
|
|
36
|
+
height: `${size}px`,
|
|
37
|
+
transform: checked ? `translateX(${size - 4}px)` : "translateX(0)",
|
|
38
|
+
} })),
|
|
33
39
|
children && (react_1.default.createElement(Box_1.Box, { as: "span", className: (0, classnames_1.default)(cn({ e: "label" })) }, children))));
|
|
34
40
|
};
|
|
35
41
|
exports.Toggle = Toggle;
|
package/public/css/styles.css
CHANGED
|
@@ -4528,6 +4528,10 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
4528
4528
|
margin-bottom: 0;
|
|
4529
4529
|
}
|
|
4530
4530
|
|
|
4531
|
+
.ads-Markdown ol + ul {
|
|
4532
|
+
padding-left: 64px;
|
|
4533
|
+
}
|
|
4534
|
+
|
|
4531
4535
|
.ads-Markdown li input[type="checkbox"] {
|
|
4532
4536
|
margin-left: -16px;
|
|
4533
4537
|
margin-right: 8px;
|
|
@@ -4572,6 +4576,10 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
4572
4576
|
padding: 0;
|
|
4573
4577
|
}
|
|
4574
4578
|
|
|
4579
|
+
.ads-Markdown a {
|
|
4580
|
+
word-break: break-word;
|
|
4581
|
+
}
|
|
4582
|
+
|
|
4575
4583
|
:root {
|
|
4576
4584
|
--markdown-editor-max-height: calc(100vh - 40px);
|
|
4577
4585
|
--markdown-editor-max-width: calc(100vw - 40px);
|
|
@@ -7815,7 +7823,6 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
7815
7823
|
|
|
7816
7824
|
.ads-Toggle-track {
|
|
7817
7825
|
display: block;
|
|
7818
|
-
width: 36px;
|
|
7819
7826
|
cursor: pointer;
|
|
7820
7827
|
border-radius: 9999px;
|
|
7821
7828
|
}
|
|
@@ -7823,8 +7830,6 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
7823
7830
|
.ads-Toggle-thumb {
|
|
7824
7831
|
position: relative;
|
|
7825
7832
|
display: block;
|
|
7826
|
-
height: 20px;
|
|
7827
|
-
width: 20px;
|
|
7828
7833
|
border-radius: 9999px;
|
|
7829
7834
|
border-width: 1px;
|
|
7830
7835
|
transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, -webkit-text-decoration-color, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;
|
|
@@ -7853,10 +7858,6 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
7853
7858
|
border-color: rgb(51 198 159 / var(--tw-border-opacity));
|
|
7854
7859
|
--tw-bg-opacity: 1;
|
|
7855
7860
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
7856
|
-
|
|
7857
|
-
-webkit-transform: translateX(16px);
|
|
7858
|
-
|
|
7859
|
-
transform: translateX(16px);
|
|
7860
7861
|
}
|
|
7861
7862
|
|
|
7862
7863
|
/* Off */
|
|
@@ -9162,6 +9163,30 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
9162
9163
|
}
|
|
9163
9164
|
}
|
|
9164
9165
|
|
|
9166
|
+
@-webkit-keyframes working-banner-gradient {
|
|
9167
|
+
0% {
|
|
9168
|
+
background-position: 0% 50%;
|
|
9169
|
+
}
|
|
9170
|
+
50% {
|
|
9171
|
+
background-position: 100% 50%;
|
|
9172
|
+
}
|
|
9173
|
+
100% {
|
|
9174
|
+
background-position: 0% 50%;
|
|
9175
|
+
}
|
|
9176
|
+
}
|
|
9177
|
+
|
|
9178
|
+
@keyframes working-banner-gradient {
|
|
9179
|
+
0% {
|
|
9180
|
+
background-position: 0% 50%;
|
|
9181
|
+
}
|
|
9182
|
+
50% {
|
|
9183
|
+
background-position: 100% 50%;
|
|
9184
|
+
}
|
|
9185
|
+
100% {
|
|
9186
|
+
background-position: 0% 50%;
|
|
9187
|
+
}
|
|
9188
|
+
}
|
|
9189
|
+
|
|
9165
9190
|
.animated {
|
|
9166
9191
|
-webkit-animation-duration: 500ms;
|
|
9167
9192
|
animation-duration: 500ms;
|
|
@@ -9231,6 +9256,19 @@ button.ads-DateRangePicker-preset--isSelected:hover {
|
|
|
9231
9256
|
animation: toast-leave 0.15s ease-in forwards;
|
|
9232
9257
|
}
|
|
9233
9258
|
|
|
9259
|
+
.working-banner-gradient {
|
|
9260
|
+
background: linear-gradient(
|
|
9261
|
+
89deg,
|
|
9262
|
+
rgba(51, 198, 159, 0.25) 0.27%,
|
|
9263
|
+
rgba(118, 186, 249, 0.25) 77.05%,
|
|
9264
|
+
rgba(200, 179, 232, 0.25) 99.79%
|
|
9265
|
+
),
|
|
9266
|
+
#fff;
|
|
9267
|
+
background-size: 200% 200%;
|
|
9268
|
+
-webkit-animation: working-banner-gradient 2.5s ease infinite;
|
|
9269
|
+
animation: working-banner-gradient 2.5s ease infinite;
|
|
9270
|
+
}
|
|
9271
|
+
|
|
9234
9272
|
.elevation-inset {
|
|
9235
9273
|
box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.01);
|
|
9236
9274
|
}
|