@remember-web/primitive 0.1.18 → 0.1.19
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/Buttons/Button/index.cjs.js +5 -6
- package/dist/src/Buttons/Button/index.cjs.js.map +1 -1
- package/dist/src/Buttons/Button/index.d.ts +3 -8
- package/dist/src/Buttons/Button/index.d.ts.map +1 -1
- package/dist/src/Buttons/Button/index.esm.js +3 -4
- package/dist/src/Buttons/Button/index.esm.js.map +1 -1
- package/dist/src/Buttons/Button/styles.cjs.js +1 -1
- package/dist/src/Buttons/Button/styles.cjs.js.map +1 -1
- package/dist/src/Buttons/Button/styles.d.ts +1 -2
- package/dist/src/Buttons/Button/styles.d.ts.map +1 -1
- package/dist/src/Buttons/Button/styles.esm.js +1 -1
- package/dist/src/Buttons/Button/styles.esm.js.map +1 -1
- package/dist/src/Buttons/Button/types.d.ts +4 -6
- package/dist/src/Buttons/Button/types.d.ts.map +1 -1
- package/dist/src/Common/Flex/index.cjs.js +8 -7
- package/dist/src/Common/Flex/index.cjs.js.map +1 -1
- package/dist/src/Common/Flex/index.d.ts +5 -4
- package/dist/src/Common/Flex/index.d.ts.map +1 -1
- package/dist/src/Common/Flex/index.esm.js +8 -7
- package/dist/src/Common/Flex/index.esm.js.map +1 -1
- package/dist/src/Common/Grid/index.cjs.js +1 -0
- package/dist/src/Common/Grid/index.cjs.js.map +1 -1
- package/dist/src/Common/Grid/index.d.ts +1 -0
- package/dist/src/Common/Grid/index.d.ts.map +1 -1
- package/dist/src/Common/Grid/index.esm.js +1 -0
- package/dist/src/Common/Grid/index.esm.js.map +1 -1
- package/dist/src/Common/Typography/index.cjs.js +4 -7
- package/dist/src/Common/Typography/index.cjs.js.map +1 -1
- package/dist/src/Common/Typography/index.d.ts +6 -9
- package/dist/src/Common/Typography/index.d.ts.map +1 -1
- package/dist/src/Common/Typography/index.esm.js +4 -7
- package/dist/src/Common/Typography/index.esm.js.map +1 -1
- package/dist/src/Common/index.d.ts +1 -1
- package/dist/src/Common/index.d.ts.map +1 -1
- package/dist/src/Modals/Dialog/index.cjs.js +1 -1
- package/dist/src/Modals/Dialog/index.cjs.js.map +1 -1
- package/dist/src/Modals/Dialog/index.esm.js +1 -1
- package/dist/src/Modals/Dialog/index.esm.js.map +1 -1
- package/dist/src/Paginations/CompactPagination/index.cjs.js +1 -1
- package/dist/src/Paginations/CompactPagination/index.cjs.js.map +1 -1
- package/dist/src/Paginations/CompactPagination/index.esm.js +1 -1
- package/dist/src/Paginations/CompactPagination/index.esm.js.map +1 -1
- package/dist/src/index.cjs.js +6 -6
- package/dist/src/index.esm.js +1 -1
- package/package.json +2 -2
- package/src/Buttons/Button/Button.stories.tsx +1 -1
- package/src/Buttons/Button/index.tsx +32 -39
- package/src/Buttons/Button/styles.ts +2 -3
- package/src/Buttons/Button/types.ts +6 -12
- package/src/Common/Divider/Divider.stories.tsx +1 -1
- package/src/Common/Flex/index.tsx +29 -28
- package/src/Common/Grid/index.tsx +1 -0
- package/src/Common/Typography/index.tsx +24 -37
- package/src/Common/index.ts +1 -1
- package/src/Modals/Dialog/index.tsx +1 -1
- package/src/Paginations/CompactPagination/index.tsx +1 -1
|
@@ -7,7 +7,7 @@ var react = require('react');
|
|
|
7
7
|
require('../../Common/Divider/index.cjs.js');
|
|
8
8
|
require('../../Common/Flex/index.cjs.js');
|
|
9
9
|
require('../../Common/Grid/index.cjs.js');
|
|
10
|
-
var index
|
|
10
|
+
var index = require('../../Common/Spinner/index.cjs.js');
|
|
11
11
|
require('../../Common/Typography/styles.cjs.js');
|
|
12
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
13
13
|
var _const = require('./const.cjs.js');
|
|
@@ -21,7 +21,7 @@ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWith
|
|
|
21
21
|
var _excluded = ["children", "color", "size", "variant", "layout", "isLoading", "filled", "icon", "iconPosition"];
|
|
22
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
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 Button = function
|
|
24
|
+
var Button = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
25
25
|
var children = _ref.children,
|
|
26
26
|
color = _ref.color,
|
|
27
27
|
_ref$size = _ref.size,
|
|
@@ -49,14 +49,13 @@ var Button = function Button(_ref, ref) {
|
|
|
49
49
|
"aria-busy": isLoading,
|
|
50
50
|
ref: ref
|
|
51
51
|
}, props), {}, {
|
|
52
|
-
children: isLoading ? /*#__PURE__*/jsxRuntime.jsx(index
|
|
52
|
+
children: isLoading ? /*#__PURE__*/jsxRuntime.jsx(index.Spinner, {
|
|
53
53
|
size: _const.SPINNER_SIZE_MAP[size]
|
|
54
54
|
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
55
55
|
children: [iconPosition === 'left' && icon, children, iconPosition === 'right' && icon]
|
|
56
56
|
})
|
|
57
57
|
}));
|
|
58
|
-
};
|
|
59
|
-
var index = /*#__PURE__*/react.forwardRef(Button);
|
|
58
|
+
});
|
|
60
59
|
|
|
61
|
-
module.exports =
|
|
60
|
+
module.exports = Button;
|
|
62
61
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Buttons/Button/index.tsx"],"sourcesContent":["'use client';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Buttons/Button/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ForwardedRef } from 'react';\nimport { forwardRef } from 'react';\nimport { type PolymorphicComponent } from 'styled-components';\n\nimport { Spinner } from '@/Common';\n\nimport { SPINNER_SIZE_MAP } from './const';\nimport { StyledButton } from './styles';\nimport type { ButtonProps } from './types';\n\nconst Button = forwardRef(function (\n {\n children,\n color,\n size = 'small',\n variant = 'primary',\n layout = 'block',\n isLoading = false,\n filled = variant === 'primary',\n icon,\n iconPosition = 'left',\n ...props\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement | null>\n) {\n return (\n <StyledButton\n $color={color}\n $size={size}\n $variant={variant}\n $layout={layout}\n $isLoading={isLoading}\n $filled={filled}\n aria-live=\"polite\"\n aria-busy={isLoading}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Spinner size={SPINNER_SIZE_MAP[size]} />\n ) : (\n <>\n {iconPosition === 'left' && icon}\n {children}\n {iconPosition === 'right' && icon}\n </>\n )}\n </StyledButton>\n );\n}) as PolymorphicComponent<'web', ButtonProps>;\n\nexport default Button;\n"],"names":["Button","size","variant","layout","isLoading","filled","iconPosition","props","$color","$size","$variant","$layout","$isLoading","$filled","ref","children"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAa;AAAA;AAAA;AAYPA;AAcJ;;;AAVEC;;AACAC;;AACAC;;AACAC;;AACAC;;;AAEAC;AACGC;AAIL;AAEIC;AACAC;AACAC;AACAC;AACAC;AACAC;AACA;AACA;AACAC;AAAS;AACAC;;AAG+B;AAEtCA;;AAKD;AAGP;;"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PolymorphicComponent } from 'styled-components';
|
|
2
2
|
import type { ButtonProps } from './types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} & ButtonProps<T> & {
|
|
6
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
7
|
-
}) => React.ReactElement | null;
|
|
8
|
-
declare const _default: ButtonComponentWithRef;
|
|
9
|
-
export default _default;
|
|
3
|
+
declare const Button: PolymorphicComponent<"web", ButtonProps>;
|
|
4
|
+
export default Button;
|
|
10
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Buttons/Button/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Buttons/Button/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAM9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,QAAA,MAAM,MAAM,0CAuCkC,CAAC;AAE/C,eAAe,MAAM,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { StyledButton } from './styles.esm.js';
|
|
|
14
14
|
var _excluded = ["children", "color", "size", "variant", "layout", "isLoading", "filled", "icon", "iconPosition"];
|
|
15
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
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 Button = function
|
|
17
|
+
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
18
|
var children = _ref.children,
|
|
19
19
|
color = _ref.color,
|
|
20
20
|
_ref$size = _ref.size,
|
|
@@ -48,8 +48,7 @@ var Button = function Button(_ref, ref) {
|
|
|
48
48
|
children: [iconPosition === 'left' && icon, children, iconPosition === 'right' && icon]
|
|
49
49
|
})
|
|
50
50
|
}));
|
|
51
|
-
};
|
|
52
|
-
var index = /*#__PURE__*/forwardRef(Button);
|
|
51
|
+
});
|
|
53
52
|
|
|
54
|
-
export {
|
|
53
|
+
export { Button as default };
|
|
55
54
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Buttons/Button/index.tsx"],"sourcesContent":["'use client';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Buttons/Button/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ForwardedRef } from 'react';\nimport { forwardRef } from 'react';\nimport { type PolymorphicComponent } from 'styled-components';\n\nimport { Spinner } from '@/Common';\n\nimport { SPINNER_SIZE_MAP } from './const';\nimport { StyledButton } from './styles';\nimport type { ButtonProps } from './types';\n\nconst Button = forwardRef(function (\n {\n children,\n color,\n size = 'small',\n variant = 'primary',\n layout = 'block',\n isLoading = false,\n filled = variant === 'primary',\n icon,\n iconPosition = 'left',\n ...props\n }: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement | null>\n) {\n return (\n <StyledButton\n $color={color}\n $size={size}\n $variant={variant}\n $layout={layout}\n $isLoading={isLoading}\n $filled={filled}\n aria-live=\"polite\"\n aria-busy={isLoading}\n ref={ref}\n {...props}\n >\n {isLoading ? (\n <Spinner size={SPINNER_SIZE_MAP[size]} />\n ) : (\n <>\n {iconPosition === 'left' && icon}\n {children}\n {iconPosition === 'right' && icon}\n </>\n )}\n </StyledButton>\n );\n}) as PolymorphicComponent<'web', ButtonProps>;\n\nexport default Button;\n"],"names":["Button","size","variant","layout","isLoading","filled","iconPosition","props","$color","$size","$variant","$layout","$isLoading","$filled","ref","children"],"mappings":";;;;;;;;;;;;;AAAa;AAAA;AAAA;AAYPA;AAcJ;;;AAVEC;;AACAC;;AACAC;;AACAC;;AACAC;;;AAEAC;AACGC;AAIL;AAEIC;AACAC;AACAC;AACAC;AACAC;AACAC;AACA;AACA;AACAC;AAAS;AACAC;;AAG+B;AAEtCA;;AAKD;AAGP;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
-
var styled = require('styled-components');
|
|
7
6
|
var mixin = require('@remember-web/mixin');
|
|
7
|
+
var styled = require('styled-components');
|
|
8
8
|
var _const = require('./const.cjs.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.cjs.js","sources":["../../../../src/Buttons/Button/styles.ts"],"sourcesContent":["'use client';\n\nimport
|
|
1
|
+
{"version":3,"file":"styles.cjs.js","sources":["../../../../src/Buttons/Button/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg100,\n disabled,\n getTypographyStyles,\n primary100,\n primary200,\n} from '@remember-web/mixin';\nimport styled, { css } from 'styled-components';\n\nimport { BUTTON_COLORS, BUTTON_SIZES, ICON_GAP_MAP } from './const';\nimport type { ButtonStyleProps } from './types';\n\nexport const StyledButton = styled.button<ButtonStyleProps>(\n ({ $size, $layout, $color, ...props }) => [\n // 공용 스타일\n css`\n all: unset;\n appearance: none;\n\n box-sizing: border-box;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n\n display: ${$layout === 'inline' ? 'inline-flex' : 'flex'};\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n gap: ${ICON_GAP_MAP[$size]};\n\n ${getTypographyStyles(BUTTON_SIZES[$size].typography)}\n text-align: center;\n\n width: fit-content;\n ${$layout === 'fullBlock' && `width: 100%;`}\n min-width: ${BUTTON_SIZES[$size].minWidth};\n height: ${BUTTON_SIZES[$size].height};\n padding: ${BUTTON_SIZES[$size].padding};\n border-radius: 4px;\n\n color: ${(props.$variant.startsWith('outline') ? $color : null) ??\n BUTTON_COLORS[props.$variant].color};\n\n &:focus-visible:not(:disabled) {\n outline: 2px solid ${primary100};\n outline-offset: 2px;\n }\n\n &:disabled {\n cursor: not-allowed;\n\n &::before {\n display: none;\n }\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${primary200};\n opacity: 0;\n pointer-events: none;\n\n transition: opacity 0.2s;\n }\n @media (hover: hover) {\n &:hover::before {\n opacity: 0.1;\n }\n }\n &:active::before {\n opacity: 0.2;\n }\n `,\n\n // primary 스타일\n props.$variant === 'primary' &&\n css`\n background-color: ${$color ??\n BUTTON_COLORS[props.$variant].backgroundColor};\n &:disabled {\n background-color: ${disabled};\n }\n &::before {\n background-color: ${primary200};\n }\n `,\n\n // outline 스타일\n props.$variant === 'outline' &&\n css`\n background-color: ${props.$filled\n ? bg100\n : BUTTON_COLORS[props.$variant].backgroundColor};\n border: 1px solid ${$color ?? BUTTON_COLORS[props.$variant].borderColor};\n &:disabled {\n border-color: ${disabled};\n color: ${disabled};\n }\n &::before {\n background-color: ${$color ?? primary100};\n }\n `,\n ]\n);\n"],"names":["props","css"],"mappings":";;;;;;;;;;;;;;;AAAa;AAAA;AAcN;AACL;AAAA;;;AAA8BA;AAAK;AAEjCC;AAmEA;AACAD;AAYA;;AAeD;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { DataAttributes } from 'styled-components';
|
|
3
2
|
import type { ButtonStyleProps } from './types';
|
|
4
|
-
export declare const StyledButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonStyleProps
|
|
3
|
+
export declare const StyledButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonStyleProps>>;
|
|
5
4
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/Buttons/Button/styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/Buttons/Button/styles.ts"],"names":[],"mappings":";AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,YAAY,yOAmGxB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
-
import styled, { css } from 'styled-components';
|
|
5
4
|
import { getTypographyStyles, primary100, primary200, disabled, bg100 } from '@remember-web/mixin';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
6
|
import { ICON_GAP_MAP, BUTTON_SIZES, BUTTON_COLORS } from './const.esm.js';
|
|
7
7
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.esm.js","sources":["../../../../src/Buttons/Button/styles.ts"],"sourcesContent":["'use client';\n\nimport
|
|
1
|
+
{"version":3,"file":"styles.esm.js","sources":["../../../../src/Buttons/Button/styles.ts"],"sourcesContent":["'use client';\n\nimport {\n bg100,\n disabled,\n getTypographyStyles,\n primary100,\n primary200,\n} from '@remember-web/mixin';\nimport styled, { css } from 'styled-components';\n\nimport { BUTTON_COLORS, BUTTON_SIZES, ICON_GAP_MAP } from './const';\nimport type { ButtonStyleProps } from './types';\n\nexport const StyledButton = styled.button<ButtonStyleProps>(\n ({ $size, $layout, $color, ...props }) => [\n // 공용 스타일\n css`\n all: unset;\n appearance: none;\n\n box-sizing: border-box;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n\n display: ${$layout === 'inline' ? 'inline-flex' : 'flex'};\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n gap: ${ICON_GAP_MAP[$size]};\n\n ${getTypographyStyles(BUTTON_SIZES[$size].typography)}\n text-align: center;\n\n width: fit-content;\n ${$layout === 'fullBlock' && `width: 100%;`}\n min-width: ${BUTTON_SIZES[$size].minWidth};\n height: ${BUTTON_SIZES[$size].height};\n padding: ${BUTTON_SIZES[$size].padding};\n border-radius: 4px;\n\n color: ${(props.$variant.startsWith('outline') ? $color : null) ??\n BUTTON_COLORS[props.$variant].color};\n\n &:focus-visible:not(:disabled) {\n outline: 2px solid ${primary100};\n outline-offset: 2px;\n }\n\n &:disabled {\n cursor: not-allowed;\n\n &::before {\n display: none;\n }\n }\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ${primary200};\n opacity: 0;\n pointer-events: none;\n\n transition: opacity 0.2s;\n }\n @media (hover: hover) {\n &:hover::before {\n opacity: 0.1;\n }\n }\n &:active::before {\n opacity: 0.2;\n }\n `,\n\n // primary 스타일\n props.$variant === 'primary' &&\n css`\n background-color: ${$color ??\n BUTTON_COLORS[props.$variant].backgroundColor};\n &:disabled {\n background-color: ${disabled};\n }\n &::before {\n background-color: ${primary200};\n }\n `,\n\n // outline 스타일\n props.$variant === 'outline' &&\n css`\n background-color: ${props.$filled\n ? bg100\n : BUTTON_COLORS[props.$variant].backgroundColor};\n border: 1px solid ${$color ?? BUTTON_COLORS[props.$variant].borderColor};\n &:disabled {\n border-color: ${disabled};\n color: ${disabled};\n }\n &::before {\n background-color: ${$color ?? primary100};\n }\n `,\n ]\n);\n"],"names":["props","css"],"mappings":";;;;;;;AAAa;AAAA;AAcN;AACL;AAAA;;;AAA8BA;AAAK;AAEjCC;AAmEA;AACAD;AAYA;;AAeD;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ElementType } from 'react';
|
|
2
|
-
import type { ConvertTransientProps } from '@remember-web/shared';
|
|
3
1
|
import type { ColorVariable } from '@remember-web/mixin';
|
|
2
|
+
import type { ConvertTransientProps } from '@remember-web/shared';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
4
|
export type ButtonSize = 'small' | 'medium' | 'large' | 'xLarge';
|
|
5
5
|
export type ButtonVariant = 'primary' | 'outline';
|
|
6
6
|
export type ButtonLayout = 'inline' | 'block' | 'fullBlock';
|
|
@@ -13,10 +13,8 @@ export interface ButtonStyleProps {
|
|
|
13
13
|
$isLoading: boolean;
|
|
14
14
|
$filled?: boolean;
|
|
15
15
|
}
|
|
16
|
-
type
|
|
17
|
-
export type ButtonProps<AsT extends ElementType> = Omit<React.ComponentPropsWithoutRef<AsT>, keyof ButtonStyleProps | 'icon' | 'iconPosition'> & ConvertProps & {
|
|
16
|
+
export type ButtonProps = ConvertTransientProps<Partial<ButtonStyleProps>> & {
|
|
18
17
|
icon?: React.ReactNode;
|
|
19
18
|
iconPosition?: 'left' | 'right';
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
19
|
+
} & ComponentProps<'button'>;
|
|
22
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Buttons/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/Buttons/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,qBAAqB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG;IAC3E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
7
|
+
var react = require('react');
|
|
7
8
|
var styled = require('styled-components');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
|
|
@@ -14,7 +15,7 @@ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWith
|
|
|
14
15
|
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefault(_taggedTemplateLiteral);
|
|
15
16
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
16
17
|
|
|
17
|
-
var _excluded = ["
|
|
18
|
+
var _excluded = ["width", "height", "direction", "gap", "align", "justify", "wrap"];
|
|
18
19
|
var _templateObject;
|
|
19
20
|
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; }
|
|
20
21
|
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; }
|
|
@@ -45,9 +46,9 @@ var StyledFlex = styled__default.default.div(function (_ref) {
|
|
|
45
46
|
* @prop {CSSProperties['flexDirection']} direction
|
|
46
47
|
* @prop {CSSProperties['flexWrap']} wrap
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
|
|
50
|
+
var Flex = /*#__PURE__*/react.forwardRef(function (_ref2, ref) {
|
|
51
|
+
var width = _ref2.width,
|
|
51
52
|
height = _ref2.height,
|
|
52
53
|
direction = _ref2.direction,
|
|
53
54
|
gap = _ref2.gap,
|
|
@@ -56,7 +57,7 @@ var Flex = function Flex(_ref2) {
|
|
|
56
57
|
wrap = _ref2.wrap,
|
|
57
58
|
props = _objectWithoutProperties__default.default(_ref2, _excluded);
|
|
58
59
|
return /*#__PURE__*/jsxRuntime.jsx(StyledFlex, _objectSpread({
|
|
59
|
-
|
|
60
|
+
ref: ref,
|
|
60
61
|
$width: width,
|
|
61
62
|
$height: height,
|
|
62
63
|
$direction: direction,
|
|
@@ -65,7 +66,7 @@ var Flex = function Flex(_ref2) {
|
|
|
65
66
|
$justify: justify,
|
|
66
67
|
$wrap: wrap
|
|
67
68
|
}, props));
|
|
68
|
-
};
|
|
69
|
+
});
|
|
69
70
|
|
|
70
|
-
exports
|
|
71
|
+
module.exports = Flex;
|
|
71
72
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Common/Flex/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Common/Flex/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ConvertTransientProps } from '@remember-web/shared';\nimport type { CSSProperties, ComponentProps, ForwardedRef } from 'react';\nimport { forwardRef } from 'react';\nimport type { PolymorphicComponent } from 'styled-components';\nimport styled, { css } from 'styled-components';\n\nexport interface FlexStyledProps extends ComponentProps<'div'> {\n $align?: CSSProperties['alignItems'];\n $direction?: CSSProperties['flexDirection'];\n $justify?: CSSProperties['justifyContent'];\n $wrap?: CSSProperties['flexWrap'];\n $gap?: string | number;\n $width?: string | number;\n $height?: string | number;\n}\n\nconst StyledFlex = styled.div<Partial<FlexStyledProps>>(\n ({\n $align = 'center',\n $direction = 'row',\n $justify = 'center',\n $wrap = 'nowrap',\n $gap = 0,\n $width = 'auto',\n $height = 'auto',\n }) => css`\n box-sizing: border-box;\n display: flex;\n width: ${typeof $width === 'number' ? `${$width}px` : $width};\n height: ${typeof $height === 'number' ? `${$height}px` : $height};\n\n gap: ${typeof $gap === 'number' ? `${$gap}px` : $gap};\n align-items: ${$align};\n justify-content: ${$justify};\n flex-direction: ${$direction};\n flex-wrap: ${$wrap};\n `\n);\n\n/**\n * @prop {string} width\n * @prop {string} height\n * @prop {string} gap\n * @prop {CSSProperties['alignItems']} align\n * @prop {CSSProperties['justifyContent']} justify\n * @prop {CSSProperties['flexDirection']} direction\n * @prop {CSSProperties['flexWrap']} wrap\n */\n\nconst Flex = forwardRef(function (\n { width, height, direction, gap, align, justify, wrap, ...props }: FlexProps,\n ref: ForwardedRef<HTMLDivElement | null>\n) {\n return (\n <StyledFlex\n ref={ref}\n $width={width}\n $height={height}\n $direction={direction}\n $gap={gap}\n $align={align}\n $justify={justify}\n $wrap={wrap}\n {...props}\n />\n );\n}) as PolymorphicComponent<'web', FlexProps>;\n\ntype FlexProps = ConvertTransientProps<FlexStyledProps>;\n\nexport default Flex;\n"],"names":["$align","$direction","$justify","$wrap","$gap","$width","$height","Flex","props","ref"],"mappings":";;;;;;;;;;;;;;;;;AAAa;AAAA;AAAA;AAAA;AAkBb;AACE;AACEA;;AACAC;;AACAC;;AACAC;;AACAC;;AACAC;;AACAC;;AAWkB;;AAItB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEMC;AAGJ;;;;;;;AAF0DC;AAG1D;AAEIC;AACAJ;AACAC;AACAL;AACAG;AACAJ;AACAE;AACAC;;AAIN;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CSSProperties, ElementType, HTMLAttributes } from 'react';
|
|
2
1
|
import type { ConvertTransientProps } from '@remember-web/shared';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { CSSProperties, ComponentProps } from 'react';
|
|
3
|
+
import type { PolymorphicComponent } from 'styled-components';
|
|
4
|
+
export interface FlexStyledProps extends ComponentProps<'div'> {
|
|
5
5
|
$align?: CSSProperties['alignItems'];
|
|
6
6
|
$direction?: CSSProperties['flexDirection'];
|
|
7
7
|
$justify?: CSSProperties['justifyContent'];
|
|
@@ -19,5 +19,6 @@ export interface FlexProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
19
19
|
* @prop {CSSProperties['flexDirection']} direction
|
|
20
20
|
* @prop {CSSProperties['flexWrap']} wrap
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
declare const Flex: PolymorphicComponent<"web", ConvertTransientProps<FlexStyledProps>>;
|
|
23
|
+
export default Flex;
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Common/Flex/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Common/Flex/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAgB,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG9D,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC5D,MAAM,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAyBD;;;;;;;;GAQG;AAEH,QAAA,MAAM,IAAI,qEAiBkC,CAAC;AAI7C,eAAe,IAAI,CAAC"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/taggedTemplateLiteral';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
5
6
|
import styled, { css } from 'styled-components';
|
|
6
7
|
import { jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
|
-
var _excluded = ["
|
|
9
|
+
var _excluded = ["width", "height", "direction", "gap", "align", "justify", "wrap"];
|
|
9
10
|
var _templateObject;
|
|
10
11
|
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; }
|
|
11
12
|
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; }
|
|
@@ -36,9 +37,9 @@ var StyledFlex = styled.div(function (_ref) {
|
|
|
36
37
|
* @prop {CSSProperties['flexDirection']} direction
|
|
37
38
|
* @prop {CSSProperties['flexWrap']} wrap
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
|
|
41
|
+
var Flex = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
42
|
+
var width = _ref2.width,
|
|
42
43
|
height = _ref2.height,
|
|
43
44
|
direction = _ref2.direction,
|
|
44
45
|
gap = _ref2.gap,
|
|
@@ -47,7 +48,7 @@ var Flex = function Flex(_ref2) {
|
|
|
47
48
|
wrap = _ref2.wrap,
|
|
48
49
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
49
50
|
return /*#__PURE__*/jsx(StyledFlex, _objectSpread({
|
|
50
|
-
|
|
51
|
+
ref: ref,
|
|
51
52
|
$width: width,
|
|
52
53
|
$height: height,
|
|
53
54
|
$direction: direction,
|
|
@@ -56,7 +57,7 @@ var Flex = function Flex(_ref2) {
|
|
|
56
57
|
$justify: justify,
|
|
57
58
|
$wrap: wrap
|
|
58
59
|
}, props));
|
|
59
|
-
};
|
|
60
|
+
});
|
|
60
61
|
|
|
61
|
-
export { Flex };
|
|
62
|
+
export { Flex as default };
|
|
62
63
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Common/Flex/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Common/Flex/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ConvertTransientProps } from '@remember-web/shared';\nimport type { CSSProperties, ComponentProps, ForwardedRef } from 'react';\nimport { forwardRef } from 'react';\nimport type { PolymorphicComponent } from 'styled-components';\nimport styled, { css } from 'styled-components';\n\nexport interface FlexStyledProps extends ComponentProps<'div'> {\n $align?: CSSProperties['alignItems'];\n $direction?: CSSProperties['flexDirection'];\n $justify?: CSSProperties['justifyContent'];\n $wrap?: CSSProperties['flexWrap'];\n $gap?: string | number;\n $width?: string | number;\n $height?: string | number;\n}\n\nconst StyledFlex = styled.div<Partial<FlexStyledProps>>(\n ({\n $align = 'center',\n $direction = 'row',\n $justify = 'center',\n $wrap = 'nowrap',\n $gap = 0,\n $width = 'auto',\n $height = 'auto',\n }) => css`\n box-sizing: border-box;\n display: flex;\n width: ${typeof $width === 'number' ? `${$width}px` : $width};\n height: ${typeof $height === 'number' ? `${$height}px` : $height};\n\n gap: ${typeof $gap === 'number' ? `${$gap}px` : $gap};\n align-items: ${$align};\n justify-content: ${$justify};\n flex-direction: ${$direction};\n flex-wrap: ${$wrap};\n `\n);\n\n/**\n * @prop {string} width\n * @prop {string} height\n * @prop {string} gap\n * @prop {CSSProperties['alignItems']} align\n * @prop {CSSProperties['justifyContent']} justify\n * @prop {CSSProperties['flexDirection']} direction\n * @prop {CSSProperties['flexWrap']} wrap\n */\n\nconst Flex = forwardRef(function (\n { width, height, direction, gap, align, justify, wrap, ...props }: FlexProps,\n ref: ForwardedRef<HTMLDivElement | null>\n) {\n return (\n <StyledFlex\n ref={ref}\n $width={width}\n $height={height}\n $direction={direction}\n $gap={gap}\n $align={align}\n $justify={justify}\n $wrap={wrap}\n {...props}\n />\n );\n}) as PolymorphicComponent<'web', FlexProps>;\n\ntype FlexProps = ConvertTransientProps<FlexStyledProps>;\n\nexport default Flex;\n"],"names":["$align","$direction","$justify","$wrap","$gap","$width","$height","Flex","props","ref"],"mappings":";;;;;;;;AAAa;AAAA;AAAA;AAAA;AAkBb;AACE;AACEA;;AACAC;;AACAC;;AACAC;;AACAC;;AACAC;;AACAC;;AAWkB;;AAItB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEMC;AAGJ;;;;;;;AAF0DC;AAG1D;AAEIC;AACAJ;AACAC;AACAL;AACAG;AACAJ;AACAE;AACAC;;AAIN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Common/Grid/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport styled from 'styled-components';\n\nexport interface GridProps extends HTMLAttributes<HTMLDivElement> {\n width?: string;\n height?: string;\n align?: CSSProperties['alignItems'];\n justify?: CSSProperties['justifyContent'];\n flow?: CSSProperties['gridAutoFlow'];\n columns?: number;\n gap?: string;\n columnGap?: string;\n rowGap?: string;\n}\n\nconst StyledGrid = styled.div<Partial<GridProps>>`\n box-sizing: border-box;\n display: grid;\n width: ${({ width = '100%' }) => width};\n height: ${({ height = '100%' }) => height};\n align-items: ${({ align = 'center' }) => align};\n justify-content: ${({ justify = 'center' }) => justify};\n grid-auto-flow: ${({ flow = 'center' }) => flow};\n grid-template-columns: ${({ columns = 1 }) => `repeat(${columns}, 1fr)`};\n gap: ${({ gap = '0px' }) => gap};\n column-gap: ${({ columnGap = '0px' }) => columnGap};\n row-gap: ${({ rowGap = '0px' }) => rowGap};\n`;\n\n/**\n * @prop {string} width\n * @prop {string} height\n * @prop {CSSProperties['alignItems']} align\n * @prop {CSSProperties['justifyContent']} justify\n * @prop {CSSProperties['gridAutoFlow']} flow\n * @prop {number} columns\n * @prop {string} gap\n * @prop {string} columnGap\n * @prop {string} rowGap\n */\nexport const Grid = (props: GridProps) => <StyledGrid {...props} />;\n"],"names":["width","height","align","justify","flow","columns","gap","columnGap","rowGap"],"mappings":";;;;;;;;;;;;;;AAAa;AAAA;AAAA;AAiBb;AAGW;AAAGA;AAAc;AAAY;AAC5B;AAAGC;AAAe;AAAa;AAC1B;AAAGC;AAAgB;AAAY;AAC3B;AAAGC;AAAkB;AAAc;AACpC;AAAGC;AAAe;AAAW;AACtB;AAAGC;;AAAmC;AACxD;AAAGC;AAAW;AAAU;AACjB;AAAGC;AAAiB;AAAgB;AACvC;AAAGC;AAAc;AAAa;;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACmE;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Common/Grid/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport styled from 'styled-components';\n\nexport interface GridProps extends HTMLAttributes<HTMLDivElement> {\n width?: string;\n height?: string;\n align?: CSSProperties['alignItems'];\n justify?: CSSProperties['justifyContent'];\n flow?: CSSProperties['gridAutoFlow'];\n columns?: number;\n gap?: string;\n columnGap?: string;\n rowGap?: string;\n}\n\nconst StyledGrid = styled.div<Partial<GridProps>>`\n box-sizing: border-box;\n display: grid;\n width: ${({ width = '100%' }) => width};\n height: ${({ height = '100%' }) => height};\n align-items: ${({ align = 'center' }) => align};\n justify-content: ${({ justify = 'center' }) => justify};\n grid-auto-flow: ${({ flow = 'center' }) => flow};\n grid-template-columns: ${({ columns = 1 }) => `repeat(${columns}, 1fr)`};\n gap: ${({ gap = '0px' }) => gap};\n column-gap: ${({ columnGap = '0px' }) => columnGap};\n row-gap: ${({ rowGap = '0px' }) => rowGap};\n`;\n\n/**\n * @deprecated\n * @prop {string} width\n * @prop {string} height\n * @prop {CSSProperties['alignItems']} align\n * @prop {CSSProperties['justifyContent']} justify\n * @prop {CSSProperties['gridAutoFlow']} flow\n * @prop {number} columns\n * @prop {string} gap\n * @prop {string} columnGap\n * @prop {string} rowGap\n */\nexport const Grid = (props: GridProps) => <StyledGrid {...props} />;\n"],"names":["width","height","align","justify","flow","columns","gap","columnGap","rowGap"],"mappings":";;;;;;;;;;;;;;AAAa;AAAA;AAAA;AAiBb;AAGW;AAAGA;AAAc;AAAY;AAC5B;AAAGC;AAAe;AAAa;AAC1B;AAAGC;AAAgB;AAAY;AAC3B;AAAGC;AAAkB;AAAc;AACpC;AAAGC;AAAe;AAAW;AACtB;AAAGC;;AAAmC;AACxD;AAAGC;AAAW;AAAU;AACjB;AAAGC;AAAiB;AAAgB;AACvC;AAAGC;AAAc;AAAa;;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACmE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Common/Grid/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG3D,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgBD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Common/Grid/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG3D,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI,UAAW,SAAS,4CAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Common/Grid/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport styled from 'styled-components';\n\nexport interface GridProps extends HTMLAttributes<HTMLDivElement> {\n width?: string;\n height?: string;\n align?: CSSProperties['alignItems'];\n justify?: CSSProperties['justifyContent'];\n flow?: CSSProperties['gridAutoFlow'];\n columns?: number;\n gap?: string;\n columnGap?: string;\n rowGap?: string;\n}\n\nconst StyledGrid = styled.div<Partial<GridProps>>`\n box-sizing: border-box;\n display: grid;\n width: ${({ width = '100%' }) => width};\n height: ${({ height = '100%' }) => height};\n align-items: ${({ align = 'center' }) => align};\n justify-content: ${({ justify = 'center' }) => justify};\n grid-auto-flow: ${({ flow = 'center' }) => flow};\n grid-template-columns: ${({ columns = 1 }) => `repeat(${columns}, 1fr)`};\n gap: ${({ gap = '0px' }) => gap};\n column-gap: ${({ columnGap = '0px' }) => columnGap};\n row-gap: ${({ rowGap = '0px' }) => rowGap};\n`;\n\n/**\n * @prop {string} width\n * @prop {string} height\n * @prop {CSSProperties['alignItems']} align\n * @prop {CSSProperties['justifyContent']} justify\n * @prop {CSSProperties['gridAutoFlow']} flow\n * @prop {number} columns\n * @prop {string} gap\n * @prop {string} columnGap\n * @prop {string} rowGap\n */\nexport const Grid = (props: GridProps) => <StyledGrid {...props} />;\n"],"names":["width","height","align","justify","flow","columns","gap","columnGap","rowGap"],"mappings":";;;;;;AAAa;AAAA;AAAA;AAiBb;AAGW;AAAGA;AAAc;AAAY;AAC5B;AAAGC;AAAe;AAAa;AAC1B;AAAGC;AAAgB;AAAY;AAC3B;AAAGC;AAAkB;AAAc;AACpC;AAAGC;AAAe;AAAW;AACtB;AAAGC;;AAAmC;AACxD;AAAGC;AAAW;AAAU;AACjB;AAAGC;AAAiB;AAAgB;AACvC;AAAGC;AAAc;AAAa;;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACmE;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Common/Grid/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, HTMLAttributes } from 'react';\nimport styled from 'styled-components';\n\nexport interface GridProps extends HTMLAttributes<HTMLDivElement> {\n width?: string;\n height?: string;\n align?: CSSProperties['alignItems'];\n justify?: CSSProperties['justifyContent'];\n flow?: CSSProperties['gridAutoFlow'];\n columns?: number;\n gap?: string;\n columnGap?: string;\n rowGap?: string;\n}\n\nconst StyledGrid = styled.div<Partial<GridProps>>`\n box-sizing: border-box;\n display: grid;\n width: ${({ width = '100%' }) => width};\n height: ${({ height = '100%' }) => height};\n align-items: ${({ align = 'center' }) => align};\n justify-content: ${({ justify = 'center' }) => justify};\n grid-auto-flow: ${({ flow = 'center' }) => flow};\n grid-template-columns: ${({ columns = 1 }) => `repeat(${columns}, 1fr)`};\n gap: ${({ gap = '0px' }) => gap};\n column-gap: ${({ columnGap = '0px' }) => columnGap};\n row-gap: ${({ rowGap = '0px' }) => rowGap};\n`;\n\n/**\n * @deprecated\n * @prop {string} width\n * @prop {string} height\n * @prop {CSSProperties['alignItems']} align\n * @prop {CSSProperties['justifyContent']} justify\n * @prop {CSSProperties['gridAutoFlow']} flow\n * @prop {number} columns\n * @prop {string} gap\n * @prop {string} columnGap\n * @prop {string} rowGap\n */\nexport const Grid = (props: GridProps) => <StyledGrid {...props} />;\n"],"names":["width","height","align","justify","flow","columns","gap","columnGap","rowGap"],"mappings":";;;;;;AAAa;AAAA;AAAA;AAiBb;AAGW;AAAGA;AAAc;AAAY;AAC5B;AAAGC;AAAe;AAAa;AAC1B;AAAGC;AAAgB;AAAY;AAC3B;AAAGC;AAAkB;AAAc;AACpC;AAAGC;AAAe;AAAW;AACtB;AAAGC;;AAAmC;AACxD;AAAGC;AAAW;AAAU;AACjB;AAAGC;AAAiB;AAAgB;AACvC;AAAGC;AAAc;AAAa;;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACmE;;"}
|
|
@@ -12,12 +12,11 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
12
12
|
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
|
|
13
13
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefault(_objectWithoutProperties);
|
|
14
14
|
|
|
15
|
-
var _excluded = ["variant", "
|
|
15
|
+
var _excluded = ["variant", "color", "children", "ellipsis", "maxWidth"];
|
|
16
16
|
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; }
|
|
17
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; }
|
|
18
|
-
var Typography = function
|
|
18
|
+
var Typography = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
19
19
|
var variant = _ref.variant,
|
|
20
|
-
as = _ref.as,
|
|
21
20
|
color = _ref.color,
|
|
22
21
|
children = _ref.children,
|
|
23
22
|
ellipsis = _ref.ellipsis,
|
|
@@ -25,7 +24,6 @@ var Typography = function Typography(_ref, ref) {
|
|
|
25
24
|
props = _objectWithoutProperties__default.default(_ref, _excluded);
|
|
26
25
|
return /*#__PURE__*/jsxRuntime.jsx(styles.StyledTypography, _objectSpread(_objectSpread({
|
|
27
26
|
ref: ref,
|
|
28
|
-
as: as,
|
|
29
27
|
$variant: variant,
|
|
30
28
|
$color: color,
|
|
31
29
|
$ellipsis: ellipsis,
|
|
@@ -33,8 +31,7 @@ var Typography = function Typography(_ref, ref) {
|
|
|
33
31
|
}, props), {}, {
|
|
34
32
|
children: children
|
|
35
33
|
}));
|
|
36
|
-
};
|
|
37
|
-
var Typography$1 = /*#__PURE__*/react.forwardRef(Typography);
|
|
34
|
+
});
|
|
38
35
|
|
|
39
|
-
module.exports = Typography
|
|
36
|
+
module.exports = Typography;
|
|
40
37
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Common/Typography/index.tsx"],"sourcesContent":["'use client';\n\nimport type {\n
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Common/Typography/index.tsx"],"sourcesContent":["'use client';\n\nimport { type TypographyStyle } from '@remember-web/mixin';\nimport type {\n CSSProperties,\n ComponentProps,\n ForwardedRef,\n ReactNode,\n} from 'react';\nimport { forwardRef } from 'react';\nimport type { PolymorphicComponent } from 'styled-components';\n\nimport { StyledTypography } from './styles';\n\nconst Typography = forwardRef(function (\n { variant, color, children, ellipsis, maxWidth, ...props }: TypographyProps,\n ref: ForwardedRef<HTMLDivElement | null>\n) {\n return (\n <StyledTypography\n ref={ref}\n $variant={variant}\n $color={color}\n $ellipsis={ellipsis}\n $maxWidth={maxWidth}\n {...props}\n >\n {children}\n </StyledTypography>\n );\n}) as PolymorphicComponent<'web', TypographyProps>;\n\ntype TypographyProps = {\n variant: TypographyStyle;\n color?: string;\n children?: ReactNode;\n ellipsis?: number;\n maxWidth?: CSSProperties['maxWidth'];\n} & ComponentProps<'div'>;\n\nexport default Typography;\n"],"names":["Typography","props","ref","$variant","$color","$ellipsis","$maxWidth","children"],"mappings":";;;;;;;;;;;;;;AAAa;AAAA;AAAA;AAcPA;AAGJ;;;;;AAFmDC;AAGnD;AAEIC;AACAC;AACAC;AACAC;AACAC;AAAoB;AACXC;AAEA;AAGf;;"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ComponentPropsWithRef, CSSProperties, ElementType, ReactElement, ReactNode } from 'react';
|
|
2
1
|
import { type TypographyStyle } from '@remember-web/mixin';
|
|
3
|
-
type
|
|
2
|
+
import type { CSSProperties, ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import type { PolymorphicComponent } from 'styled-components';
|
|
4
|
+
declare const Typography: PolymorphicComponent<"web", TypographyProps>;
|
|
5
|
+
type TypographyProps = {
|
|
4
6
|
variant: TypographyStyle;
|
|
5
|
-
as?: T;
|
|
6
7
|
color?: string;
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
ellipsis?: number;
|
|
9
10
|
maxWidth?: CSSProperties['maxWidth'];
|
|
10
|
-
} &
|
|
11
|
-
|
|
12
|
-
ref?: ComponentPropsWithRef<T>['ref'];
|
|
13
|
-
}) => ReactElement | null;
|
|
14
|
-
declare const _default: TypographyComponentWithRef;
|
|
15
|
-
export default _default;
|
|
11
|
+
} & ComponentProps<'div'>;
|
|
12
|
+
export default Typography;
|
|
16
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Common/Typography/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Common/Typography/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAEd,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAI9D,QAAA,MAAM,UAAU,8CAgBkC,CAAC;AAEnD,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CACtC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE1B,eAAe,UAAU,CAAC"}
|
|
@@ -5,12 +5,11 @@ import { forwardRef } from 'react';
|
|
|
5
5
|
import { StyledTypography } from './styles.esm.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var _excluded = ["variant", "
|
|
8
|
+
var _excluded = ["variant", "color", "children", "ellipsis", "maxWidth"];
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
|
-
var Typography = function
|
|
11
|
+
var Typography = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
12
12
|
var variant = _ref.variant,
|
|
13
|
-
as = _ref.as,
|
|
14
13
|
color = _ref.color,
|
|
15
14
|
children = _ref.children,
|
|
16
15
|
ellipsis = _ref.ellipsis,
|
|
@@ -18,7 +17,6 @@ var Typography = function Typography(_ref, ref) {
|
|
|
18
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
18
|
return /*#__PURE__*/jsx(StyledTypography, _objectSpread(_objectSpread({
|
|
20
19
|
ref: ref,
|
|
21
|
-
as: as,
|
|
22
20
|
$variant: variant,
|
|
23
21
|
$color: color,
|
|
24
22
|
$ellipsis: ellipsis,
|
|
@@ -26,8 +24,7 @@ var Typography = function Typography(_ref, ref) {
|
|
|
26
24
|
}, props), {}, {
|
|
27
25
|
children: children
|
|
28
26
|
}));
|
|
29
|
-
};
|
|
30
|
-
var Typography$1 = /*#__PURE__*/forwardRef(Typography);
|
|
27
|
+
});
|
|
31
28
|
|
|
32
|
-
export { Typography
|
|
29
|
+
export { Typography as default };
|
|
33
30
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Common/Typography/index.tsx"],"sourcesContent":["'use client';\n\nimport type {\n
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Common/Typography/index.tsx"],"sourcesContent":["'use client';\n\nimport { type TypographyStyle } from '@remember-web/mixin';\nimport type {\n CSSProperties,\n ComponentProps,\n ForwardedRef,\n ReactNode,\n} from 'react';\nimport { forwardRef } from 'react';\nimport type { PolymorphicComponent } from 'styled-components';\n\nimport { StyledTypography } from './styles';\n\nconst Typography = forwardRef(function (\n { variant, color, children, ellipsis, maxWidth, ...props }: TypographyProps,\n ref: ForwardedRef<HTMLDivElement | null>\n) {\n return (\n <StyledTypography\n ref={ref}\n $variant={variant}\n $color={color}\n $ellipsis={ellipsis}\n $maxWidth={maxWidth}\n {...props}\n >\n {children}\n </StyledTypography>\n );\n}) as PolymorphicComponent<'web', TypographyProps>;\n\ntype TypographyProps = {\n variant: TypographyStyle;\n color?: string;\n children?: ReactNode;\n ellipsis?: number;\n maxWidth?: CSSProperties['maxWidth'];\n} & ComponentProps<'div'>;\n\nexport default Typography;\n"],"names":["Typography","props","ref","$variant","$color","$ellipsis","$maxWidth","children"],"mappings":";;;;;;;AAAa;AAAA;AAAA;AAcPA;AAGJ;;;;;AAFmDC;AAGnD;AAEIC;AACAC;AACAC;AACAC;AACAC;AAAoB;AACXC;AAEA;AAGf;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Common/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Common/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,4BAA4B;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -45,7 +45,7 @@ Dialog.Content = function (_ref2) {
|
|
|
45
45
|
props = _objectWithoutProperties__default.default(_ref2, _excluded2);
|
|
46
46
|
return /*#__PURE__*/jsxRuntime.jsxs(DialogPrimitive.Portal, {
|
|
47
47
|
children: [dimmed && /*#__PURE__*/jsxRuntime.jsx(styles.StyledOverlay, {}), /*#__PURE__*/jsxRuntime.jsx(styles.DialogContent, _objectSpread(_objectSpread({}, props), {}, {
|
|
48
|
-
children: /*#__PURE__*/jsxRuntime.jsx(index
|
|
48
|
+
children: /*#__PURE__*/jsxRuntime.jsx(index, {
|
|
49
49
|
direction: "column",
|
|
50
50
|
align: "center",
|
|
51
51
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Modals/Dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DialogContentProps, DialogProps } from '@radix-ui/react-dialog';\nimport { Root, Trigger, Close, Portal } from '@radix-ui/react-dialog';\nimport { IconClose, PictogramAlert, PictogramCheck } from '@remember-web/icon';\n\nimport
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Modals/Dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DialogContentProps, DialogProps } from '@radix-ui/react-dialog';\nimport { Root, Trigger, Close, Portal } from '@radix-ui/react-dialog';\nimport { IconClose, PictogramAlert, PictogramCheck } from '@remember-web/icon';\n\nimport Flex from '@/Common/Flex';\n\nimport {\n DialogContent,\n DialogDescription,\n DialogIcon,\n DialogTitle,\n IconButton,\n StyledOverlay,\n} from './styles';\n\ninterface ContentProps extends DialogContentProps {\n children: React.ReactNode;\n dimmed?: boolean;\n}\n\n/**\n * @prop {React.ReactNode} children\n * @prop {boolean} open\n * @prop {boolean} defaultOpen\n * @prop {(open: boolean) => void} onOpenChange\n * @prop {boolean} modal\n * @prop {string} id\n */\nexport function Dialog({ children, ...props }: DialogProps) {\n return <Root {...props}>{children}</Root>;\n}\n\n/**\n * @prop {boolean} dimmed\n * @see https://www.radix-ui.com/docs/primitives/components/dialog\n */\nDialog.Content = ({ children, dimmed = true, ...props }: ContentProps) => (\n <Portal>\n {dimmed && <StyledOverlay />}\n <DialogContent {...props}>\n <Flex direction=\"column\" align=\"center\">\n {children}\n </Flex>\n </DialogContent>\n </Portal>\n);\n\nDialog.HeadIcon = ({ type = 'alert' }: { type?: 'alert' | 'confirm' }) => (\n <DialogIcon>\n {type === 'alert' && <PictogramAlert size={40} />}\n {type === 'confirm' && <PictogramCheck size={40} />}\n </DialogIcon>\n);\n\nDialog.CloseIcon = () => (\n <Close asChild>\n <IconButton type=\"button\" aria-label=\"Close\">\n <IconClose size=\"small\" />\n </IconButton>\n </Close>\n);\n\nDialog.Title = ({ children }: { children: React.ReactNode }) => (\n <DialogTitle>{children}</DialogTitle>\n);\n\nDialog.Description = ({ children }: { children: React.ReactNode }) => (\n <DialogDescription>{children}</DialogDescription>\n);\n\nDialog.Trigger = Trigger;\nDialog.Close = Close;\n"],"names":["props","children","Dialog","dimmed","direction","align","type","size"],"mappings":";;;;;;;;;;;;;;;;AAAa;;AAAA;AAAA;AAsBb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AAAqD;AAAtBA;;AACdC;AAAW;AACnC;;AAEA;AACA;AACA;AACA;AACAC;AAAiB;;AAAaC;AAAkBH;;AACvCC;;AAGGG;AAAmBC;AAAcJ;;AAEhC;AACO;AACT;AAGXC;AAAkB;AAAGI;;AACRL;AAC4BM;;AACEA;AAAS;AAAG;AACxC;AAGfL;;;;AAEgBI;AAAc;;AACbC;;;AACA;AACP;AAGVL;AAAe;;AACDD;AAAU;AAAe;AAGvCC;AAAqB;;AACDD;AAAU;AAAqB;AAGnDC;AACAA;;"}
|
|
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import { Root, Portal, Close, Trigger } from '@radix-ui/react-dialog';
|
|
5
5
|
import { PictogramAlert, PictogramCheck, IconClose } from '@remember-web/icon';
|
|
6
|
-
import
|
|
6
|
+
import Flex from '../../Common/Flex/index.esm.js';
|
|
7
7
|
import { StyledOverlay, DialogContent, DialogIcon, IconButton, DialogTitle, DialogDescription } from './styles.esm.js';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Modals/Dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DialogContentProps, DialogProps } from '@radix-ui/react-dialog';\nimport { Root, Trigger, Close, Portal } from '@radix-ui/react-dialog';\nimport { IconClose, PictogramAlert, PictogramCheck } from '@remember-web/icon';\n\nimport
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Modals/Dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DialogContentProps, DialogProps } from '@radix-ui/react-dialog';\nimport { Root, Trigger, Close, Portal } from '@radix-ui/react-dialog';\nimport { IconClose, PictogramAlert, PictogramCheck } from '@remember-web/icon';\n\nimport Flex from '@/Common/Flex';\n\nimport {\n DialogContent,\n DialogDescription,\n DialogIcon,\n DialogTitle,\n IconButton,\n StyledOverlay,\n} from './styles';\n\ninterface ContentProps extends DialogContentProps {\n children: React.ReactNode;\n dimmed?: boolean;\n}\n\n/**\n * @prop {React.ReactNode} children\n * @prop {boolean} open\n * @prop {boolean} defaultOpen\n * @prop {(open: boolean) => void} onOpenChange\n * @prop {boolean} modal\n * @prop {string} id\n */\nexport function Dialog({ children, ...props }: DialogProps) {\n return <Root {...props}>{children}</Root>;\n}\n\n/**\n * @prop {boolean} dimmed\n * @see https://www.radix-ui.com/docs/primitives/components/dialog\n */\nDialog.Content = ({ children, dimmed = true, ...props }: ContentProps) => (\n <Portal>\n {dimmed && <StyledOverlay />}\n <DialogContent {...props}>\n <Flex direction=\"column\" align=\"center\">\n {children}\n </Flex>\n </DialogContent>\n </Portal>\n);\n\nDialog.HeadIcon = ({ type = 'alert' }: { type?: 'alert' | 'confirm' }) => (\n <DialogIcon>\n {type === 'alert' && <PictogramAlert size={40} />}\n {type === 'confirm' && <PictogramCheck size={40} />}\n </DialogIcon>\n);\n\nDialog.CloseIcon = () => (\n <Close asChild>\n <IconButton type=\"button\" aria-label=\"Close\">\n <IconClose size=\"small\" />\n </IconButton>\n </Close>\n);\n\nDialog.Title = ({ children }: { children: React.ReactNode }) => (\n <DialogTitle>{children}</DialogTitle>\n);\n\nDialog.Description = ({ children }: { children: React.ReactNode }) => (\n <DialogDescription>{children}</DialogDescription>\n);\n\nDialog.Trigger = Trigger;\nDialog.Close = Close;\n"],"names":["props","children","Dialog","dimmed","direction","align","type","size"],"mappings":";;;;;;;;;AAAa;;AAAA;AAAA;AAsBb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AAAqD;AAAtBA;;AACdC;AAAW;AACnC;;AAEA;AACA;AACA;AACA;AACAC;AAAiB;;AAAaC;AAAkBH;;AACvCC;;AAGGG;AAAmBC;AAAcJ;;AAEhC;AACO;AACT;AAGXC;AAAkB;AAAGI;;AACRL;AAC4BM;;AACEA;AAAS;AAAG;AACxC;AAGfL;;;;AAEgBI;AAAc;;AACbC;;;AACA;AACP;AAGVL;AAAe;;AACDD;AAAU;AAAe;AAGvCC;AAAqB;;AACDD;AAAU;AAAqB;AAGnDC;AACAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Paginations/CompactPagination/index.tsx"],"sourcesContent":["'use client';\n\nimport { IconArrow2Left, IconArrow2Right } from '@remember-web/icon';\nimport { contents000, contents300 } from '@remember-web/mixin';\n\nimport
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/Paginations/CompactPagination/index.tsx"],"sourcesContent":["'use client';\n\nimport { IconArrow2Left, IconArrow2Right } from '@remember-web/icon';\nimport { contents000, contents300 } from '@remember-web/mixin';\n\nimport Flex from '@/Common/Flex';\n\nimport {\n ArrowButton,\n CompactPaginationContainer,\n CurrentPage,\n} from '../styles';\nimport type { CompactPaginationProps } from '../types';\nimport usePagination from '../usePagination';\n\nexport function CompactPagination({\n activePage = 1,\n totalItemCount = 0,\n onChangePage,\n itemCountPerPage,\n infinite = false,\n className,\n}: CompactPaginationProps) {\n const {\n totalLastPage,\n prevPage,\n nextPage,\n isPrevPageDisabled,\n isNextPageDisabled,\n } = usePagination({\n activePage,\n totalItemCount,\n pageRangeDisplayed: 1,\n itemCountPerPage,\n });\n\n const iconColor = (disabled: boolean) =>\n disabled ? contents300 : contents000;\n\n const onClickPrevPage = () => {\n const prevPageToGo =\n activePage === 1 && infinite ? totalLastPage : prevPage;\n onChangePage(prevPageToGo);\n };\n\n const onClickNextPage = () => {\n const nextPageToGo =\n activePage === totalLastPage && infinite ? 1 : nextPage;\n onChangePage(nextPageToGo);\n };\n\n const hasOnlyOnePage = totalLastPage === 1;\n\n const getArrowButtonDisabled = (disabled: boolean) => {\n if (hasOnlyOnePage) {\n return true;\n }\n if (infinite) {\n return false;\n }\n return disabled;\n };\n\n const getArrowButtonColor = (disabled: boolean) => {\n if (hasOnlyOnePage) {\n return contents300;\n }\n if (infinite) {\n return contents000;\n }\n return iconColor(disabled);\n };\n\n return (\n <CompactPaginationContainer\n className={className}\n role=\"navigation\"\n aria-label=\"페이지네이션\"\n >\n <ArrowButton\n disabled={getArrowButtonDisabled(isPrevPageDisabled)}\n onClick={onClickPrevPage}\n aria-label=\"이전 페이지로 이동\"\n >\n <IconArrow2Left\n size=\"small\"\n color={getArrowButtonColor(isPrevPageDisabled)}\n aria-hidden=\"true\"\n />\n </ArrowButton>\n <Flex gap=\"4px\" style={{ minWidth: '44px', userSelect: 'none' }}>\n <CurrentPage>{activePage}</CurrentPage>/ {totalLastPage}\n </Flex>\n <ArrowButton\n disabled={getArrowButtonDisabled(isNextPageDisabled)}\n onClick={onClickNextPage}\n aria-label=\"다음 페이지로 이동\"\n >\n <IconArrow2Right\n size=\"small\"\n color={getArrowButtonColor(isNextPageDisabled)}\n aria-hidden=\"true\"\n />\n </ArrowButton>\n </CompactPaginationContainer>\n );\n}\n"],"names":["activePage","totalItemCount","infinite","pageRangeDisplayed","itemCountPerPage","className","role","disabled","onClick","size","color","gap","style","minWidth","userSelect","children"],"mappings":";;;;;;;;;;AAeO;AAOoB;AANzBA;;AACAC;;;;AAGAC;;;AAUEF;AACAC;AACAE;AACAC;AACF;;;;;;AAEA;AAAoC;AACE;AAEtC;;;;AAMA;;;;AAMA;AAEA;AACE;AACE;AACF;AACA;AACE;AACF;AACA;;AAGF;AACE;AACE;AACF;AACA;AACE;AACF;;;;AAMEC;AACAC;AACA;;AAGEC;AACAC;AACA;;AAGEC;AACAC;;;AAEA;AAEEC;AAAUC;AAASC;AAAkBC;;;AAC7BC;;AAA2C;AAGvDR;AACAC;AACA;;AAGEC;AACAC;;;AAEA;AACU;AAGpB;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { IconArrow2Left, IconArrow2Right } from '@remember-web/icon';
|
|
3
3
|
import { contents300, contents000 } from '@remember-web/mixin';
|
|
4
|
-
import
|
|
4
|
+
import Flex from '../../Common/Flex/index.esm.js';
|
|
5
5
|
import { CompactPaginationContainer, ArrowButton, CurrentPage } from '../styles.esm.js';
|
|
6
6
|
import usePagination from '../usePagination.esm.js';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../../src/Paginations/CompactPagination/index.tsx"],"sourcesContent":["'use client';\n\nimport { IconArrow2Left, IconArrow2Right } from '@remember-web/icon';\nimport { contents000, contents300 } from '@remember-web/mixin';\n\nimport
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../src/Paginations/CompactPagination/index.tsx"],"sourcesContent":["'use client';\n\nimport { IconArrow2Left, IconArrow2Right } from '@remember-web/icon';\nimport { contents000, contents300 } from '@remember-web/mixin';\n\nimport Flex from '@/Common/Flex';\n\nimport {\n ArrowButton,\n CompactPaginationContainer,\n CurrentPage,\n} from '../styles';\nimport type { CompactPaginationProps } from '../types';\nimport usePagination from '../usePagination';\n\nexport function CompactPagination({\n activePage = 1,\n totalItemCount = 0,\n onChangePage,\n itemCountPerPage,\n infinite = false,\n className,\n}: CompactPaginationProps) {\n const {\n totalLastPage,\n prevPage,\n nextPage,\n isPrevPageDisabled,\n isNextPageDisabled,\n } = usePagination({\n activePage,\n totalItemCount,\n pageRangeDisplayed: 1,\n itemCountPerPage,\n });\n\n const iconColor = (disabled: boolean) =>\n disabled ? contents300 : contents000;\n\n const onClickPrevPage = () => {\n const prevPageToGo =\n activePage === 1 && infinite ? totalLastPage : prevPage;\n onChangePage(prevPageToGo);\n };\n\n const onClickNextPage = () => {\n const nextPageToGo =\n activePage === totalLastPage && infinite ? 1 : nextPage;\n onChangePage(nextPageToGo);\n };\n\n const hasOnlyOnePage = totalLastPage === 1;\n\n const getArrowButtonDisabled = (disabled: boolean) => {\n if (hasOnlyOnePage) {\n return true;\n }\n if (infinite) {\n return false;\n }\n return disabled;\n };\n\n const getArrowButtonColor = (disabled: boolean) => {\n if (hasOnlyOnePage) {\n return contents300;\n }\n if (infinite) {\n return contents000;\n }\n return iconColor(disabled);\n };\n\n return (\n <CompactPaginationContainer\n className={className}\n role=\"navigation\"\n aria-label=\"페이지네이션\"\n >\n <ArrowButton\n disabled={getArrowButtonDisabled(isPrevPageDisabled)}\n onClick={onClickPrevPage}\n aria-label=\"이전 페이지로 이동\"\n >\n <IconArrow2Left\n size=\"small\"\n color={getArrowButtonColor(isPrevPageDisabled)}\n aria-hidden=\"true\"\n />\n </ArrowButton>\n <Flex gap=\"4px\" style={{ minWidth: '44px', userSelect: 'none' }}>\n <CurrentPage>{activePage}</CurrentPage>/ {totalLastPage}\n </Flex>\n <ArrowButton\n disabled={getArrowButtonDisabled(isNextPageDisabled)}\n onClick={onClickNextPage}\n aria-label=\"다음 페이지로 이동\"\n >\n <IconArrow2Right\n size=\"small\"\n color={getArrowButtonColor(isNextPageDisabled)}\n aria-hidden=\"true\"\n />\n </ArrowButton>\n </CompactPaginationContainer>\n );\n}\n"],"names":["activePage","totalItemCount","infinite","pageRangeDisplayed","itemCountPerPage","className","role","disabled","onClick","size","color","gap","style","minWidth","userSelect","children"],"mappings":";;;;;;;;AAeO;AAOoB;AANzBA;;AACAC;;;;AAGAC;;;AAUEF;AACAC;AACAE;AACAC;AACF;;;;;;AAEA;AAAoC;AACE;AAEtC;;;;AAMA;;;;AAMA;AAEA;AACE;AACE;AACF;AACA;AACE;AACF;AACA;;AAGF;AACE;AACE;AACF;AACA;AACE;AACF;;;;AAMEC;AACAC;AACA;;AAGEC;AACAC;AACA;;AAGEC;AACAC;;;AAEA;AAEEC;AAAUC;AAASC;AAAkBC;;;AAC7BC;;AAA2C;AAGvDR;AACAC;AACA;;AAGEC;AACAC;;;AAEA;AACU;AAGpB;;"}
|
package/dist/src/index.cjs.js
CHANGED
|
@@ -6,11 +6,11 @@ var index$1 = require('./Buttons/Button/index.cjs.js');
|
|
|
6
6
|
var utils = require('./Badge/utils.cjs.js');
|
|
7
7
|
var Badge = require('./Badge/Badge.cjs.js');
|
|
8
8
|
var style = require('./Badge/style.cjs.js');
|
|
9
|
-
var index$
|
|
10
|
-
var index$
|
|
9
|
+
var index$4 = require('./Common/Divider/index.cjs.js');
|
|
10
|
+
var index$2 = require('./Common/Flex/index.cjs.js');
|
|
11
11
|
var index$5 = require('./Common/Grid/index.cjs.js');
|
|
12
12
|
var index$6 = require('./Common/Spinner/index.cjs.js');
|
|
13
|
-
var index$
|
|
13
|
+
var index$3 = require('./Common/Typography/index.cjs.js');
|
|
14
14
|
var styles$1 = require('./Common/Typography/styles.cjs.js');
|
|
15
15
|
var Checkbox = require('./Control/Checkbox.cjs.js');
|
|
16
16
|
var Toggle = require('./Control/Toggle.cjs.js');
|
|
@@ -39,11 +39,11 @@ exports.Button = index$1;
|
|
|
39
39
|
exports.badgePseudo = utils.badgePseudo;
|
|
40
40
|
exports.Badge = Badge.Badge;
|
|
41
41
|
exports.getBadgePseudoCss = style.getBadgePseudoCss;
|
|
42
|
-
exports.Divider = index$
|
|
43
|
-
exports.Flex = index$
|
|
42
|
+
exports.Divider = index$4.Divider;
|
|
43
|
+
exports.Flex = index$2;
|
|
44
44
|
exports.Grid = index$5.Grid;
|
|
45
45
|
exports.Spinner = index$6.Spinner;
|
|
46
|
-
exports.Typography = index$
|
|
46
|
+
exports.Typography = index$3;
|
|
47
47
|
exports.StyledTypography = styles$1.StyledTypography;
|
|
48
48
|
exports.Checkbox = Checkbox.Checkbox;
|
|
49
49
|
exports._Checkbox = Checkbox._Checkbox;
|
package/dist/src/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ export { badgePseudo } from './Badge/utils.esm.js';
|
|
|
5
5
|
export { Badge } from './Badge/Badge.esm.js';
|
|
6
6
|
export { getBadgePseudoCss } from './Badge/style.esm.js';
|
|
7
7
|
export { Divider } from './Common/Divider/index.esm.js';
|
|
8
|
-
export { Flex } from './Common/Flex/index.esm.js';
|
|
8
|
+
export { default as Flex } from './Common/Flex/index.esm.js';
|
|
9
9
|
export { Grid } from './Common/Grid/index.esm.js';
|
|
10
10
|
export { Spinner } from './Common/Spinner/index.esm.js';
|
|
11
11
|
export { default as Typography } from './Common/Typography/index.esm.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remember-web/primitive",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Remember Web Primitive Components",
|
|
5
5
|
"homepage": "https://dramancompany.github.io/remember-web-packages/",
|
|
6
6
|
"author": "Remember",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@radix-ui/react-tooltip": "^1.0.7",
|
|
45
45
|
"@remember-web/icon": "^0.1.9",
|
|
46
46
|
"@remember-web/mixin": "^0.1.15",
|
|
47
|
-
"@remember-web/shared": "^0.1.
|
|
47
|
+
"@remember-web/shared": "^0.1.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/core": "^7.24.4",
|
|
@@ -56,7 +56,7 @@ export const AnchorButton: Story = {
|
|
|
56
56
|
isIconName(iconString) &&
|
|
57
57
|
createElement(getIconComponentFromName(iconString));
|
|
58
58
|
|
|
59
|
-
return <Button {...args} icon={iconElement} as="a" href="#" />;
|
|
59
|
+
return <Button {...(args as any)} icon={iconElement} as="a" href="#" />;
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { ForwardedRef } from 'react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import type
|
|
5
|
+
import { type PolymorphicComponent } from 'styled-components';
|
|
6
6
|
|
|
7
7
|
import { Spinner } from '@/Common';
|
|
8
8
|
|
|
@@ -10,10 +10,7 @@ import { SPINNER_SIZE_MAP } from './const';
|
|
|
10
10
|
import { StyledButton } from './styles';
|
|
11
11
|
import type { ButtonProps } from './types';
|
|
12
12
|
|
|
13
|
-
const Button
|
|
14
|
-
HTMLButtonElement,
|
|
15
|
-
ButtonProps<'button'> & As<ElementType>
|
|
16
|
-
> = (
|
|
13
|
+
const Button = forwardRef(function (
|
|
17
14
|
{
|
|
18
15
|
children,
|
|
19
16
|
color,
|
|
@@ -25,37 +22,33 @@ const Button: ForwardRefRenderFunction<
|
|
|
25
22
|
icon,
|
|
26
23
|
iconPosition = 'left',
|
|
27
24
|
...props
|
|
28
|
-
},
|
|
29
|
-
ref
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
25
|
+
}: ButtonProps,
|
|
26
|
+
ref: ForwardedRef<HTMLButtonElement | null>
|
|
27
|
+
) {
|
|
28
|
+
return (
|
|
29
|
+
<StyledButton
|
|
30
|
+
$color={color}
|
|
31
|
+
$size={size}
|
|
32
|
+
$variant={variant}
|
|
33
|
+
$layout={layout}
|
|
34
|
+
$isLoading={isLoading}
|
|
35
|
+
$filled={filled}
|
|
36
|
+
aria-live="polite"
|
|
37
|
+
aria-busy={isLoading}
|
|
38
|
+
ref={ref}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{isLoading ? (
|
|
42
|
+
<Spinner size={SPINNER_SIZE_MAP[size]} />
|
|
43
|
+
) : (
|
|
44
|
+
<>
|
|
45
|
+
{iconPosition === 'left' && icon}
|
|
46
|
+
{children}
|
|
47
|
+
{iconPosition === 'right' && icon}
|
|
48
|
+
</>
|
|
49
|
+
)}
|
|
50
|
+
</StyledButton>
|
|
51
|
+
);
|
|
52
|
+
}) as PolymorphicComponent<'web', ButtonProps>;
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
props: { as?: T | null } & ButtonProps<T> & {
|
|
57
|
-
ref?: React.ComponentPropsWithRef<T>['ref'];
|
|
58
|
-
}
|
|
59
|
-
) => React.ReactElement | null;
|
|
60
|
-
|
|
61
|
-
export default forwardRef(Button) as ButtonComponentWithRef;
|
|
54
|
+
export default Button;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import type { DataAttributes } from 'styled-components';
|
|
4
|
-
import styled, { css } from 'styled-components';
|
|
5
3
|
import {
|
|
6
4
|
bg100,
|
|
7
5
|
disabled,
|
|
@@ -9,11 +7,12 @@ import {
|
|
|
9
7
|
primary100,
|
|
10
8
|
primary200,
|
|
11
9
|
} from '@remember-web/mixin';
|
|
10
|
+
import styled, { css } from 'styled-components';
|
|
12
11
|
|
|
13
12
|
import { BUTTON_COLORS, BUTTON_SIZES, ICON_GAP_MAP } from './const';
|
|
14
13
|
import type { ButtonStyleProps } from './types';
|
|
15
14
|
|
|
16
|
-
export const StyledButton = styled.button<ButtonStyleProps
|
|
15
|
+
export const StyledButton = styled.button<ButtonStyleProps>(
|
|
17
16
|
({ $size, $layout, $color, ...props }) => [
|
|
18
17
|
// 공용 스타일
|
|
19
18
|
css`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ElementType } from 'react';
|
|
2
|
-
import type { ConvertTransientProps } from '@remember-web/shared';
|
|
3
1
|
import type { ColorVariable } from '@remember-web/mixin';
|
|
2
|
+
import type { ConvertTransientProps } from '@remember-web/shared';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
4
|
|
|
5
5
|
export type ButtonSize = 'small' | 'medium' | 'large' | 'xLarge';
|
|
6
6
|
|
|
@@ -19,13 +19,7 @@ export interface ButtonStyleProps {
|
|
|
19
19
|
$filled?: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
type
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
keyof ButtonStyleProps | 'icon' | 'iconPosition'
|
|
27
|
-
> &
|
|
28
|
-
ConvertProps & {
|
|
29
|
-
icon?: React.ReactNode;
|
|
30
|
-
iconPosition?: 'left' | 'right';
|
|
31
|
-
};
|
|
22
|
+
export type ButtonProps = ConvertTransientProps<Partial<ButtonStyleProps>> & {
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
iconPosition?: 'left' | 'right';
|
|
25
|
+
} & ComponentProps<'button'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import type { CSSProperties, ElementType, HTMLAttributes } from 'react';
|
|
4
|
-
import styled, { css } from 'styled-components';
|
|
5
3
|
import type { ConvertTransientProps } from '@remember-web/shared';
|
|
4
|
+
import type { CSSProperties, ComponentProps, ForwardedRef } from 'react';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import type { PolymorphicComponent } from 'styled-components';
|
|
7
|
+
import styled, { css } from 'styled-components';
|
|
6
8
|
|
|
7
|
-
export interface
|
|
8
|
-
as?: ElementType;
|
|
9
|
+
export interface FlexStyledProps extends ComponentProps<'div'> {
|
|
9
10
|
$align?: CSSProperties['alignItems'];
|
|
10
11
|
$direction?: CSSProperties['flexDirection'];
|
|
11
12
|
$justify?: CSSProperties['justifyContent'];
|
|
@@ -15,7 +16,7 @@ export interface FlexProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
15
16
|
$height?: string | number;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
const StyledFlex = styled.div<Partial<
|
|
19
|
+
const StyledFlex = styled.div<Partial<FlexStyledProps>>(
|
|
19
20
|
({
|
|
20
21
|
$align = 'center',
|
|
21
22
|
$direction = 'row',
|
|
@@ -47,26 +48,26 @@ const StyledFlex = styled.div<Partial<FlexProps>>(
|
|
|
47
48
|
* @prop {CSSProperties['flexDirection']} direction
|
|
48
49
|
* @prop {CSSProperties['flexWrap']} wrap
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
width,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
51
|
+
|
|
52
|
+
const Flex = forwardRef(function (
|
|
53
|
+
{ width, height, direction, gap, align, justify, wrap, ...props }: FlexProps,
|
|
54
|
+
ref: ForwardedRef<HTMLDivElement | null>
|
|
55
|
+
) {
|
|
56
|
+
return (
|
|
57
|
+
<StyledFlex
|
|
58
|
+
ref={ref}
|
|
59
|
+
$width={width}
|
|
60
|
+
$height={height}
|
|
61
|
+
$direction={direction}
|
|
62
|
+
$gap={gap}
|
|
63
|
+
$align={align}
|
|
64
|
+
$justify={justify}
|
|
65
|
+
$wrap={wrap}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}) as PolymorphicComponent<'web', FlexProps>;
|
|
70
|
+
|
|
71
|
+
type FlexProps = ConvertTransientProps<FlexStyledProps>;
|
|
72
|
+
|
|
73
|
+
export default Flex;
|
|
@@ -1,54 +1,41 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { type TypographyStyle } from '@remember-web/mixin';
|
|
3
4
|
import type {
|
|
4
|
-
ComponentPropsWithoutRef,
|
|
5
|
-
ComponentPropsWithRef,
|
|
6
5
|
CSSProperties,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ComponentProps,
|
|
7
|
+
ForwardedRef,
|
|
9
8
|
ReactNode,
|
|
10
9
|
} from 'react';
|
|
11
10
|
import { forwardRef } from 'react';
|
|
12
|
-
import {
|
|
11
|
+
import type { PolymorphicComponent } from 'styled-components';
|
|
13
12
|
|
|
14
13
|
import { StyledTypography } from './styles';
|
|
15
14
|
|
|
16
|
-
const Typography =
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
$ellipsis={ellipsis}
|
|
34
|
-
$maxWidth={maxWidth}
|
|
35
|
-
{...props}
|
|
36
|
-
>
|
|
37
|
-
{children}
|
|
38
|
-
</StyledTypography>
|
|
39
|
-
);
|
|
15
|
+
const Typography = forwardRef(function (
|
|
16
|
+
{ variant, color, children, ellipsis, maxWidth, ...props }: TypographyProps,
|
|
17
|
+
ref: ForwardedRef<HTMLDivElement | null>
|
|
18
|
+
) {
|
|
19
|
+
return (
|
|
20
|
+
<StyledTypography
|
|
21
|
+
ref={ref}
|
|
22
|
+
$variant={variant}
|
|
23
|
+
$color={color}
|
|
24
|
+
$ellipsis={ellipsis}
|
|
25
|
+
$maxWidth={maxWidth}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</StyledTypography>
|
|
30
|
+
);
|
|
31
|
+
}) as PolymorphicComponent<'web', TypographyProps>;
|
|
40
32
|
|
|
41
|
-
type TypographyProps
|
|
33
|
+
type TypographyProps = {
|
|
42
34
|
variant: TypographyStyle;
|
|
43
|
-
as?: T;
|
|
44
35
|
color?: string;
|
|
45
36
|
children?: ReactNode;
|
|
46
37
|
ellipsis?: number;
|
|
47
38
|
maxWidth?: CSSProperties['maxWidth'];
|
|
48
|
-
} &
|
|
49
|
-
|
|
50
|
-
type TypographyComponentWithRef = <T extends ElementType = 'div'>(
|
|
51
|
-
props: TypographyProps<T> & { ref?: ComponentPropsWithRef<T>['ref'] }
|
|
52
|
-
) => ReactElement | null;
|
|
39
|
+
} & ComponentProps<'div'>;
|
|
53
40
|
|
|
54
|
-
export default
|
|
41
|
+
export default Typography;
|
package/src/Common/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { DialogContentProps, DialogProps } from '@radix-ui/react-dialog';
|
|
|
4
4
|
import { Root, Trigger, Close, Portal } from '@radix-ui/react-dialog';
|
|
5
5
|
import { IconClose, PictogramAlert, PictogramCheck } from '@remember-web/icon';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import Flex from '@/Common/Flex';
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
DialogContent,
|