@shoplflow/base 0.4.0 → 0.6.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.
Files changed (63) hide show
  1. package/dist/animation/fadeInOut.d.ts +17 -0
  2. package/dist/components/BackDrop/BackDrop.d.ts +3 -0
  3. package/dist/components/BackDrop/BackDrop.types.d.ts +5 -0
  4. package/dist/components/BackDrop/index.d.ts +2 -0
  5. package/dist/components/Chips/ChipButton/ChipButton.d.ts +3 -0
  6. package/dist/components/Chips/ChipButton/ChipButton.styled.d.ts +8 -0
  7. package/dist/components/Chips/ChipButton/ChipButton.types.d.ts +16 -0
  8. package/dist/components/Chips/ChipButton/index.d.ts +3 -0
  9. package/dist/components/Chips/ChipToggle/ChipToggle.d.ts +3 -0
  10. package/dist/components/Chips/ChipToggle/ChipToggle.styled.d.ts +8 -0
  11. package/dist/components/Chips/ChipToggle/ChipToggle.types.d.ts +16 -0
  12. package/dist/components/Chips/ChipToggle/index.d.ts +3 -0
  13. package/dist/components/Chips/index.d.ts +2 -0
  14. package/dist/components/Modal/Modal.styled.d.ts +28 -0
  15. package/dist/components/Modal/Modal.types.d.ts +55 -0
  16. package/dist/components/Modal/ModalBody.d.ts +3 -0
  17. package/dist/components/Modal/ModalContainer.d.ts +3 -0
  18. package/dist/components/Modal/ModalFooter.d.ts +3 -0
  19. package/dist/components/Modal/ModalHeader.d.ts +3 -0
  20. package/dist/components/Modal/index.d.ts +7 -0
  21. package/dist/components/Stack/Stack.d.ts +12 -0
  22. package/dist/components/Stack/Stack.styled.d.ts +6 -0
  23. package/dist/components/Stack/Stack.types.d.ts +52 -0
  24. package/dist/components/Stack/index.d.ts +4 -0
  25. package/dist/components/Text/Text.d.ts +4 -0
  26. package/dist/components/Text/Text.styled.d.ts +6 -0
  27. package/dist/components/Text/Text.types.d.ts +23 -0
  28. package/dist/components/Text/index.d.ts +2 -0
  29. package/dist/components/index.d.ts +5 -0
  30. package/dist/{index.css → global.css} +4 -2
  31. package/dist/hooks/index.d.ts +6 -0
  32. package/dist/hooks/useDomain.d.ts +6 -0
  33. package/dist/hooks/useHandleModal.d.ts +5 -0
  34. package/dist/hooks/useModalStore.d.ts +15 -0
  35. package/dist/hooks/useModalValue.d.ts +3 -0
  36. package/dist/hooks/useOnToggle.d.ts +11 -0
  37. package/dist/hooks/useOutsideClick.d.ts +14 -0
  38. package/dist/hooks/useResizeObserver.d.ts +9 -0
  39. package/dist/index.cjs +176 -6877
  40. package/dist/index.d.ts +5 -212
  41. package/dist/index.mjs +178 -0
  42. package/dist/providers/ShoplflowProvider.d.ts +8 -0
  43. package/dist/providers/index.d.ts +3 -0
  44. package/dist/styles/index.d.ts +9 -0
  45. package/dist/styles/tokens.d.ts +100 -0
  46. package/dist/styles/utils/getDisabledStyle.d.ts +1 -0
  47. package/dist/types/Domain.d.ts +1 -0
  48. package/dist/utils/getNextColor.d.ts +11 -0
  49. package/dist/utils/noop.d.ts +1 -0
  50. package/dist/utils/type/$values.d.ts +1 -0
  51. package/dist/utils/type/ComponentProps.d.ts +134 -0
  52. package/package.json +55 -38
  53. package/dist/emotion.d.cjs +0 -5
  54. package/dist/emotion.d.cjs.map +0 -1
  55. package/dist/emotion.d.d.cts +0 -5
  56. package/dist/emotion.d.d.ts +0 -5
  57. package/dist/emotion.d.js +0 -3
  58. package/dist/emotion.d.js.map +0 -1
  59. package/dist/index.cjs.map +0 -1
  60. package/dist/index.css.map +0 -1
  61. package/dist/index.d.cts +0 -212
  62. package/dist/index.js +0 -6851
  63. package/dist/index.js.map +0 -1
