@remember-web/primitive 0.2.13 → 0.3.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/src/Inputs/Select/DesignedSelect/styles.cjs.js +1 -1
- package/dist/src/Inputs/Select/DesignedSelect/styles.cjs.js.map +1 -1
- package/dist/src/Inputs/Select/DesignedSelect/styles.esm.js +1 -1
- package/dist/src/Inputs/Select/DesignedSelect/styles.esm.js.map +1 -1
- package/dist/src/Inputs/Select/index.cjs.js +25 -39
- package/dist/src/Inputs/Select/index.cjs.js.map +1 -1
- package/dist/src/Inputs/Select/index.d.ts.map +1 -1
- package/dist/src/Inputs/Select/index.esm.js +26 -40
- package/dist/src/Inputs/Select/index.esm.js.map +1 -1
- package/dist/src/Inputs/Select/styles.cjs.js +1 -3
- package/dist/src/Inputs/Select/styles.cjs.js.map +1 -1
- package/dist/src/Inputs/Select/styles.d.ts +0 -1
- package/dist/src/Inputs/Select/styles.d.ts.map +1 -1
- package/dist/src/Inputs/Select/styles.esm.js +3 -4
- package/dist/src/Inputs/Select/styles.esm.js.map +1 -1
- package/dist/src/Inputs/Select/types.d.ts +0 -1
- package/dist/src/Inputs/Select/types.d.ts.map +1 -1
- package/dist/src/Inputs/TextInput/styles.cjs.js +2 -2
- package/dist/src/Inputs/TextInput/styles.cjs.js.map +1 -1
- package/dist/src/Inputs/TextInput/styles.esm.js +2 -2
- package/dist/src/Inputs/TextInput/styles.esm.js.map +1 -1
- package/dist/src/Inputs/TextInput/types.d.ts +3 -0
- package/dist/src/Inputs/TextInput/types.d.ts.map +1 -1
- package/dist/src/Labels/Label/index.cjs.js +58 -0
- package/dist/src/Labels/Label/index.cjs.js.map +1 -0
- package/dist/src/Labels/Label/index.d.ts +5 -0
- package/dist/src/Labels/Label/index.d.ts.map +1 -0
- package/dist/src/Labels/Label/index.esm.js +51 -0
- package/dist/src/Labels/Label/index.esm.js.map +1 -0
- package/dist/src/Labels/Label/styles.cjs.js +79 -0
- package/dist/src/Labels/Label/styles.cjs.js.map +1 -0
- package/dist/src/Labels/Label/styles.d.ts +11 -0
- package/dist/src/Labels/Label/styles.d.ts.map +1 -0
- package/dist/src/Labels/Label/styles.esm.js +72 -0
- package/dist/src/Labels/Label/styles.esm.js.map +1 -0
- package/dist/src/Labels/Label/types.d.ts +13 -0
- package/dist/src/Labels/Label/types.d.ts.map +1 -0
- package/dist/src/Labels/index.d.ts +2 -0
- package/dist/src/Labels/index.d.ts.map +1 -0
- package/dist/src/index.cjs.js +2 -0
- package/dist/src/index.cjs.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.esm.js +1 -0
- package/dist/src/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/Inputs/Select/DesignedSelect/styles.ts +1 -1
- package/src/Inputs/Select/Select.stories.tsx +0 -1
- package/src/Inputs/Select/index.tsx +30 -48
- package/src/Inputs/Select/styles.ts +0 -15
- package/src/Inputs/Select/types.ts +0 -1
- package/src/Inputs/TextInput/styles.ts +2 -2
- package/src/Inputs/TextInput/types.ts +3 -0
- package/src/Labels/Label/Label.stories.tsx +68 -0
- package/src/Labels/Label/index.tsx +50 -0
- package/src/Labels/Label/styles.ts +138 -0
- package/src/Labels/Label/types.ts +30 -0
- package/src/Labels/index.ts +1 -0
- package/src/index.ts +1 -0
|
@@ -24,7 +24,7 @@ var StyledSelect = styled__default.default.div(_templateObject || (_templateObje
|
|
|
24
24
|
return isPlaceholder && styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral__default.default(["\n color: ", ";\n "])), mixin.contents200);
|
|
25
25
|
}, styles.SelectContainer, mixin.contents000, styles.SelectContainer, mixin.bg200, mixin.bg300);
|
|
26
26
|
var SelectDownIcon = styled__default.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral__default.default(["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n\n & > svg {\n display: block;\n }\n\n pointer-events: none;\n"])));
|
|
27
|
-
var SelectOptionWrapper = styled__default.default.ul(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral__default.default(["\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ", ";\n background-color: ", ";\n overflow-y:
|
|
27
|
+
var SelectOptionWrapper = styled__default.default.ul(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral__default.default(["\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ", ";\n background-color: ", ";\n overflow-y: auto;\n overscroll-behavior: contain;\n transition: border-color 0.2s, background-color 0.2s;\n\n ", ";\n\n ", "\n\n ", ":focus &, ", ":focus-within & {\n outline: none;\n border-color: ", ";\n }\n"])), mixin.contents300, mixin.bg100, function (_ref3) {
|
|
28
28
|
var maxHeight = _ref3.maxHeight;
|
|
29
29
|
if (!maxHeight) {
|
|
30
30
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.cjs.js","sources":["../../../../../src/Inputs/Select/DesignedSelect/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg100,\n bg200,\n bg300,\n contents000,\n contents200,\n contents300,\n ellipsis,\n} from '@remember-web/mixin';\nimport styled, { css } from 'styled-components';\n\nimport { SelectContainer } from '../styles';\nimport type { ExpandedType } from './types';\n\nexport const StyledSelect = styled.div<{\n expandedDirection?: ExpandedType;\n isPlaceholder?: boolean;\n}>`\n ${ellipsis()}\n border: 1px solid ${contents300};\n ${({ expandedDirection }) =>\n ({\n none: css`\n border-radius: 4px;\n `,\n above: css`\n border-radius: 0 0 4px 4px;\n border-top-color: transparent;\n `,\n below: css`\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n `,\n })[expandedDirection ?? 'none']};\n\n padding: 10px 36px 10px 12px;\n transition: border-color 0.2s, background-color 0.2s;\n\n ${({ isPlaceholder }) =>\n isPlaceholder &&\n css`\n color: ${contents200};\n `}\n\n ${SelectContainer}:focus-within & {\n outline: none;\n border-color: ${contents000};\n }\n ${SelectContainer}:not([aria-disabled='true']) & {\n @media (hover: hover) {\n &:hover {\n background-color: ${bg200};\n }\n }\n\n &:active {\n background-color: ${bg300};\n }\n }\n`;\n\nexport const SelectDownIcon = styled.div`\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n\n & > svg {\n display: block;\n }\n\n pointer-events: none;\n`;\n\nexport const SelectOptionWrapper = styled.ul<{\n expandedDirection?: ExpandedType;\n maxHeight?: number | string;\n}>`\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ${contents300};\n background-color: ${bg100};\n overflow-y:
|
|
1
|
+
{"version":3,"file":"styles.cjs.js","sources":["../../../../../src/Inputs/Select/DesignedSelect/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg100,\n bg200,\n bg300,\n contents000,\n contents200,\n contents300,\n ellipsis,\n} from '@remember-web/mixin';\nimport styled, { css } from 'styled-components';\n\nimport { SelectContainer } from '../styles';\nimport type { ExpandedType } from './types';\n\nexport const StyledSelect = styled.div<{\n expandedDirection?: ExpandedType;\n isPlaceholder?: boolean;\n}>`\n ${ellipsis()}\n border: 1px solid ${contents300};\n ${({ expandedDirection }) =>\n ({\n none: css`\n border-radius: 4px;\n `,\n above: css`\n border-radius: 0 0 4px 4px;\n border-top-color: transparent;\n `,\n below: css`\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n `,\n })[expandedDirection ?? 'none']};\n\n padding: 10px 36px 10px 12px;\n transition: border-color 0.2s, background-color 0.2s;\n\n ${({ isPlaceholder }) =>\n isPlaceholder &&\n css`\n color: ${contents200};\n `}\n\n ${SelectContainer}:focus-within & {\n outline: none;\n border-color: ${contents000};\n }\n ${SelectContainer}:not([aria-disabled='true']) & {\n @media (hover: hover) {\n &:hover {\n background-color: ${bg200};\n }\n }\n\n &:active {\n background-color: ${bg300};\n }\n }\n`;\n\nexport const SelectDownIcon = styled.div`\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n\n & > svg {\n display: block;\n }\n\n pointer-events: none;\n`;\n\nexport const SelectOptionWrapper = styled.ul<{\n expandedDirection?: ExpandedType;\n maxHeight?: number | string;\n}>`\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ${contents300};\n background-color: ${bg100};\n overflow-y: auto;\n overscroll-behavior: contain;\n transition: border-color 0.2s, background-color 0.2s;\n\n ${({ maxHeight }) => {\n if (!maxHeight) {\n return null;\n }\n\n if (typeof maxHeight === 'number') {\n return css`\n max-height: ${maxHeight}px;\n `;\n }\n\n return css`\n max-height: ${maxHeight};\n `;\n }};\n\n ${({ expandedDirection }) =>\n expandedDirection === 'below'\n ? css`\n top: calc(100% - 1px);\n border-top: none;\n border-radius: 0 0 4px 4px;\n `\n : css`\n bottom: calc(100% - 1px);\n border-bottom: none;\n border-radius: 4px 4px 0 0;\n `}\n\n ${SelectContainer}:focus &, ${SelectContainer}:focus-within & {\n outline: none;\n border-color: ${contents000};\n }\n`;\n\nexport const SelectOption = styled.li<{ isSelected?: boolean }>`\n ${ellipsis()}\n padding: 10px 12px;\n color: ${contents000};\n\n &[aria-disabled='true'] {\n color: ${contents300};\n }\n\n &:focus {\n background-color: ${bg200};\n outline: none;\n }\n\n ${({ isSelected }) =>\n isSelected &&\n css`\n background-color: ${bg200};\n `}\n`;\n"],"names":["below","SelectDownIcon"],"mappings":";;;;;;;;;;;;;AAAa;AAgBN;AAMH;;;;AASEA;;AAI6B;AAK/B;;AAIC;AAmBQC;;AA4BU;;AAEjB;AACF;AAEA;;AAIA;;AAKF;AAEE;AAAoB;AAWf;AAQF;AAcH;;AAIC;;;;;"}
|
|
@@ -17,7 +17,7 @@ var StyledSelect = styled.div(_templateObject || (_templateObject = _taggedTempl
|
|
|
17
17
|
return isPlaceholder && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n "])), contents200);
|
|
18
18
|
}, SelectContainer, contents000, SelectContainer, bg200, bg300);
|
|
19
19
|
var SelectDownIcon = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n\n & > svg {\n display: block;\n }\n\n pointer-events: none;\n"])));
|
|
20
|
-
var SelectOptionWrapper = styled.ul(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ", ";\n background-color: ", ";\n overflow-y:
|
|
20
|
+
var SelectOptionWrapper = styled.ul(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ", ";\n background-color: ", ";\n overflow-y: auto;\n overscroll-behavior: contain;\n transition: border-color 0.2s, background-color 0.2s;\n\n ", ";\n\n ", "\n\n ", ":focus &, ", ":focus-within & {\n outline: none;\n border-color: ", ";\n }\n"])), contents300, bg100, function (_ref3) {
|
|
21
21
|
var maxHeight = _ref3.maxHeight;
|
|
22
22
|
if (!maxHeight) {
|
|
23
23
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.esm.js","sources":["../../../../../src/Inputs/Select/DesignedSelect/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg100,\n bg200,\n bg300,\n contents000,\n contents200,\n contents300,\n ellipsis,\n} from '@remember-web/mixin';\nimport styled, { css } from 'styled-components';\n\nimport { SelectContainer } from '../styles';\nimport type { ExpandedType } from './types';\n\nexport const StyledSelect = styled.div<{\n expandedDirection?: ExpandedType;\n isPlaceholder?: boolean;\n}>`\n ${ellipsis()}\n border: 1px solid ${contents300};\n ${({ expandedDirection }) =>\n ({\n none: css`\n border-radius: 4px;\n `,\n above: css`\n border-radius: 0 0 4px 4px;\n border-top-color: transparent;\n `,\n below: css`\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n `,\n })[expandedDirection ?? 'none']};\n\n padding: 10px 36px 10px 12px;\n transition: border-color 0.2s, background-color 0.2s;\n\n ${({ isPlaceholder }) =>\n isPlaceholder &&\n css`\n color: ${contents200};\n `}\n\n ${SelectContainer}:focus-within & {\n outline: none;\n border-color: ${contents000};\n }\n ${SelectContainer}:not([aria-disabled='true']) & {\n @media (hover: hover) {\n &:hover {\n background-color: ${bg200};\n }\n }\n\n &:active {\n background-color: ${bg300};\n }\n }\n`;\n\nexport const SelectDownIcon = styled.div`\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n\n & > svg {\n display: block;\n }\n\n pointer-events: none;\n`;\n\nexport const SelectOptionWrapper = styled.ul<{\n expandedDirection?: ExpandedType;\n maxHeight?: number | string;\n}>`\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ${contents300};\n background-color: ${bg100};\n overflow-y:
|
|
1
|
+
{"version":3,"file":"styles.esm.js","sources":["../../../../../src/Inputs/Select/DesignedSelect/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg100,\n bg200,\n bg300,\n contents000,\n contents200,\n contents300,\n ellipsis,\n} from '@remember-web/mixin';\nimport styled, { css } from 'styled-components';\n\nimport { SelectContainer } from '../styles';\nimport type { ExpandedType } from './types';\n\nexport const StyledSelect = styled.div<{\n expandedDirection?: ExpandedType;\n isPlaceholder?: boolean;\n}>`\n ${ellipsis()}\n border: 1px solid ${contents300};\n ${({ expandedDirection }) =>\n ({\n none: css`\n border-radius: 4px;\n `,\n above: css`\n border-radius: 0 0 4px 4px;\n border-top-color: transparent;\n `,\n below: css`\n border-radius: 4px 4px 0 0;\n border-bottom-color: transparent;\n `,\n })[expandedDirection ?? 'none']};\n\n padding: 10px 36px 10px 12px;\n transition: border-color 0.2s, background-color 0.2s;\n\n ${({ isPlaceholder }) =>\n isPlaceholder &&\n css`\n color: ${contents200};\n `}\n\n ${SelectContainer}:focus-within & {\n outline: none;\n border-color: ${contents000};\n }\n ${SelectContainer}:not([aria-disabled='true']) & {\n @media (hover: hover) {\n &:hover {\n background-color: ${bg200};\n }\n }\n\n &:active {\n background-color: ${bg300};\n }\n }\n`;\n\nexport const SelectDownIcon = styled.div`\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n\n & > svg {\n display: block;\n }\n\n pointer-events: none;\n`;\n\nexport const SelectOptionWrapper = styled.ul<{\n expandedDirection?: ExpandedType;\n maxHeight?: number | string;\n}>`\n all: unset;\n position: absolute;\n left: 0;\n right: 0;\n z-index: 1;\n border: 1px solid ${contents300};\n background-color: ${bg100};\n overflow-y: auto;\n overscroll-behavior: contain;\n transition: border-color 0.2s, background-color 0.2s;\n\n ${({ maxHeight }) => {\n if (!maxHeight) {\n return null;\n }\n\n if (typeof maxHeight === 'number') {\n return css`\n max-height: ${maxHeight}px;\n `;\n }\n\n return css`\n max-height: ${maxHeight};\n `;\n }};\n\n ${({ expandedDirection }) =>\n expandedDirection === 'below'\n ? css`\n top: calc(100% - 1px);\n border-top: none;\n border-radius: 0 0 4px 4px;\n `\n : css`\n bottom: calc(100% - 1px);\n border-bottom: none;\n border-radius: 4px 4px 0 0;\n `}\n\n ${SelectContainer}:focus &, ${SelectContainer}:focus-within & {\n outline: none;\n border-color: ${contents000};\n }\n`;\n\nexport const SelectOption = styled.li<{ isSelected?: boolean }>`\n ${ellipsis()}\n padding: 10px 12px;\n color: ${contents000};\n\n &[aria-disabled='true'] {\n color: ${contents300};\n }\n\n &:focus {\n background-color: ${bg200};\n outline: none;\n }\n\n ${({ isSelected }) =>\n isSelected &&\n css`\n background-color: ${bg200};\n `}\n`;\n"],"names":["below","SelectDownIcon"],"mappings":";;;;;;AAAa;AAgBN;AAMH;;;;AASEA;;AAI6B;AAK/B;;AAIC;AAmBQC;;AA4BU;;AAEjB;AACF;AAEA;;AAIA;;AAKF;AAEE;AAAoB;AAWf;AAQF;AAcH;;AAIC;;"}
|
|
@@ -7,7 +7,6 @@ var index$4 = require('./DesignedSelect/index.cjs.js');
|
|
|
7
7
|
var index$2 = require('./NativeSelect/index.cjs.js');
|
|
8
8
|
var index$3 = require('./NativeSelect/Option/index.cjs.js');
|
|
9
9
|
var index$1 = require('./Option/index.cjs.js');
|
|
10
|
-
var styles = require('./styles.cjs.js');
|
|
11
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
11
|
|
|
13
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -18,7 +17,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
18
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
18
|
function Select(props, ref) {
|
|
20
19
|
var children = props.children,
|
|
21
|
-
label = props.label,
|
|
22
20
|
value = props.value,
|
|
23
21
|
className = props.className,
|
|
24
22
|
disabled = props.disabled,
|
|
@@ -28,49 +26,37 @@ function Select(props, ref) {
|
|
|
28
26
|
required = props.required,
|
|
29
27
|
onClick = props.onClick;
|
|
30
28
|
if (props["native"]) {
|
|
31
|
-
return /*#__PURE__*/jsxRuntime.
|
|
32
|
-
children: [label && /*#__PURE__*/jsxRuntime.jsxs(styles.SelectLabel, {
|
|
33
|
-
children: [label, required && /*#__PURE__*/jsxRuntime.jsx("mark", {
|
|
34
|
-
children: "*"
|
|
35
|
-
})]
|
|
36
|
-
}), /*#__PURE__*/jsxRuntime.jsx(index$2, {
|
|
37
|
-
disabled: disabled,
|
|
38
|
-
className: className,
|
|
39
|
-
onClick: onClick,
|
|
40
|
-
onChange: function onChange(e) {
|
|
41
|
-
_onChange === null || _onChange === void 0 || _onChange(e.target.value, e.target.innerText);
|
|
42
|
-
},
|
|
43
|
-
value: value,
|
|
44
|
-
required: required,
|
|
45
|
-
placeholder: placeholder,
|
|
46
|
-
width: width,
|
|
47
|
-
ref: ref,
|
|
48
|
-
children: react.Children.map(children, function (child) {
|
|
49
|
-
return /*#__PURE__*/jsxRuntime.jsx(index$3.NativeOption, _objectSpread({}, child.props));
|
|
50
|
-
})
|
|
51
|
-
})]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
55
|
-
children: [label && /*#__PURE__*/jsxRuntime.jsxs(styles.SelectLabel, {
|
|
56
|
-
children: [label, required && /*#__PURE__*/jsxRuntime.jsx("mark", {
|
|
57
|
-
children: "*"
|
|
58
|
-
})]
|
|
59
|
-
}), /*#__PURE__*/jsxRuntime.jsx(index$4, {
|
|
60
|
-
className: className,
|
|
61
|
-
value: value,
|
|
29
|
+
return /*#__PURE__*/jsxRuntime.jsx(index$2, {
|
|
62
30
|
disabled: disabled,
|
|
31
|
+
className: className,
|
|
63
32
|
onClick: onClick,
|
|
64
|
-
onChange: function onChange(
|
|
65
|
-
|
|
33
|
+
onChange: function onChange(e) {
|
|
34
|
+
_onChange === null || _onChange === void 0 || _onChange(e.target.value, e.target.innerText);
|
|
66
35
|
},
|
|
36
|
+
value: value,
|
|
37
|
+
required: required,
|
|
67
38
|
placeholder: placeholder,
|
|
68
39
|
width: width,
|
|
69
|
-
maxHeight: props.maxHeight,
|
|
70
|
-
extendDirection: props.extendDirection,
|
|
71
40
|
ref: ref,
|
|
72
|
-
children: children
|
|
73
|
-
|
|
41
|
+
children: react.Children.map(children, function (child) {
|
|
42
|
+
return /*#__PURE__*/jsxRuntime.jsx(index$3.NativeOption, _objectSpread({}, child.props));
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return /*#__PURE__*/jsxRuntime.jsx(index$4, {
|
|
47
|
+
className: className,
|
|
48
|
+
value: value,
|
|
49
|
+
disabled: disabled,
|
|
50
|
+
onClick: onClick,
|
|
51
|
+
onChange: function onChange(_value, _label) {
|
|
52
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(_value, _label);
|
|
53
|
+
},
|
|
54
|
+
placeholder: placeholder,
|
|
55
|
+
width: width,
|
|
56
|
+
maxHeight: props.maxHeight,
|
|
57
|
+
extendDirection: props.extendDirection,
|
|
58
|
+
ref: ref,
|
|
59
|
+
children: children
|
|
74
60
|
});
|
|
75
61
|
}
|
|
76
62
|
var index = Object.assign( /*#__PURE__*/react.forwardRef(Select), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Inputs/Select/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Ref, RefAttributes } from 'react';\nimport { Children, forwardRef } from 'react';\n\nimport DesignedSelect from './DesignedSelect';\nimport NativeSelect from './NativeSelect';\nimport { NativeOption } from './NativeSelect/Option';\nimport { OptionHolder } from './Option';\nimport
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Inputs/Select/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Ref, RefAttributes } from 'react';\nimport { Children, forwardRef } from 'react';\n\nimport DesignedSelect from './DesignedSelect';\nimport NativeSelect from './NativeSelect';\nimport { NativeOption } from './NativeSelect/Option';\nimport { OptionHolder } from './Option';\nimport type {\n DesignedSelectProps,\n NativeSelectProps,\n SelectProps,\n SelectValue,\n} from './types';\n\nfunction Select<Value extends SelectValue>(\n props: SelectProps<Value>,\n ref: Ref<HTMLDivElement | HTMLSelectElement>\n) {\n const {\n children,\n value,\n className,\n disabled,\n onChange,\n placeholder,\n width,\n required,\n onClick,\n } = props;\n\n if (props.native) {\n return (\n <NativeSelect\n disabled={disabled}\n className={className}\n onClick={onClick}\n onChange={(e) => {\n onChange?.(e.target.value as Value, e.target.innerText);\n }}\n value={value}\n required={required}\n placeholder={placeholder}\n width={width}\n ref={ref as Ref<HTMLSelectElement>}\n >\n {Children.map(children, (child) => (\n <NativeOption {...child.props} />\n ))}\n </NativeSelect>\n );\n }\n\n return (\n <DesignedSelect\n className={className}\n value={value}\n disabled={disabled}\n onClick={onClick}\n onChange={(_value, _label) => onChange?.(_value as Value, _label)}\n placeholder={placeholder}\n width={width}\n maxHeight={props.maxHeight}\n extendDirection={props.extendDirection}\n ref={ref as Ref<HTMLDivElement>}\n >\n {children}\n </DesignedSelect>\n );\n}\n\nexport default Object.assign(\n forwardRef(Select) as <Value extends SelectValue>(\n props:\n | (DesignedSelectProps<Value> & RefAttributes<HTMLDivElement>)\n | (NativeSelectProps<Value> & RefAttributes<HTMLSelectElement>)\n ) => JSX.Element,\n { Option: OptionHolder }\n);\n"],"names":["disabled","className","onClick","onChange","value","required","placeholder","width","ref","children","Option"],"mappings":";;;;;;;;;;;;;;;AAAa;AAAA;AAgBb;AAIE;;;;;;;;;;;AAeMA;AACAC;AACAC;AACAC;AACEA;;AAEFC;AACAC;AACAC;AACAC;AACAC;;;;AAIE;AAGR;;AAIIP;AACAG;AACAJ;AACAE;AACAC;;;AACAG;AACAC;;;AAGAC;AAAgCC;AAEvB;AAGf;AAEA;AAMIC;AAAqB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/Select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;AAOhD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAEjB,WAAW,EACZ,MAAM,SAAS,CAAC;4DA6DT,CAAC,oBAAoB,KAAK,CAAC,GAAG,cAAc,cAAc,CAAC,CAAC,GAC5D,CAAC,kBAAkB,KAAK,CAAC,GAAG,cAAc,iBAAiB,CAAC,CAAC,KAC9D,WAAW;;;;;;AALlB,wBAOE"}
|
|
@@ -5,14 +5,12 @@ import DesignedSelect from './DesignedSelect/index.esm.js';
|
|
|
5
5
|
import NativeSelect from './NativeSelect/index.esm.js';
|
|
6
6
|
import { NativeOption } from './NativeSelect/Option/index.esm.js';
|
|
7
7
|
import { OptionHolder } from './Option/index.esm.js';
|
|
8
|
-
import {
|
|
9
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
9
|
|
|
11
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
12
|
function Select(props, ref) {
|
|
14
13
|
var children = props.children,
|
|
15
|
-
label = props.label,
|
|
16
14
|
value = props.value,
|
|
17
15
|
className = props.className,
|
|
18
16
|
disabled = props.disabled,
|
|
@@ -22,49 +20,37 @@ function Select(props, ref) {
|
|
|
22
20
|
required = props.required,
|
|
23
21
|
onClick = props.onClick;
|
|
24
22
|
if (props["native"]) {
|
|
25
|
-
return /*#__PURE__*/
|
|
26
|
-
children: [label && /*#__PURE__*/jsxs(SelectLabel, {
|
|
27
|
-
children: [label, required && /*#__PURE__*/jsx("mark", {
|
|
28
|
-
children: "*"
|
|
29
|
-
})]
|
|
30
|
-
}), /*#__PURE__*/jsx(NativeSelect, {
|
|
31
|
-
disabled: disabled,
|
|
32
|
-
className: className,
|
|
33
|
-
onClick: onClick,
|
|
34
|
-
onChange: function onChange(e) {
|
|
35
|
-
_onChange === null || _onChange === void 0 || _onChange(e.target.value, e.target.innerText);
|
|
36
|
-
},
|
|
37
|
-
value: value,
|
|
38
|
-
required: required,
|
|
39
|
-
placeholder: placeholder,
|
|
40
|
-
width: width,
|
|
41
|
-
ref: ref,
|
|
42
|
-
children: Children.map(children, function (child) {
|
|
43
|
-
return /*#__PURE__*/jsx(NativeOption, _objectSpread({}, child.props));
|
|
44
|
-
})
|
|
45
|
-
})]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return /*#__PURE__*/jsxs("div", {
|
|
49
|
-
children: [label && /*#__PURE__*/jsxs(SelectLabel, {
|
|
50
|
-
children: [label, required && /*#__PURE__*/jsx("mark", {
|
|
51
|
-
children: "*"
|
|
52
|
-
})]
|
|
53
|
-
}), /*#__PURE__*/jsx(DesignedSelect, {
|
|
54
|
-
className: className,
|
|
55
|
-
value: value,
|
|
23
|
+
return /*#__PURE__*/jsx(NativeSelect, {
|
|
56
24
|
disabled: disabled,
|
|
25
|
+
className: className,
|
|
57
26
|
onClick: onClick,
|
|
58
|
-
onChange: function onChange(
|
|
59
|
-
|
|
27
|
+
onChange: function onChange(e) {
|
|
28
|
+
_onChange === null || _onChange === void 0 || _onChange(e.target.value, e.target.innerText);
|
|
60
29
|
},
|
|
30
|
+
value: value,
|
|
31
|
+
required: required,
|
|
61
32
|
placeholder: placeholder,
|
|
62
33
|
width: width,
|
|
63
|
-
maxHeight: props.maxHeight,
|
|
64
|
-
extendDirection: props.extendDirection,
|
|
65
34
|
ref: ref,
|
|
66
|
-
children: children
|
|
67
|
-
|
|
35
|
+
children: Children.map(children, function (child) {
|
|
36
|
+
return /*#__PURE__*/jsx(NativeOption, _objectSpread({}, child.props));
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return /*#__PURE__*/jsx(DesignedSelect, {
|
|
41
|
+
className: className,
|
|
42
|
+
value: value,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
onClick: onClick,
|
|
45
|
+
onChange: function onChange(_value, _label) {
|
|
46
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(_value, _label);
|
|
47
|
+
},
|
|
48
|
+
placeholder: placeholder,
|
|
49
|
+
width: width,
|
|
50
|
+
maxHeight: props.maxHeight,
|
|
51
|
+
extendDirection: props.extendDirection,
|
|
52
|
+
ref: ref,
|
|
53
|
+
children: children
|
|
68
54
|
});
|
|
69
55
|
}
|
|
70
56
|
var index = Object.assign( /*#__PURE__*/forwardRef(Select), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Inputs/Select/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Ref, RefAttributes } from 'react';\nimport { Children, forwardRef } from 'react';\n\nimport DesignedSelect from './DesignedSelect';\nimport NativeSelect from './NativeSelect';\nimport { NativeOption } from './NativeSelect/Option';\nimport { OptionHolder } from './Option';\nimport
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Inputs/Select/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Ref, RefAttributes } from 'react';\nimport { Children, forwardRef } from 'react';\n\nimport DesignedSelect from './DesignedSelect';\nimport NativeSelect from './NativeSelect';\nimport { NativeOption } from './NativeSelect/Option';\nimport { OptionHolder } from './Option';\nimport type {\n DesignedSelectProps,\n NativeSelectProps,\n SelectProps,\n SelectValue,\n} from './types';\n\nfunction Select<Value extends SelectValue>(\n props: SelectProps<Value>,\n ref: Ref<HTMLDivElement | HTMLSelectElement>\n) {\n const {\n children,\n value,\n className,\n disabled,\n onChange,\n placeholder,\n width,\n required,\n onClick,\n } = props;\n\n if (props.native) {\n return (\n <NativeSelect\n disabled={disabled}\n className={className}\n onClick={onClick}\n onChange={(e) => {\n onChange?.(e.target.value as Value, e.target.innerText);\n }}\n value={value}\n required={required}\n placeholder={placeholder}\n width={width}\n ref={ref as Ref<HTMLSelectElement>}\n >\n {Children.map(children, (child) => (\n <NativeOption {...child.props} />\n ))}\n </NativeSelect>\n );\n }\n\n return (\n <DesignedSelect\n className={className}\n value={value}\n disabled={disabled}\n onClick={onClick}\n onChange={(_value, _label) => onChange?.(_value as Value, _label)}\n placeholder={placeholder}\n width={width}\n maxHeight={props.maxHeight}\n extendDirection={props.extendDirection}\n ref={ref as Ref<HTMLDivElement>}\n >\n {children}\n </DesignedSelect>\n );\n}\n\nexport default Object.assign(\n forwardRef(Select) as <Value extends SelectValue>(\n props:\n | (DesignedSelectProps<Value> & RefAttributes<HTMLDivElement>)\n | (NativeSelectProps<Value> & RefAttributes<HTMLSelectElement>)\n ) => JSX.Element,\n { Option: OptionHolder }\n);\n"],"names":["disabled","className","onClick","onChange","value","required","placeholder","width","ref","children","Option"],"mappings":";;;;;;;;;AAAa;AAAA;AAgBb;AAIE;;;;;;;;;;;AAeMA;AACAC;AACAC;AACAC;AACEA;;AAEFC;AACAC;AACAC;AACAC;AACAC;;;;AAIE;AAGR;;AAIIP;AACAG;AACAJ;AACAE;AACAC;;;AACAG;AACAC;;;AAGAC;AAAgCC;AAEvB;AAGf;AAEA;AAMIC;AAAqB;;"}
|
|
@@ -10,7 +10,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
10
10
|
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefault(_taggedTemplateLiteral);
|
|
11
11
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
12
12
|
|
|
13
|
-
var _templateObject
|
|
13
|
+
var _templateObject;
|
|
14
14
|
var SelectContainer = styled__default.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral__default.default(["\n ", "\n color: ", ";\n width: ", ";\n position: relative;\n user-select: none;\n\n &:focus {\n outline: none;\n border-color: ", ";\n }\n &[aria-disabled='true'] {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"])), mixin.getTypographyStyles('UIBody2'), mixin.contents000, function (_ref) {
|
|
15
15
|
var $width = _ref.$width;
|
|
16
16
|
if (!$width) {
|
|
@@ -21,8 +21,6 @@ var SelectContainer = styled__default.default.div(_templateObject || (_templateO
|
|
|
21
21
|
}
|
|
22
22
|
return $width;
|
|
23
23
|
}, mixin.contents000, mixin.contents200, mixin.contents300, mixin.bg200);
|
|
24
|
-
var SelectLabel = styled__default.default.label(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default.default(["\n ", "\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ", ";\n }\n"])), mixin.getTypographyStyles('SubTitle1'), mixin.roleRed);
|
|
25
24
|
|
|
26
25
|
exports.SelectContainer = SelectContainer;
|
|
27
|
-
exports.SelectLabel = SelectLabel;
|
|
28
26
|
//# sourceMappingURL=styles.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.cjs.js","sources":["../../../../src/Inputs/Select/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n getTypographyStyles,\n
|
|
1
|
+
{"version":3,"file":"styles.cjs.js","sources":["../../../../src/Inputs/Select/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n getTypographyStyles,\n} from '@remember-web/mixin';\nimport styled from 'styled-components';\n\nexport const SelectContainer = styled.div<{ $width?: number | string }>`\n ${getTypographyStyles('UIBody2')}\n color: ${contents000};\n width: ${({ $width }) => {\n if (!$width) {\n return 'fit-content';\n }\n\n if (typeof $width === 'number') {\n return `${$width}px`;\n }\n\n return $width;\n }};\n position: relative;\n user-select: none;\n\n &:focus {\n outline: none;\n border-color: ${contents000};\n }\n &[aria-disabled='true'] {\n color: ${contents200};\n border-color: ${contents300};\n background-color: ${bg200};\n }\n`;\n"],"names":[],"mappings":";;;;;;;;;;;;AAAa;AAWN;AAGoB;;AAErB;AACF;AAEA;;AAEA;AAEA;AACF;;"}
|
|
@@ -2,5 +2,4 @@
|
|
|
2
2
|
export declare const SelectContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
3
|
$width?: string | number | undefined;
|
|
4
4
|
}>>;
|
|
5
|
-
export declare const SelectLabel: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>>;
|
|
6
5
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/Select/styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/Select/styles.ts"],"names":[],"mappings":";AAWA,eAAO,MAAM,eAAe;;GA0B3B,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
3
|
-
import { getTypographyStyles, contents000, contents200, contents300, bg200
|
|
3
|
+
import { getTypographyStyles, contents000, contents200, contents300, bg200 } from '@remember-web/mixin';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
|
|
6
|
-
var _templateObject
|
|
6
|
+
var _templateObject;
|
|
7
7
|
var SelectContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n width: ", ";\n position: relative;\n user-select: none;\n\n &:focus {\n outline: none;\n border-color: ", ";\n }\n &[aria-disabled='true'] {\n color: ", ";\n border-color: ", ";\n background-color: ", ";\n }\n"])), getTypographyStyles('UIBody2'), contents000, function (_ref) {
|
|
8
8
|
var $width = _ref.$width;
|
|
9
9
|
if (!$width) {
|
|
@@ -14,7 +14,6 @@ var SelectContainer = styled.div(_templateObject || (_templateObject = _taggedTe
|
|
|
14
14
|
}
|
|
15
15
|
return $width;
|
|
16
16
|
}, contents000, contents200, contents300, bg200);
|
|
17
|
-
var SelectLabel = styled.label(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ", ";\n }\n"])), getTypographyStyles('SubTitle1'), roleRed);
|
|
18
17
|
|
|
19
|
-
export { SelectContainer
|
|
18
|
+
export { SelectContainer };
|
|
20
19
|
//# sourceMappingURL=styles.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.esm.js","sources":["../../../../src/Inputs/Select/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n getTypographyStyles,\n
|
|
1
|
+
{"version":3,"file":"styles.esm.js","sources":["../../../../src/Inputs/Select/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n getTypographyStyles,\n} from '@remember-web/mixin';\nimport styled from 'styled-components';\n\nexport const SelectContainer = styled.div<{ $width?: number | string }>`\n ${getTypographyStyles('UIBody2')}\n color: ${contents000};\n width: ${({ $width }) => {\n if (!$width) {\n return 'fit-content';\n }\n\n if (typeof $width === 'number') {\n return `${$width}px`;\n }\n\n return $width;\n }};\n position: relative;\n user-select: none;\n\n &:focus {\n outline: none;\n border-color: ${contents000};\n }\n &[aria-disabled='true'] {\n color: ${contents200};\n border-color: ${contents300};\n background-color: ${bg200};\n }\n`;\n"],"names":[],"mappings":";;;;;AAAa;AAWN;AAGoB;;AAErB;AACF;AAEA;;AAEA;AAEA;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,WAAW,IAAI,YAAY,CACrE,WAAW,CAAC,KAAK,CAAC,EAClB,OAAO,YAAY,CACpB,CAAC;AAEF,KAAK,eAAe,CAAC,KAAK,SAAS,WAAW,IAAI;IAChD,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS,WAAW,IAAI;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,WAAW,IAAI,YAAY,CACrE,WAAW,CAAC,KAAK,CAAC,EAClB,OAAO,YAAY,CACpB,CAAC;AAEF,KAAK,eAAe,CAAC,KAAK,SAAS,WAAW,IAAI;IAChD,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS,WAAW,IAAI;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,CACT,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,SAAS,KACnB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,WAAW,IACvD,eAAe,CAAC,KAAK,CAAC,GAAG;IACvB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACrC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAE7B,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,WAAW,IACrD,eAAe,CAAC,KAAK,CAAC,GAAG;IACvB,MAAM,EAAE,IAAI,CAAC;CACd,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAE7B,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,WAAW,IAC7C,mBAAmB,CAAC,KAAK,CAAC,GAC1B,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE7B,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,WAAW,IAAI;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
|
|
@@ -23,8 +23,8 @@ var InputContainer = styled__default.default.div(_templateObject3 || (_templateO
|
|
|
23
23
|
});
|
|
24
24
|
var InputDecorator = styled__default.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral__default.default(["\n flex-shrink: 0;\n /* Inline\uC694\uC18C\uAC00 \uB4E4\uC5B4\uC624\uBA74 \uAC15\uC81C\uB85C block\uC73C\uB85C \uCC98\uB9AC (\uC911\uC559\uC815\uB82C\uC744 \uC704\uD574) */\n > * {\n display: block;\n }\n"])));
|
|
25
25
|
var InputInner = styled__default.default.input(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral__default.default(["\n ", "\n color: ", ";\n\n display: block;\n flex-grow: 1;\n width: 100%;\n padding: 10px 0;\n border: 0;\n background-color: transparent;\n\n &:placeholder-shown {\n ", "\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &:focus {\n outline: none;\n }\n"])), mixin.getTypographyStyles('UIBody2'), mixin.contents000, mixin.ellipsis(), mixin.contents200);
|
|
26
|
-
var InputLabel = styled__default.default.label(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral__default.default(["\n ", "\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ", ";\n }\n"])), mixin.getTypographyStyles('
|
|
27
|
-
var InputError = styled__default.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral__default.default(["\n ", "\n color: ", ";\n\n margin-top: 8px;\n"])), mixin.getTypographyStyles('
|
|
26
|
+
var InputLabel = styled__default.default.label(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral__default.default(["\n ", "\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ", ";\n }\n"])), mixin.getTypographyStyles('Title2'), mixin.roleRed);
|
|
27
|
+
var InputError = styled__default.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral__default.default(["\n ", "\n color: ", ";\n\n margin-top: 8px;\n"])), mixin.getTypographyStyles('UIBody3'), mixin.roleRed);
|
|
28
28
|
var InputHintText = styled__default.default.span(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral__default.default(["\n ", "\n color: ", ";\n white-space: nowrap;\n"])), mixin.getTypographyStyles('UIBody2'), function (_ref3) {
|
|
29
29
|
var textColor = _ref3.textColor;
|
|
30
30
|
return textColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.cjs.js","sources":["../../../../src/Inputs/TextInput/styles.ts"],"sourcesContent":["'use client';\n\nimport type { ColorVariable } from '@remember-web/mixin';\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n ellipsis,\n getTypographyStyles,\n roleRed,\n} from '@remember-web/mixin';\nimport { formatUnit } from '@remember-web/shared';\nimport styled, { css } from 'styled-components';\n\nexport const InputWrapper = styled.div<{ $width?: string | number }>`\n ${({ $width }) =>\n $width &&\n css`\n width: ${formatUnit($width)};\n `};\n`;\n\nexport const InputContainer = styled.div<{\n disabled?: boolean;\n $hasError?: boolean;\n}>`\n display: flex;\n align-items: center;\n border: 1px solid ${contents300};\n border-radius: 4px;\n padding: 0 12px;\n gap: 8px;\n\n transition:\n border-color 0.2s,\n background-color 0.2s;\n\n ${({ $hasError, disabled }) => [\n $hasError\n ? css`\n border-color: ${roleRed};\n `\n : css`\n &:focus-within {\n border-color: ${contents000};\n }\n `,\n disabled &&\n css`\n background-color: ${bg200};\n `,\n ]}\n`;\n\nexport const InputDecorator = styled.div`\n flex-shrink: 0;\n /* Inline요소가 들어오면 강제로 block으로 처리 (중앙정렬을 위해) */\n > * {\n display: block;\n }\n`;\n\nexport const InputInner = styled.input`\n ${getTypographyStyles('UIBody2')}\n color: ${contents000};\n\n display: block;\n flex-grow: 1;\n width: 100%;\n padding: 10px 0;\n border: 0;\n background-color: transparent;\n\n &:placeholder-shown {\n ${ellipsis()}\n }\n\n &::placeholder {\n color: ${contents200};\n }\n\n &:focus {\n outline: none;\n }\n`;\n\nexport const InputLabel = styled.label`\n ${getTypographyStyles('
|
|
1
|
+
{"version":3,"file":"styles.cjs.js","sources":["../../../../src/Inputs/TextInput/styles.ts"],"sourcesContent":["'use client';\n\nimport type { ColorVariable } from '@remember-web/mixin';\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n ellipsis,\n getTypographyStyles,\n roleRed,\n} from '@remember-web/mixin';\nimport { formatUnit } from '@remember-web/shared';\nimport styled, { css } from 'styled-components';\n\nexport const InputWrapper = styled.div<{ $width?: string | number }>`\n ${({ $width }) =>\n $width &&\n css`\n width: ${formatUnit($width)};\n `};\n`;\n\nexport const InputContainer = styled.div<{\n disabled?: boolean;\n $hasError?: boolean;\n}>`\n display: flex;\n align-items: center;\n border: 1px solid ${contents300};\n border-radius: 4px;\n padding: 0 12px;\n gap: 8px;\n\n transition:\n border-color 0.2s,\n background-color 0.2s;\n\n ${({ $hasError, disabled }) => [\n $hasError\n ? css`\n border-color: ${roleRed};\n `\n : css`\n &:focus-within {\n border-color: ${contents000};\n }\n `,\n disabled &&\n css`\n background-color: ${bg200};\n `,\n ]}\n`;\n\nexport const InputDecorator = styled.div`\n flex-shrink: 0;\n /* Inline요소가 들어오면 강제로 block으로 처리 (중앙정렬을 위해) */\n > * {\n display: block;\n }\n`;\n\nexport const InputInner = styled.input`\n ${getTypographyStyles('UIBody2')}\n color: ${contents000};\n\n display: block;\n flex-grow: 1;\n width: 100%;\n padding: 10px 0;\n border: 0;\n background-color: transparent;\n\n &:placeholder-shown {\n ${ellipsis()}\n }\n\n &::placeholder {\n color: ${contents200};\n }\n\n &:focus {\n outline: none;\n }\n`;\n\nexport const InputLabel = styled.label`\n ${getTypographyStyles('Title2')}\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ${roleRed};\n }\n`;\n\nexport const InputError = styled.div`\n ${getTypographyStyles('UIBody3')}\n color: ${roleRed};\n\n margin-top: 8px;\n`;\n\nexport const InputHintText = styled.span<{ textColor?: ColorVariable }>`\n ${getTypographyStyles('UIBody2')}\n color: ${({ textColor }) => textColor};\n white-space: nowrap;\n`;\n\nexport const InputTogglePasswordVisibilityButton = styled.button`\n all: unset;\n appearance: none;\n cursor: pointer;\n flex-shrink: 0;\n\n & > svg {\n display: block;\n }\n`;\n"],"names":["InputWrapper","InputDecorator","InputTogglePasswordVisibilityButton"],"mappings":";;;;;;;;;;;;;AAAa;AAeAA;AACT;AAAS;AAIR;;AAkBD;;AAAsB;AAcvB;AAGUC;AAQN;;;;AA+CI;AAAY;AAAgB;AAI1BC;;;;;;;;;"}
|
|
@@ -16,8 +16,8 @@ var InputContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedT
|
|
|
16
16
|
});
|
|
17
17
|
var InputDecorator = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n flex-shrink: 0;\n /* Inline\uC694\uC18C\uAC00 \uB4E4\uC5B4\uC624\uBA74 \uAC15\uC81C\uB85C block\uC73C\uB85C \uCC98\uB9AC (\uC911\uC559\uC815\uB82C\uC744 \uC704\uD574) */\n > * {\n display: block;\n }\n"])));
|
|
18
18
|
var InputInner = styled.input(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n\n display: block;\n flex-grow: 1;\n width: 100%;\n padding: 10px 0;\n border: 0;\n background-color: transparent;\n\n &:placeholder-shown {\n ", "\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &:focus {\n outline: none;\n }\n"])), getTypographyStyles('UIBody2'), contents000, ellipsis(), contents200);
|
|
19
|
-
var InputLabel = styled.label(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", "\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ", ";\n }\n"])), getTypographyStyles('
|
|
20
|
-
var InputError = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n\n margin-top: 8px;\n"])), getTypographyStyles('
|
|
19
|
+
var InputLabel = styled.label(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n ", "\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ", ";\n }\n"])), getTypographyStyles('Title2'), roleRed);
|
|
20
|
+
var InputError = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n\n margin-top: 8px;\n"])), getTypographyStyles('UIBody3'), roleRed);
|
|
21
21
|
var InputHintText = styled.span(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n ", "\n color: ", ";\n white-space: nowrap;\n"])), getTypographyStyles('UIBody2'), function (_ref3) {
|
|
22
22
|
var textColor = _ref3.textColor;
|
|
23
23
|
return textColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.esm.js","sources":["../../../../src/Inputs/TextInput/styles.ts"],"sourcesContent":["'use client';\n\nimport type { ColorVariable } from '@remember-web/mixin';\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n ellipsis,\n getTypographyStyles,\n roleRed,\n} from '@remember-web/mixin';\nimport { formatUnit } from '@remember-web/shared';\nimport styled, { css } from 'styled-components';\n\nexport const InputWrapper = styled.div<{ $width?: string | number }>`\n ${({ $width }) =>\n $width &&\n css`\n width: ${formatUnit($width)};\n `};\n`;\n\nexport const InputContainer = styled.div<{\n disabled?: boolean;\n $hasError?: boolean;\n}>`\n display: flex;\n align-items: center;\n border: 1px solid ${contents300};\n border-radius: 4px;\n padding: 0 12px;\n gap: 8px;\n\n transition:\n border-color 0.2s,\n background-color 0.2s;\n\n ${({ $hasError, disabled }) => [\n $hasError\n ? css`\n border-color: ${roleRed};\n `\n : css`\n &:focus-within {\n border-color: ${contents000};\n }\n `,\n disabled &&\n css`\n background-color: ${bg200};\n `,\n ]}\n`;\n\nexport const InputDecorator = styled.div`\n flex-shrink: 0;\n /* Inline요소가 들어오면 강제로 block으로 처리 (중앙정렬을 위해) */\n > * {\n display: block;\n }\n`;\n\nexport const InputInner = styled.input`\n ${getTypographyStyles('UIBody2')}\n color: ${contents000};\n\n display: block;\n flex-grow: 1;\n width: 100%;\n padding: 10px 0;\n border: 0;\n background-color: transparent;\n\n &:placeholder-shown {\n ${ellipsis()}\n }\n\n &::placeholder {\n color: ${contents200};\n }\n\n &:focus {\n outline: none;\n }\n`;\n\nexport const InputLabel = styled.label`\n ${getTypographyStyles('
|
|
1
|
+
{"version":3,"file":"styles.esm.js","sources":["../../../../src/Inputs/TextInput/styles.ts"],"sourcesContent":["'use client';\n\nimport type { ColorVariable } from '@remember-web/mixin';\nimport {\n bg200,\n contents000,\n contents200,\n contents300,\n ellipsis,\n getTypographyStyles,\n roleRed,\n} from '@remember-web/mixin';\nimport { formatUnit } from '@remember-web/shared';\nimport styled, { css } from 'styled-components';\n\nexport const InputWrapper = styled.div<{ $width?: string | number }>`\n ${({ $width }) =>\n $width &&\n css`\n width: ${formatUnit($width)};\n `};\n`;\n\nexport const InputContainer = styled.div<{\n disabled?: boolean;\n $hasError?: boolean;\n}>`\n display: flex;\n align-items: center;\n border: 1px solid ${contents300};\n border-radius: 4px;\n padding: 0 12px;\n gap: 8px;\n\n transition:\n border-color 0.2s,\n background-color 0.2s;\n\n ${({ $hasError, disabled }) => [\n $hasError\n ? css`\n border-color: ${roleRed};\n `\n : css`\n &:focus-within {\n border-color: ${contents000};\n }\n `,\n disabled &&\n css`\n background-color: ${bg200};\n `,\n ]}\n`;\n\nexport const InputDecorator = styled.div`\n flex-shrink: 0;\n /* Inline요소가 들어오면 강제로 block으로 처리 (중앙정렬을 위해) */\n > * {\n display: block;\n }\n`;\n\nexport const InputInner = styled.input`\n ${getTypographyStyles('UIBody2')}\n color: ${contents000};\n\n display: block;\n flex-grow: 1;\n width: 100%;\n padding: 10px 0;\n border: 0;\n background-color: transparent;\n\n &:placeholder-shown {\n ${ellipsis()}\n }\n\n &::placeholder {\n color: ${contents200};\n }\n\n &:focus {\n outline: none;\n }\n`;\n\nexport const InputLabel = styled.label`\n ${getTypographyStyles('Title2')}\n display: block;\n margin-bottom: 12px;\n display: flex;\n align-items: center;\n gap: 4px;\n\n & > mark {\n all: unset;\n color: ${roleRed};\n }\n`;\n\nexport const InputError = styled.div`\n ${getTypographyStyles('UIBody3')}\n color: ${roleRed};\n\n margin-top: 8px;\n`;\n\nexport const InputHintText = styled.span<{ textColor?: ColorVariable }>`\n ${getTypographyStyles('UIBody2')}\n color: ${({ textColor }) => textColor};\n white-space: nowrap;\n`;\n\nexport const InputTogglePasswordVisibilityButton = styled.button`\n all: unset;\n appearance: none;\n cursor: pointer;\n flex-shrink: 0;\n\n & > svg {\n display: block;\n }\n`;\n"],"names":["InputWrapper","InputDecorator","InputTogglePasswordVisibilityButton"],"mappings":";;;;;;AAAa;AAeAA;AACT;AAAS;AAIR;;AAkBD;;AAAsB;AAcvB;AAGUC;AAQN;;;;AA+CI;AAAY;AAAgB;AAI1BC;;"}
|
|
@@ -3,6 +3,9 @@ import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
|
3
3
|
type BaseInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, `aria-${string}`>;
|
|
4
4
|
type TextInputProps = {
|
|
5
5
|
type?: 'text' | 'number' | 'email' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Label 컴포넌트를 사용해 주세요.
|
|
8
|
+
*/
|
|
6
9
|
label?: ReactNode;
|
|
7
10
|
hintText?: string;
|
|
8
11
|
hintTextColor?: ColorVariable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/TextInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,KAAK,cAAc,GAAG,IAAI,CACxB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,QAAQ,MAAM,EAAE,CACjB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EACD,MAAM,GACN,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,KAAK,GACL,KAAK,GACL,MAAM,GACN,gBAAgB,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IACvD,IAAI,EAAE,UAAU,CAAC;IACjB,iCAAiC,EAAE,OAAO,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,CAAC,cAAc,GAAG,kBAAkB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Inputs/TextInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,KAAK,cAAc,GAAG,IAAI,CACxB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,QAAQ,MAAM,EAAE,CACjB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EACD,MAAM,GACN,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,KAAK,GACL,KAAK,GACL,MAAM,GACN,gBAAgB,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IACvD,IAAI,EAAE,UAAU,CAAC;IACjB,iCAAiC,EAAE,OAAO,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,CAAC,cAAc,GAAG,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
require('../../Common/Divider/index.cjs.js');
|
|
6
|
+
var index = require('../../Common/Flex/index.cjs.js');
|
|
7
|
+
require('../../Common/Grid/index.cjs.js');
|
|
8
|
+
var icon = require('@remember-web/icon');
|
|
9
|
+
require('../../Common/Spinner/styles.cjs.js');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
var react = require('react');
|
|
12
|
+
require('../../Common/Skeleton/styles.cjs.js');
|
|
13
|
+
require('../../Common/Typography/styles.cjs.js');
|
|
14
|
+
var styles = require('./styles.cjs.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
|
|
18
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
|
|
19
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);
|
|
20
|
+
|
|
21
|
+
var _excluded = ["text", "children", "direction", "size", "gap", "width", "rightElement", "required", "className"];
|
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
var Label = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
25
|
+
var text = _ref.text,
|
|
26
|
+
children = _ref.children,
|
|
27
|
+
_ref$direction = _ref.direction,
|
|
28
|
+
direction = _ref$direction === void 0 ? 'top-left' : _ref$direction,
|
|
29
|
+
_ref$size = _ref.size,
|
|
30
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
31
|
+
gap = _ref.gap,
|
|
32
|
+
width = _ref.width,
|
|
33
|
+
rightElement = _ref.rightElement,
|
|
34
|
+
required = _ref.required,
|
|
35
|
+
className = _ref.className,
|
|
36
|
+
props = _objectWithoutProperties__default.default(_ref, _excluded);
|
|
37
|
+
return /*#__PURE__*/jsxRuntime.jsxs(styles.LabelContainer, _objectSpread(_objectSpread({
|
|
38
|
+
ref: ref,
|
|
39
|
+
$size: size,
|
|
40
|
+
className: className,
|
|
41
|
+
$direction: direction,
|
|
42
|
+
$gap: gap,
|
|
43
|
+
$width: width
|
|
44
|
+
}, props), {}, {
|
|
45
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(index.Flex, {
|
|
46
|
+
gap: 4,
|
|
47
|
+
children: [text, /*#__PURE__*/jsxRuntime.jsxs(index.Flex, {
|
|
48
|
+
children: [rightElement, required && /*#__PURE__*/jsxRuntime.jsx(index.Flex, {
|
|
49
|
+
className: "required-icon",
|
|
50
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icon.IconRequiredS, {})
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
}), children]
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
module.exports = Label;
|
|
58
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Labels/Label/index.tsx"],"sourcesContent":["import { Flex } from '@/Common';\nimport { IconRequiredS } from '@remember-web/icon';\nimport { forwardRef } from 'react';\nimport { LabelContainer } from './styles';\nimport type { LabelProps } from './types';\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n (\n {\n text,\n children,\n direction = 'top-left',\n size = 'small',\n gap,\n width,\n rightElement,\n required,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <LabelContainer\n ref={ref}\n $size={size}\n className={className}\n $direction={direction}\n $gap={gap}\n $width={width}\n {...props}\n >\n <Flex gap={4}>\n {text}\n <Flex>\n {rightElement}\n {required && (\n <Flex className=\"required-icon\">\n <IconRequiredS />\n </Flex>\n )}\n </Flex>\n </Flex>\n {children}\n </LabelContainer>\n );\n }\n);\n\nexport default Label;\n"],"names":["Label","forwardRef","_ref","ref","text","children","_ref$direction","direction","_ref$size","size","gap","width","rightElement","required","className","props","_objectWithoutProperties","_excluded","_jsxs","LabelContainer","_objectSpread","$size","$direction","$gap","$width","Flex","_jsx","IconRequiredS"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAMMA,IAAAA,KAAK,gBAAGC,gBAAU,CACtB,UAAAC,IAAA,EAaEC,GAAG,EACA;AAAA,EAAA,IAZDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAAC,cAAA,GAAAJ,IAAA,CACRK,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,UAAU,GAAAA,cAAA;IAAAE,SAAA,GAAAN,IAAA,CACtBO,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,SAAA;IACdE,GAAG,GAAAR,IAAA,CAAHQ,GAAG;IACHC,KAAK,GAAAT,IAAA,CAALS,KAAK;IACLC,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,QAAQ,GAAAX,IAAA,CAARW,QAAQ;IACRC,SAAS,GAAAZ,IAAA,CAATY,SAAS;AACNC,IAAAA,KAAK,GAAAC,yCAAA,CAAAd,IAAA,EAAAe,SAAA,CAAA,CAAA;AAIV,EAAA,oBACEC,eAAA,CAACC,qBAAc,EAAAC,aAAA,CAAAA,aAAA,CAAA;AACbjB,IAAAA,GAAG,EAAEA,GAAI;AACTkB,IAAAA,KAAK,EAAEZ,IAAK;AACZK,IAAAA,SAAS,EAAEA,SAAU;AACrBQ,IAAAA,UAAU,EAAEf,SAAU;AACtBgB,IAAAA,IAAI,EAAEb,GAAI;AACVc,IAAAA,MAAM,EAAEb,KAAAA;AAAM,GAAA,EACVI,KAAK,CAAA,EAAA,EAAA,EAAA;IAAAV,QAAA,EAAA,cAETa,eAAA,CAACO,UAAI,EAAA;AAACf,MAAAA,GAAG,EAAE,CAAE;AAAAL,MAAAA,QAAA,EACVD,CAAAA,IAAI,eACLc,eAAA,CAACO,UAAI,EAAA;AAAApB,QAAAA,QAAA,GACFO,YAAY,EACZC,QAAQ,iBACPa,cAAA,CAACD,UAAI,EAAA;AAACX,UAAAA,SAAS,EAAC,eAAe;AAAAT,UAAAA,QAAA,eAC7BqB,cAAA,CAACC,kBAAa,EAAE,EAAA,CAAA;AAAC,SACb,CACP,CAAA;AAAA,OACG,CAAC,CAAA;KACH,CAAC,EACNtB,QAAQ,CAAA;AAAA,GAAA,CACK,CAAC,CAAA;AAErB,CACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Labels/Label/index.tsx"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,QAAA,MAAM,KAAK,yGAyCV,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import '../../Common/Divider/index.esm.js';
|
|
4
|
+
import { Flex } from '../../Common/Flex/index.esm.js';
|
|
5
|
+
import '../../Common/Grid/index.esm.js';
|
|
6
|
+
import { IconRequiredS } from '@remember-web/icon';
|
|
7
|
+
import '../../Common/Spinner/styles.esm.js';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
import { forwardRef } from 'react';
|
|
10
|
+
import '../../Common/Skeleton/styles.esm.js';
|
|
11
|
+
import '../../Common/Typography/styles.esm.js';
|
|
12
|
+
import { LabelContainer } from './styles.esm.js';
|
|
13
|
+
|
|
14
|
+
var _excluded = ["text", "children", "direction", "size", "gap", "width", "rightElement", "required", "className"];
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
var Label = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
|
+
var text = _ref.text,
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
_ref$direction = _ref.direction,
|
|
21
|
+
direction = _ref$direction === void 0 ? 'top-left' : _ref$direction,
|
|
22
|
+
_ref$size = _ref.size,
|
|
23
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
24
|
+
gap = _ref.gap,
|
|
25
|
+
width = _ref.width,
|
|
26
|
+
rightElement = _ref.rightElement,
|
|
27
|
+
required = _ref.required,
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
return /*#__PURE__*/jsxs(LabelContainer, _objectSpread(_objectSpread({
|
|
31
|
+
ref: ref,
|
|
32
|
+
$size: size,
|
|
33
|
+
className: className,
|
|
34
|
+
$direction: direction,
|
|
35
|
+
$gap: gap,
|
|
36
|
+
$width: width
|
|
37
|
+
}, props), {}, {
|
|
38
|
+
children: [/*#__PURE__*/jsxs(Flex, {
|
|
39
|
+
gap: 4,
|
|
40
|
+
children: [text, /*#__PURE__*/jsxs(Flex, {
|
|
41
|
+
children: [rightElement, required && /*#__PURE__*/jsx(Flex, {
|
|
42
|
+
className: "required-icon",
|
|
43
|
+
children: /*#__PURE__*/jsx(IconRequiredS, {})
|
|
44
|
+
})]
|
|
45
|
+
})]
|
|
46
|
+
}), children]
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { Label as default };
|
|
51
|
+
//# sourceMappingURL=index.esm.js.map
|