@fe-free/core 2.8.15 → 3.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: theme
8
+ - @fe-free/tool@3.0.1
9
+
10
+ ## 3.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - feat: theme
15
+
16
+ ### Patch Changes
17
+
18
+ - @fe-free/tool@3.0.0
19
+
3
20
  ## 2.8.15
4
21
 
5
22
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "2.8.15",
3
+ "version": "3.0.1",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -41,7 +41,7 @@
41
41
  "safe-stable-stringify": "^2.5.0",
42
42
  "vanilla-jsoneditor": "^0.23.1",
43
43
  "zustand": "^4.5.4",
44
- "@fe-free/tool": "2.8.15"
44
+ "@fe-free/tool": "3.0.1"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@ant-design/pro-components": "2.8.9",
package/src/crud/crud.tsx CHANGED
@@ -118,7 +118,7 @@ function CRUDComponent<
118
118
  const disabled = readProps?.operateIsDisabled?.(record) || false;
119
119
  if (disabled) {
120
120
  btns.push(
121
- <span key="read" className="cursor-not-allowed text-desc">
121
+ <span key="read" className="cursor-not-allowed text-03">
122
122
  {readProps?.operateText || '查看'}
123
123
  </span>,
124
124
  );
@@ -144,7 +144,7 @@ function CRUDComponent<
144
144
  const disabled = readProps?.operateIsDisabled?.(record) || false;
145
145
  if (disabled) {
146
146
  btns.push(
147
- <span key="read" className="cursor-not-allowed text-desc">
147
+ <span key="read" className="cursor-not-allowed text-03">
148
148
  {readProps?.operateText || '查看'}
149
149
  </span>,
150
150
  );
@@ -169,7 +169,7 @@ function CRUDComponent<
169
169
 
170
170
  if (disabled) {
171
171
  btns.push(
172
- <span key="update" className="cursor-not-allowed text-desc">
172
+ <span key="update" className="cursor-not-allowed text-03">
173
173
  {updateProps?.operateText || '编辑'}
174
174
  </span>,
175
175
  );
@@ -39,7 +39,7 @@ function OperateDelete(props: Params) {
39
39
  const { doDelete } = useDelete({ name, desc, onDelete, operateText });
40
40
 
41
41
  if (disabled) {
42
- return <span className="text-desc cursor-not-allowed">{operateText || '删除'}</span>;
42
+ return <span className="cursor-not-allowed text-03">{operateText || '删除'}</span>;
43
43
  }
44
44
 
45
45
  return (
@@ -22,7 +22,7 @@ CRUDOfList 组件。(简洁的列表形态的 CRUD 组件)
22
22
  decorators: [
23
23
  (Story) => {
24
24
  return (
25
- <div className="fec-border h-[500px] w-[300px] overflow-y-auto">
25
+ <div className="h-[500px] w-[300px] overflow-y-auto border border-01">
26
26
  <Story />
27
27
  </div>
28
28
  );
@@ -110,10 +110,10 @@ function useDropdown({ items, renderItem, onSelect, editorRef }) {
110
110
  left: `${position.left}px`,
111
111
  }}
112
112
  >
113
- {items.length === 0 && <div className="p-2 text-sm text-desc">暂无数据</div>}
113
+ {items.length === 0 && <div className="p-2 text-sm text-03">暂无数据</div>}
114
114
  {items.map((group, i) => (
115
115
  <div key={group.label}>
116
- <div className="p-2 text-sm text-desc">{group.label}</div>
116
+ <div className="p-2 text-sm text-03">{group.label}</div>
117
117
  <div>
118
118
  {group.options.map((item) => (
119
119
  <div
@@ -332,7 +332,7 @@ const EditorMention = ({
332
332
  onInput={handleInput}
333
333
  onKeyDown={handleKeyDown}
334
334
  className={classNames(
335
- 'fec-border w-full flex-1 overflow-y-auto rounded p-2 outline-none focus:border-primary',
335
+ 'w-full flex-1 overflow-y-auto rounded border border-01 p-2 outline-none focus:border-primary',
336
336
  resizeHeight && 'resize-y',
337
337
  )}
338
338
  style={{
@@ -57,7 +57,7 @@ function FileCard({
57
57
  <FileIcon name={name} className="text-4xl" />
58
58
  <div className={classNames('flex flex-col', { 'items-center': direction === 'vertical' })}>
59
59
  {name && <div className="truncate">{name}</div>}
60
- {size && <div className="text-sm text-desc">{getFileSize(size)}</div>}
60
+ {size && <div className="text-sm text-03">{getFileSize(size)}</div>}
61
61
  </div>
62
62
  </div>
63
63
  );
package/src/index.ts CHANGED
@@ -57,6 +57,7 @@ export { Table } from './table';
57
57
  export type { TableProps } from './table';
58
58
  export { Tabs } from './tabs';
59
59
  export type { TabsProps } from './tabs';
60
+ export { themeVariables } from './theme';
60
61
  export { FileTree, Tree, flatToTreeData } from './tree';
61
62
  export type { FileTreeProps, TreeProps } from './tree';
62
63
  export { useLocalforageState } from './use_localforage_state';
@@ -103,8 +103,8 @@ const InfiniteListBase = <D, P>({
103
103
  </div>
104
104
  )}
105
105
  <div className="flex w-full items-center justify-center">
106
- {noMore && <div className="my-5 text-center text-desc">没有更多数据</div>}
107
- {loadingMore && <div className="my-5 text-center text-desc">加载更多数据中...</div>}
106
+ {noMore && <div className="my-5 text-center text-03">没有更多数据</div>}
107
+ {loadingMore && <div className="my-5 text-center text-03">加载更多数据中...</div>}
108
108
  </div>
109
109
  </div>
110
110
  );
@@ -85,7 +85,7 @@ function RecordArray(props: RecordArrayProps) {
85
85
 
86
86
  return (
87
87
  <ProFormListHelper
88
- className={classNames('fec-bg rounded p-2', className)}
88
+ className={classNames('rounded bg-005 p-2', className)}
89
89
  value={value}
90
90
  onChange={onChange}
91
91
  getAdd={() => ({
package/src/style.scss CHANGED
@@ -12,35 +12,3 @@
12
12
 
13
13
  /* stylelint-disable-next-line at-rule-no-unknown */
14
14
  @tailwind utilities;
15
-
16
- .fec-border {
17
- border: 1px solid #f0f0f0;
18
- }
19
-
20
- .fec-border-bottom {
21
- border-bottom: 1px solid #f0f0f0;
22
- }
23
-
24
- .fec-border-top {
25
- border-top: 1px solid #f0f0f0;
26
- }
27
-
28
- .fec-border-left {
29
- border-left: 1px solid #f0f0f0;
30
- }
31
-
32
- .fec-border-right {
33
- border-right: 1px solid #f0f0f0;
34
- }
35
-
36
- .fec-bg {
37
- background-color: #f3f5f6;
38
- }
39
-
40
- .fec-bg-hover {
41
- background-color: #f3f5f6;
42
-
43
- &:hover {
44
- background-color: #e9ebec;
45
- }
46
- }
@@ -0,0 +1,14 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ import { themeVariables } from './theme';
3
+
4
+ module.exports = {
5
+ theme: {
6
+ extend: {
7
+ colors: themeVariables.color,
8
+ textColor: themeVariables.textColor,
9
+ borderColor: themeVariables.borderColor,
10
+ backgroundColor: themeVariables.backgroundColor,
11
+ },
12
+ },
13
+ plugins: [],
14
+ };
@@ -6,19 +6,62 @@ export default {
6
6
  export const Default = () => {
7
7
  return (
8
8
  <div>
9
- <div>@fe-free/core 扩展的</div>
9
+ <div>@fe-free/core 扩展的 </div>
10
+ <h1>tailwindcss</h1>
11
+ <h2>textColor</h2>
10
12
  <div>
11
- <div className="text-primary">text-primary</div>
12
- <div className="text-secondary">text-secondary</div>
13
- <div className="text-desc">text-desc</div>
13
+ <div className="bg-black px-2 text-00">text-00</div>
14
+ <div className="text-01">text-01</div>
15
+ <div className="text-02">text-02</div>
16
+ <div className="text-03">text-03</div>
17
+ <div className="text-04">text-04</div>
14
18
  </div>
19
+ <h2>borderColor</h2>
20
+ <div className="space-y-2">
21
+ <div className="border border-solid border-01">border-01</div>
22
+ <div className="border border-solid border-02">border-02</div>
23
+ <div className="border border-solid border-03">border-03</div>
24
+ </div>
25
+ <h2>backgroundColor</h2>
26
+ <div>
27
+ <div className="bg-00">bg-00</div>
28
+ <div className="bg-005">bg-005</div>
29
+ <div className="bg-01">bg-01</div>
30
+ <div className="bg-02">bg-02</div>
31
+ <div className="bg-03">bg-03</div>
32
+ </div>
33
+ <h2>colors</h2>
34
+ <div>
35
+ <div className="bg-primary">bg-primary</div>
36
+ </div>
37
+ <h2>colors - themeColor</h2>
38
+ <div>
39
+ <div className="bg-theme09">theme09</div>
40
+ <div className="bg-theme08">theme08</div>
41
+ <div className="bg-theme05">theme05</div>
42
+ <div className="bg-theme03">theme03</div>
43
+ <div className="bg-theme02">theme02</div>
44
+ </div>
45
+ <h2>colors - redColor</h2>
46
+ <div>
47
+ <div className="bg-red09">red09</div>
48
+ <div className="bg-red08">red08</div>
49
+ <div className="bg-red05">red05</div>
50
+ <div className="bg-red03">red03</div>
51
+ </div>
52
+ <h2>colors - greenColor</h2>
53
+ <div>
54
+ <div className="bg-green09">green09</div>
55
+ <div className="bg-green08">green08</div>
56
+ <div className="bg-green05">green05</div>
57
+ <div className="bg-green03">green03</div>
58
+ </div>
59
+ <h2>colors - yellowColor</h2>
15
60
  <div>
16
- <div className="fec-border-bottom">fec-border-bottom</div>
17
- <div className="fec-border-top">fec-border-top</div>
18
- <div className="fec-border-left">fec-border-left</div>
19
- <div className="fec-border-right">fec-border-right</div>
20
- <div className="fec-bg">fec-bg</div>
21
- <div className="fec-bg-hover">fec-bg-hover</div>
61
+ <div className="bg-yellow09">yellow09</div>
62
+ <div className="bg-yellow08">yellow08</div>
63
+ <div className="bg-yellow05">yellow05</div>
64
+ <div className="bg-yellow03">yellow03</div>
22
65
  </div>
23
66
  </div>
24
67
  );
package/src/theme.ts ADDED
@@ -0,0 +1,48 @@
1
+ const themeVariables = {
2
+ color: {
3
+ primary: '#0374e9',
4
+
5
+ // 目前是主题蓝
6
+ theme09: '#0368d2',
7
+ theme08: '#0374e9',
8
+ theme05: '#a2cbf7',
9
+ theme03: '#e6f1fd',
10
+ theme02: '#f0f7fe',
11
+
12
+ red09: '#e64547',
13
+ red08: '#ff4d4f',
14
+ red05: '#ffb8b9',
15
+ red03: '#ffeded',
16
+
17
+ green09: '#01a468',
18
+ green08: '#01b673',
19
+ green05: '#9be5c8',
20
+ green03: '#ddf9ec',
21
+
22
+ yellow09: '#bf7a05',
23
+ yellow08: '#faad14',
24
+ yellow05: '#eecf9b',
25
+ yellow03: '#f6e7cd',
26
+ },
27
+ textColor: {
28
+ '00': '#ffffff',
29
+ '01': '#15191e',
30
+ '02': '#444444',
31
+ '03': '#777777',
32
+ '04': '#94999f',
33
+ },
34
+ borderColor: {
35
+ '01': '#e2e7f0',
36
+ '02': '#d5dde9',
37
+ '03': '#c0c7d2',
38
+ },
39
+ backgroundColor: {
40
+ '00': '#ffffff',
41
+ '005': '#f1f3f5',
42
+ '01': '#ececec',
43
+ '02': '#d9d9d9',
44
+ '03': '#c0c0c0',
45
+ },
46
+ } as const;
47
+
48
+ export { themeVariables };
@@ -8,7 +8,7 @@ const meta: Meta<typeof FileTree> = {
8
8
  decorators: [
9
9
  (Story) => {
10
10
  return (
11
- <div className="fec-border w-[200px] overflow-y-auto">
11
+ <div className="w-[200px] overflow-y-auto border border-01">
12
12
  <Story />
13
13
  </div>
14
14
  );
@@ -22,6 +22,7 @@ type Story = StoryObj<typeof meta>;
22
22
  export const Default: Story = {
23
23
  args: {
24
24
  title: '某某公司',
25
+ titleDescription: '某某公司的描述',
25
26
  enableSearch: true,
26
27
  actions: ['create', 'update', 'delete'],
27
28
  requestCreateByValues: (values) => {
@@ -106,7 +106,7 @@ function More({
106
106
  actions?.includes('create') &&
107
107
  !isCreateHidden && {
108
108
  label: isCreateDisabled ? (
109
- <div className="cursor-not-allowed text-desc">新建子目录</div>
109
+ <div className="cursor-not-allowed text-03">新建子目录</div>
110
110
  ) : (
111
111
  <Detail
112
112
  action="create"
@@ -120,7 +120,7 @@ function More({
120
120
  actions?.includes('update') &&
121
121
  !isUpdateHidden && {
122
122
  label: isUpdateDisabled ? (
123
- <div className="cursor-not-allowed text-desc">编辑</div>
123
+ <div className="cursor-not-allowed text-03">编辑</div>
124
124
  ) : (
125
125
  <Detail
126
126
  action="update"
@@ -134,7 +134,7 @@ function More({
134
134
  actions?.includes('delete') &&
135
135
  !isDeleteHidden && {
136
136
  label: isDeleteDisabled ? (
137
- <div className="cursor-not-allowed text-desc">删除</div>
137
+ <div className="cursor-not-allowed text-03">删除</div>
138
138
  ) : (
139
139
  <OperateDelete
140
140
  name={nodeData.title}
@@ -192,7 +192,7 @@ function FileTree<D extends DataNode>(props: FileTreeProps<D>) {
192
192
  />
193
193
  )}
194
194
  <div className="flex-1 truncate">{nodeData.title}</div>
195
- <div className={classNames('text-desc', { 'group-hover:hidden': hasMore })}>
195
+ <div className={classNames('text-03', { 'group-hover:hidden': hasMore })}>
196
196
  {nodeData.children?.length || 0}
197
197
  </div>
198
198
  {hasMore && (
@@ -7,7 +7,7 @@ const meta: Meta<typeof Tree> = {
7
7
  tags: ['autodocs'],
8
8
  decorators: [
9
9
  (Story) => (
10
- <div className="fec-border w-[300px]">
10
+ <div className="w-[300px] border border-01">
11
11
  <Story />
12
12
  </div>
13
13
  ),
package/src/tree/tree.tsx CHANGED
@@ -187,7 +187,7 @@ function Tree<T extends DataNode>(props: TreeProps<T>) {
187
187
  <div className="flex gap-2 px-2">
188
188
  <div className="flex-1">
189
189
  <div className="truncate">{title}</div>
190
- {titleDescription && <div className="text-desc">{titleDescription}</div>}
190
+ {titleDescription && <div className="text-03">{titleDescription}</div>}
191
191
  </div>
192
192
  {titleExtra}
193
193
  </div>
@@ -141,13 +141,13 @@ function UploadDragger(props: ImageUploadDraggerProps) {
141
141
  <p className={classNames('ant-upload-drag-icon')}>
142
142
  <InboxOutlined
143
143
  className={classNames({
144
- '!text-desc': isDisabled,
144
+ '!text-03': isDisabled,
145
145
  })}
146
146
  />
147
147
  </p>
148
148
  <p
149
149
  className={classNames('ant-upload-text', {
150
- '!text-desc': isDisabled,
150
+ '!text-03': isDisabled,
151
151
  })}
152
152
  >
153
153
  点击或拖拽到此区域进行上传
@@ -1,15 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- module.exports = {
3
- theme: {
4
- extend: {
5
- colors: {
6
- primary: '#1677ff',
7
- /** 次要文本 */
8
- secondary: 'rgba(0, 0, 0, 0.65)',
9
- /** 描述文本 */
10
- desc: 'rgba(0, 0, 0, 0.45)',
11
- },
12
- },
13
- },
14
- plugins: [],
15
- };