@charcoal-ui/react 2.6.0 → 3.0.0-beta.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/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Switch/index.story.d.ts +1 -0
- package/dist/components/Switch/index.story.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts +2 -0
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.story.d.ts +1 -0
- package/dist/components/TagItem/index.story.d.ts.map +1 -1
- package/dist/index.cjs.js +99 -67
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +80 -48
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -6
- package/src/components/Button/index.story.tsx +6 -6
- package/src/components/Button/index.tsx +5 -5
- package/src/components/Checkbox/index.tsx +4 -0
- package/src/components/Modal/ModalPlumbing.tsx +2 -10
- package/src/components/Modal/index.story.tsx +5 -5
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/Radio/index.tsx +3 -0
- package/src/components/Switch/index.story.tsx +20 -1
- package/src/components/Switch/index.tsx +58 -33
- package/src/components/TagItem/index.story.tsx +1 -0
- package/src/components/TagItem/index.tsx +3 -0
- package/src/components/TextField/index.tsx +7 -0
package/dist/index.esm.js
CHANGED
|
@@ -147,7 +147,7 @@ var Button2 = React4.forwardRef(function Button3({
|
|
|
147
147
|
children,
|
|
148
148
|
variant = "Default",
|
|
149
149
|
size = "M",
|
|
150
|
-
fixed = false,
|
|
150
|
+
fullWidth: fixed = false,
|
|
151
151
|
disabled = false,
|
|
152
152
|
...rest
|
|
153
153
|
}, ref) {
|
|
@@ -158,7 +158,7 @@ var Button2 = React4.forwardRef(function Button3({
|
|
|
158
158
|
disabled,
|
|
159
159
|
variant,
|
|
160
160
|
size,
|
|
161
|
-
fixed,
|
|
161
|
+
fullWidth: fixed,
|
|
162
162
|
ref
|
|
163
163
|
},
|
|
164
164
|
children
|
|
@@ -167,10 +167,10 @@ var Button2 = React4.forwardRef(function Button3({
|
|
|
167
167
|
var Button_default = Button2;
|
|
168
168
|
var StyledButton = styled3(Clickable_default).withConfig({
|
|
169
169
|
shouldForwardProp(prop) {
|
|
170
|
-
return prop !== "
|
|
170
|
+
return prop !== "fullWidth";
|
|
171
171
|
}
|
|
172
172
|
}).attrs(styledProps)`
|
|
173
|
-
width: ${(p) => p.
|
|
173
|
+
width: ${(p) => p.fullWidth ? "stretch" : "min-content"};
|
|
174
174
|
display: inline-grid;
|
|
175
175
|
align-items: center;
|
|
176
176
|
justify-content: center;
|
|
@@ -406,6 +406,9 @@ var RadioInput = styled5.input.attrs({ type: "radio" })`
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
${theme((o) => o.outline.default.focus)}
|
|
409
|
+
|
|
410
|
+
/* FIXME: o.outline.default.focus の transition に o.bg.brand の transition が打ち消されてしまう */
|
|
411
|
+
transition: all 0.2s !important;
|
|
409
412
|
}
|
|
410
413
|
`;
|
|
411
414
|
var RadioLabel = styled5.div`
|
|
@@ -693,6 +696,10 @@ var Label = styled7.label`
|
|
|
693
696
|
|
|
694
697
|
${theme((o) => o.disabled)}
|
|
695
698
|
|
|
699
|
+
:active > input {
|
|
700
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
701
|
+
}
|
|
702
|
+
|
|
696
703
|
${disabledSelector3} {
|
|
697
704
|
cursor: default;
|
|
698
705
|
}
|
|
@@ -707,42 +714,63 @@ var LabelInner = styled7.div`
|
|
|
707
714
|
var SwitchInput = styled7.input.attrs({
|
|
708
715
|
type: "checkbox"
|
|
709
716
|
})`
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
border: 2px solid transparent;
|
|
717
|
-
transition: box-shadow 0.2s, background-color 0.2s;
|
|
718
|
-
cursor: inherit;
|
|
719
|
-
${theme((o) => [
|
|
720
|
-
o.borderRadius(16),
|
|
721
|
-
o.height.px(16),
|
|
722
|
-
o.bg.text4.hover.press,
|
|
723
|
-
o.outline.default.focus,
|
|
724
|
-
o.margin.all(0)
|
|
725
|
-
])}
|
|
717
|
+
appearance: none;
|
|
718
|
+
display: inline-flex;
|
|
719
|
+
position: relative;
|
|
720
|
+
box-sizing: border-box;
|
|
721
|
+
width: 28px;
|
|
722
|
+
border: 2px solid transparent;
|
|
726
723
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
display: block;
|
|
731
|
-
top: 0;
|
|
732
|
-
left: 0;
|
|
733
|
-
width: 12px;
|
|
734
|
-
height: 12px;
|
|
735
|
-
transform: translateX(0);
|
|
736
|
-
transition: transform 0.2s;
|
|
737
|
-
${theme((o) => [o.bg.text5.hover.press, o.borderRadius("oval")])}
|
|
738
|
-
}
|
|
724
|
+
transition-property: background-color, box-shadow;
|
|
725
|
+
transition-duration: 0.2s;
|
|
726
|
+
cursor: inherit;
|
|
739
727
|
|
|
740
|
-
|
|
741
|
-
|
|
728
|
+
outline: none;
|
|
729
|
+
border-radius: 16px;
|
|
730
|
+
height: 16px;
|
|
731
|
+
margin: 0;
|
|
732
|
+
background-color: var(--charcoal-text4);
|
|
733
|
+
:hover {
|
|
734
|
+
background-color: var(--charcoal-text4-hover);
|
|
735
|
+
}
|
|
736
|
+
:active {
|
|
737
|
+
background-color: var(--charcoal-text4-press);
|
|
738
|
+
}
|
|
739
|
+
:focus {
|
|
740
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
741
|
+
}
|
|
742
742
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
743
|
+
&::after {
|
|
744
|
+
content: '';
|
|
745
|
+
position: absolute;
|
|
746
|
+
display: block;
|
|
747
|
+
top: 0;
|
|
748
|
+
left: 0;
|
|
749
|
+
width: 12px;
|
|
750
|
+
height: 12px;
|
|
751
|
+
transform: translateX(0);
|
|
752
|
+
transition: transform 0.2s;
|
|
753
|
+
border-radius: 1024px;
|
|
754
|
+
background-color: var(--charcoal-text5);
|
|
755
|
+
:hover {
|
|
756
|
+
background-color: var(--charcoal-text5-hover);
|
|
757
|
+
}
|
|
758
|
+
:active {
|
|
759
|
+
background-color: var(--charcoal-text5-press);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
&:checked {
|
|
764
|
+
background-color: var(--charcoal-brand);
|
|
765
|
+
:hover {
|
|
766
|
+
background-color: var(--charcoal-brand-hover);
|
|
767
|
+
}
|
|
768
|
+
:active {
|
|
769
|
+
background-color: var(--charcoal-brand-press);
|
|
770
|
+
}
|
|
771
|
+
&::after {
|
|
772
|
+
transform: translateX(12px);
|
|
773
|
+
transition: transform 0.2s;
|
|
746
774
|
}
|
|
747
775
|
}
|
|
748
776
|
`;
|
|
@@ -1105,6 +1133,13 @@ var StyledTextareaContainer = styled9.div`
|
|
|
1105
1133
|
o.borderRadius(4)
|
|
1106
1134
|
])}
|
|
1107
1135
|
|
|
1136
|
+
/**
|
|
1137
|
+
* FIXME: o.outline.default を &:focus-within 内に書いてると、外れるときに transition が効かない
|
|
1138
|
+
* 本来 o.outline.default.focus と書けば足してくれるような transition の内容を一旦明示している
|
|
1139
|
+
* o.outline.default.focusWithin のようなものがあればこの行は不要になるはず
|
|
1140
|
+
*/
|
|
1141
|
+
transition: box-shadow 0.2s;
|
|
1142
|
+
|
|
1108
1143
|
&:focus-within {
|
|
1109
1144
|
${(p) => theme3((o) => p.invalid ? o.outline.assertive : o.outline.default)}
|
|
1110
1145
|
}
|
|
@@ -1363,7 +1398,6 @@ var ModalHeading = styled10.h3`
|
|
|
1363
1398
|
// src/components/Modal/ModalPlumbing.tsx
|
|
1364
1399
|
import React13 from "react";
|
|
1365
1400
|
import styled11 from "styled-components";
|
|
1366
|
-
import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
|
|
1367
1401
|
function ModalHeader() {
|
|
1368
1402
|
return /* @__PURE__ */ React13.createElement(ModalHeaderRoot, null, /* @__PURE__ */ React13.createElement(StyledModalTitle, null));
|
|
1369
1403
|
}
|
|
@@ -1377,11 +1411,7 @@ var StyledModalTitle = styled11(ModalTitle)`
|
|
|
1377
1411
|
${theme((o) => [o.font.text1, o.typography(16).bold])}
|
|
1378
1412
|
`;
|
|
1379
1413
|
var ModalAlign = styled11.div`
|
|
1380
|
-
${theme((o) => [o.padding.horizontal(
|
|
1381
|
-
|
|
1382
|
-
@media ${({ theme: theme4 }) => maxWidth2(theme4.breakpoint.screen1)} {
|
|
1383
|
-
${theme((o) => [o.padding.horizontal(16)])}
|
|
1384
|
-
}
|
|
1414
|
+
${theme((o) => [o.padding.horizontal(16)])}
|
|
1385
1415
|
`;
|
|
1386
1416
|
var ModalBody = styled11.div`
|
|
1387
1417
|
${theme((o) => [o.padding.bottom(40)])}
|
|
@@ -1390,11 +1420,8 @@ var ModalButtons = styled11.div`
|
|
|
1390
1420
|
display: grid;
|
|
1391
1421
|
grid-auto-flow: row;
|
|
1392
1422
|
grid-row-gap: 8px;
|
|
1393
|
-
${theme((o) => [o.padding.horizontal(24).top(16)])}
|
|
1394
1423
|
|
|
1395
|
-
|
|
1396
|
-
${theme((o) => [o.padding.horizontal(16)])}
|
|
1397
|
-
}
|
|
1424
|
+
${theme((o) => [o.padding.horizontal(16).top(16)])}
|
|
1398
1425
|
`;
|
|
1399
1426
|
|
|
1400
1427
|
// src/components/LoadingSpinner/index.tsx
|
|
@@ -1975,6 +2002,9 @@ var CheckboxInput = styled20.input`
|
|
|
1975
2002
|
border-color: ${({ theme: theme4 }) => theme4.color.text4};
|
|
1976
2003
|
}
|
|
1977
2004
|
${theme((o) => [o.outline.default.focus, o.borderRadius(4)])}
|
|
2005
|
+
|
|
2006
|
+
/* FIXME: o.outline.default.focus の transition に o.bg.brand の transition が打ち消されてしまう */
|
|
2007
|
+
transition: all 0.2s !important;
|
|
1978
2008
|
}
|
|
1979
2009
|
`;
|
|
1980
2010
|
var CheckboxInputOverlay = styled20.div`
|
|
@@ -2021,6 +2051,7 @@ var TagItem = forwardRef3(
|
|
|
2021
2051
|
size = "M",
|
|
2022
2052
|
disabled,
|
|
2023
2053
|
status = "default",
|
|
2054
|
+
className,
|
|
2024
2055
|
...props
|
|
2025
2056
|
}, _ref) {
|
|
2026
2057
|
const ref = useObjectRef2(_ref);
|
|
@@ -2040,7 +2071,8 @@ var TagItem = forwardRef3(
|
|
|
2040
2071
|
ref,
|
|
2041
2072
|
size: hasTranslatedLabel ? "M" : size,
|
|
2042
2073
|
status,
|
|
2043
|
-
...buttonProps
|
|
2074
|
+
...buttonProps,
|
|
2075
|
+
className
|
|
2044
2076
|
},
|
|
2045
2077
|
/* @__PURE__ */ React23.createElement(Background, { bgColor, bgImage, status }),
|
|
2046
2078
|
/* @__PURE__ */ React23.createElement(Inner, null, /* @__PURE__ */ React23.createElement(LabelWrapper, { isTranslate: hasTranslatedLabel }, hasTranslatedLabel && /* @__PURE__ */ React23.createElement(TranslatedLabel, null, /* @__PURE__ */ React23.createElement(Label3, null, translatedLabel)), /* @__PURE__ */ React23.createElement(Label3, null, label)), status === "active" && /* @__PURE__ */ React23.createElement(Icon_default, { name: "16/Remove" }))
|