@@ -0,0 +1,134 @@
1
+ import type { ComponentPropsWithoutRef, ElementType, ReactElement, ReactNode } from 'react';
2
+ import type React from 'react';
3
+ import type { BorderRadiusTokens, ColorTokens } from '../../styles';
4
+ /**
5
+ * HTML 태그에 대한 타입
6
+ */
7
+ export type StringElementType = ElementType & string;
8
+ /**
9
+ * Ref를 제외한 HTMLProps를 반환합니다.
10
+ * Generic으로 HTML 태그를 받습니다.
11
+ */
12
+ export type HTMLPropsWithOutRef<T extends StringElementType> = ComponentPropsWithoutRef<T>;
13
+ export interface DisableProps {
14
+ /**
15
+ * 비활성화 여부를 설정합니다.
16
+ */
17
+ disabled?: boolean;
18
+ }
19
+ export interface SelectedProps {
20
+ /**
21
+ * 선택 여부를 설정합니다.
22
+ */
23
+ isSelected?: boolean;
24
+ }
25
+ export interface DefaultSelectedProps {
26
+ /**
27
+ * 기본 선택 여부를 설정합니다.
28
+ *
29
+ * SelectedProps보다 우선적으로 적용됩니다.
30
+ */
31
+ defaultSelected?: boolean;
32
+ }
33
+ /**
34
+ * RadiusBooleanProps는 RadiusProps와 함께 사용할 수 없습니다.
35
+ */
36
+ export interface RadiusBooleanProps {
37
+ /**
38
+ * Radius를 토글할 수 있는 옵션입니다.
39
+ */
40
+ radius?: boolean;
41
+ }
42
+ export interface RadiusProps {
43
+ /**
44
+ * Radius를 설정합니다.
45
+ */
46
+ radius?: BorderRadiusTokens;
47
+ }
48
+ export type RenderConfigProps = {
49
+ /**
50
+ * 랜더하려고 하는 HTML tag로 변환할 수 있습니다.
51
+ *
52
+ * 예를 들어 a tag로 변환한다면 as='a'로 작성해주세요.
53
+ *
54
+ * @see https://emotion.sh/docs/styled#as-prop
55
+ */
56
+ as?: StringElementType;
57
+ };
58
+ export interface SizeVariantProps<Size> {
59
+ /**
60
+ * 컴포넌트의 크기를 설정합니다.
61
+ */
62
+ sizeVar?: Size;
63
+ }
64
+ export interface StyleVariantProps<Style> {
65
+ /**
66
+ * 컴포넌트의 스타일을 설정합니다.
67
+ */
68
+ styleVar?: Style;
69
+ }
70
+ export interface ChildrenProps<Children = React.ReactNode> {
71
+ /**
72
+ * 컴포넌트 내부에 들어갈 children을 설정합니다.
73
+ */
74
+ children?: Children;
75
+ }
76
+ export interface TextProps {
77
+ /**
78
+ * 텍스트를 설정합니다.
79
+ */
80
+ text?: string;
81
+ }
82
+ export interface ColorTokenProps {
83
+ /**
84
+ * 텍스트 혹은 아이콘의 색상을 설정합니다.
85
+ * styleVar이 있는 경우 메인색상을 설정합니다.
86
+ */
87
+ color?: ColorTokens;
88
+ }
89
+ export interface BorderColorProps {
90
+ /**
91
+ * 테두리의 색상을 설정합니다.
92
+ */
93
+ borderColor?: ColorTokens;
94
+ }
95
+ export interface BackgroundColorProps {
96
+ /**
97
+ * 배경의 색상을 설정합니다.
98
+ */
99
+ background?: ColorTokens;
100
+ }
101
+ export interface IconSourceProps {
102
+ /**
103
+ * Icon을 설정합니다.
104
+ */
105
+ iconSource?: HTMLOrSVGElement;
106
+ }
107
+ export interface LeftNodeProps {
108
+ /**
109
+ * 텍스트를 기준으로 왼쪽에 위치할 ReactNode를 설정합니다.
110
+ */
111
+ leftSource?: ReactNode;
112
+ }
113
+ export interface RightNodeProps {
114
+ /**
115
+ * 텍스트를 기준으로 오른쪽에 위치할 ReactNode를 설정합니다.
116
+ */
117
+ rightSource?: ReactNode;
118
+ }
119
+ export interface LeftAndRightNodeProps extends RightNodeProps, LeftNodeProps {
120
+ }
121
+ export interface LeftElementProps {
122
+ /**
123
+ * 텍스트를 기준으로 왼쪽에 위치할 ReactElement를 설정합니다.
124
+ */
125
+ leftSource?: ReactElement;
126
+ }
127
+ export interface RightElementProps {
128
+ /**
129
+ * 텍스트를 기준으로 오른쪽에 위치할 ReactElement를 설정합니다.
130
+ */
131
+ rightSource?: ReactElement;
132
+ }
133
+ export interface LeftAndRightElementProps extends RightElementProps, LeftElementProps {
134
+ }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@shoplflow/base",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
- "module": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
11
+ "import": "./dist/index.mjs",
12
12
  "require": "./dist/index.cjs"
13
13
  },
14
- "./styles": "./dist/index.css",
14
+ "./styles": "./dist/global.css",
15
15
  "./package.json": "./package.json"
16
16
  },
17
17
  "main": "dist/index.cjs",
@@ -29,48 +29,65 @@
29
29
  "react-dom": "*"
30
30
  },
31
31
  "devDependencies": {
32
- "storybook": "^7.3.1",
33
- "@babel/core": "^7.22.5",
34
- "@babel/preset-env": "^7.22.5",
35
- "@babel/preset-typescript": "^7.22.5",
36
- "@storybook/addon-actions": "^7.3.2",
37
- "@storybook/addon-backgrounds": "^7.3.2",
38
- "@storybook/addon-controls": "^7.3.2",
39
- "@storybook/addon-docs": "^7.3.1",
40
- "@storybook/addon-essentials": "^7.3.1",
41
- "@storybook/addon-interactions": "^7.3.1",
42
- "@storybook/addon-links": "^7.3.1",
43
- "@storybook/addon-mdx-gfm": "^7.3.1",
44
- "@storybook/addon-measure": "^7.3.2",
45
- "@storybook/addon-outline": "^7.3.2",
46
- "@storybook/addon-toolbars": "^7.3.2",
47
- "@storybook/addon-viewport": "^7.3.2",
48
- "@storybook/addons": "^7.3.1",
49
- "@storybook/blocks": "^7.3.1",
50
- "@storybook/react": "^7.3.1",
51
- "@storybook/react-vite": "^7.3.1",
32
+ "@babel/core": "^7.22.19",
33
+ "@babel/preset-env": "^7.22.15",
34
+ "@babel/preset-typescript": "^7.22.15",
35
+ "@emotion/react": "^11.11.1",
36
+ "@emotion/styled": "^11.11.0",
37
+ "@storybook/addon-actions": "^7.4.1",
38
+ "@storybook/addon-backgrounds": "^7.4.1",
39
+ "@storybook/addon-controls": "^7.4.1",
40
+ "@storybook/addon-docs": "^7.4.1",
41
+ "@storybook/addon-essentials": "^7.4.1",
42
+ "@storybook/addon-interactions": "^7.4.1",
43
+ "@storybook/addon-links": "^7.4.1",
44
+ "@storybook/addon-mdx-gfm": "^7.4.1",
45
+ "@storybook/addon-measure": "^7.4.1",
46
+ "@storybook/addon-outline": "^7.4.1",
47
+ "@storybook/addon-toolbars": "^7.4.1",
48
+ "@storybook/addon-viewport": "^7.4.1",
49
+ "@storybook/addons": "^7.4.1",
50
+ "@storybook/blocks": "^7.4.1",
51
+ "@storybook/react": "^7.4.1",
52
+ "@storybook/react-vite": "^7.4.1",
52
53
  "@storybook/testing-library": "^0.2.0",
53
- "@storybook/theming": "^7.3.1",
54
- "@emotion/react": "^11",
55
- "@emotion/styled": "^11",
54
+ "@storybook/theming": "^7.4.1",
56
55
  "@types/node": "20.4.9",
57
- "@types/react": "^18.0.0",
58
- "@types/react-dom": "^18.0.0",
59
- "eslint": "^8.44.0",
60
- "framer-motion": "^9.0.2",
61
- "react": "^18.0.0",
62
- "react-dom": "^18.0.0",
56
+ "@types/react": "^18.2.21",
57
+ "@types/react-dom": "^18.2.7",
58
+ "esbuild": "0.18.17",
59
+ "esbuild-plugin-babel": "^0.2.3",
60
+ "esbuild-plugin-d.ts": "^1.1.0",
61
+ "eslint": "^8.49.0",
62
+ "eslint-plugin-storybook": "^0.6.13",
63
+ "react": "^18.2.0",
64
+ "react-dom": "^18.2.0",
65
+ "storybook": "^7.4.1",
63
66
  "ts-node": "^10.9.1",
64
- "tsup": "7.2.0",
65
- "typescript": "^4.9.2"
67
+ "typescript": "^4.6.3"
68
+ },
69
+ "eslintConfig": {
70
+ "extends": [
71
+ "plugin:storybook/recommended"
72
+ ]
73
+ },
74
+ "dependencies": {
75
+ "classnames": "^2.3.2",
76
+ "framer-motion": "^9.1.7",
77
+ "react-custom-scrollbars-2": "^4.5.0",
78
+ "zustand": "^4.4.1",
79
+ "@shoplflow/utils": "^0.1.0"
66
80
  },
67
81
  "scripts": {
68
- "build:tokens": "node scripts/generate-tokens.cjs",
69
82
  "type-check": "tsc --noEmit || true",
70
- "build:package": "tsup",
83
+ "build:tokens": "node scripts/generate-tokens.cjs",
84
+ "build:package": "node build.js",
85
+ "build:component": "scripts/generate-component.sh",
71
86
  "build:storybook": "storybook build",
72
87
  "build": "pnpm run build:package && pnpm run build:storybook",
73
88
  "dev:stories": "storybook dev -p 6007",
74
- "dev": "tsup --watch"
89
+ "dev": "node build.js --watch",
90
+ "storybook": "storybook dev -p 6007",
91
+ "build-storybook": "storybook build"
75
92
  }
76
93
  }
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- // src/emotion.d.ts
4
- var import_react = require("@emotion/react");
5
- //# sourceMappingURL=emotion.d.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/emotion.d.ts"],"sourcesContent":["import '@emotion/react';\nimport type React from 'react';\ndeclare module '*.svg' {\n export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;\n}\n"],"mappings":";;;AAAA,mBAAO;","names":[]}
@@ -1,5 +0,0 @@
1
- import React__default from 'react';
2
-
3
- declare module '*.svg' {
4
- export const ReactComponent: React__default.FunctionComponent<React__default.SVGProps<SVGSVGElement>>;
5
- }
@@ -1,5 +0,0 @@
1
- import React__default from 'react';
2
-
3
- declare module '*.svg' {
4
- export const ReactComponent: React__default.FunctionComponent<React__default.SVGProps<SVGSVGElement>>;
5
- }
package/dist/emotion.d.js DELETED
@@ -1,3 +0,0 @@
1
- // src/emotion.d.ts
2
- import "@emotion/react";
3
- //# sourceMappingURL=emotion.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/emotion.d.ts"],"sourcesContent":["import '@emotion/react';\nimport type React from 'react';\ndeclare module '*.svg' {\n export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;\n}\n"],"mappings":";AAAA,OAAO;","names":[]}