@soul-refiner/design-system 2.14.35 → 2.14.36
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/README.md +88 -0
- package/dist/components/input/calendar/calendar.js +11 -15
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Soul Refiner Design System
|
|
2
|
+
|
|
3
|
+
A centralized, reusable design system used across all Soul Refiner web applications to maintain visual consistency, streamline development, and speed up feature delivery.
|
|
4
|
+
|
|
5
|
+
## Package Info
|
|
6
|
+
|
|
7
|
+
- **Name:** `@soul-refiner/design-system`
|
|
8
|
+
- **Version:** `2.14.17`
|
|
9
|
+
- **License:** MIT
|
|
10
|
+
- **Registry:** [npmjs.org](https://registry.npmjs.org)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What’s Included
|
|
15
|
+
|
|
16
|
+
This design system is built using modern, flexible libraries, making it easy to compose and extend UI components:
|
|
17
|
+
|
|
18
|
+
### Frameworks & Libraries
|
|
19
|
+
|
|
20
|
+
| Purpose | Technology |
|
|
21
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
22
|
+
| Component Library | [React](https://reactjs.org), [Styled-Components](https://styled-components.com), [MUI](https://mui.com), [Radix UI](https://www.radix-ui.com/) |
|
|
23
|
+
| Utility Styling | [TailwindCSS](https://tailwindcss.com), [tailwind-merge](https://github.com/dcastil/tailwind-merge), [tailwindcss-animate](https://github.com/jamiebuilds/tailwindcss-animate) |
|
|
24
|
+
| Rich Text | [Slate.js](https://docs.slatejs.org/), [Plate Editor](https://plate.udecode.io/) |
|
|
25
|
+
| Media Support | `react-player`, `react-h5-audio-player` |
|
|
26
|
+
| Tooling & Build | Rollup, Storybook, Prettier, Husky, Chromatic |
|
|
27
|
+
| Emoji Support | Emoji Mart |
|
|
28
|
+
| Drag-and-Drop | `react-dnd`, `react-dnd-html5-backend` |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- Reusable UI components (inputs, buttons, tooltips, date pickers, etc.)
|
|
35
|
+
- Theme consistency across apps
|
|
36
|
+
- Built with Radix UI and MUI for accessibility and interactivity
|
|
37
|
+
- TypeScript support with full typings
|
|
38
|
+
- Easy integration with apps using `next`, `react`, `styled-components`
|
|
39
|
+
- Visual testing with Storybook and Chromatic
|
|
40
|
+
- Documentation and live examples via Storybook
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Development Setup
|
|
45
|
+
|
|
46
|
+
### Install dependencies
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
yarn install
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Build the component library
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
yarn build
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Run Storybook locally
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
yarn storybook
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Format code
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
yarn format
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Getting Started - Adding the design system to your application
|
|
73
|
+
|
|
74
|
+
### 1. Install via npm
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm install @soul-refiner/design-system
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### or using yarn
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
yarn add @soul-refiner/design-system
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Important to note: Issues with Storybook and Fixes
|
|
87
|
+
|
|
88
|
+
- [Clickup Doc](https://app.clickup.com/24491279/v/dc/qbd8f-2130/qbd8f-8793)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var React=require("react"),styled=require("styled-components"),date$1=require("../../../common/date.js"),
|
|
2
|
+
"use strict";var React=require("react"),styled=require("styled-components"),date$1=require("../../../common/date.js"),paragraph=require("../../atoms/typography/paragraph.js"),chevron_left=require("../../../icons/arrow/chevron_left.js"),chevron_right=require("../../../icons/arrow/chevron_right.js"),calendar=require("../../../icons/time/calendar.js"),date=require("../../../utils/date.js");function _interopDefaultCompat(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultCompat(React);const CalendarInput=({selectedDate:l,onSelect:r,disablePastDates:o})=>{const d=new Date;d.setHours(0),d.setMinutes(0),d.setSeconds(0),d.setMilliseconds(0),new Date(d).setDate(1);const t=React__default.default.useRef(null),[e,n]=React__default.default.useState(!1),[i,a]=React__default.default.useState(()=>l?.toDateString()||(new Date).toDateString());React__default.default.useEffect(()=>{l&&a(l.toDateString())},[l]);var u=()=>n(e=>!e);const c=React__default.default.useCallback(e=>{var e=e.currentTarget,t=e.getAttribute("data-day"),a=e.getAttribute("data-month"),e=e.getAttribute("data-year");t&&a&&e&&(a=new Date(a+`/${t}/`+e),r(a),requestAnimationFrame(()=>{n(!1)}))},[]);var s=date.buildCalendar(new Date(i).getMonth()+1,new Date(i).getFullYear()),f=React__default.default.useMemo(()=>{var e,t,a;return l?([e,t,a]=(l||new Date).toLocaleString("default",{year:"2-digit",month:"2-digit",day:"2-digit"}).split("/"),e+` / ${t} / `+a):""},[l]);return React__default.default.createElement(Wrapper,{onBlurCapture:e=>{t?.current&&!t?.current?.contains(e.relatedTarget)&&n(!1)},ref:t,tabIndex:0},React__default.default.createElement(InputWrapper,null,React__default.default.createElement(Input,{value:f,onFocus:u,style:{letterSpacing:"1px",fontSize:"16px",lineHeight:"24px"},readOnly:!0}),React__default.default.createElement(calendar.Calendar,{onClick:u})),e&&React__default.default.createElement(DateSelector,null,React__default.default.createElement(InnerWrapper,null,React__default.default.createElement("div",null,React__default.default.createElement(MonthBar,null,React__default.default.createElement(Arrow,{onClick:()=>{a(e=>{e=new Date(e);return e.setMonth(e.getMonth()-1),e.toDateString()})}},React__default.default.createElement(chevron_left.ChevronLeft,{size:24})),React__default.default.createElement(paragraph.P,null,Object.values(date$1.MONTHS)[Math.max(0,Math.min(new Date(i).getMonth(),11))]+" "+new Date(i).getFullYear()),React__default.default.createElement(Arrow,{onClick:()=>{a(e=>{e=new Date(e);return e.setMonth(e.getMonth()+1),e.toDateString()})}},React__default.default.createElement(chevron_right.ChevronRight,{size:24}))),React__default.default.createElement(WeekdayWrapper,null,Object.values(date$1.WEEKDAYS).map(e=>React__default.default.createElement(paragraph.P,{key:e},e))),React__default.default.createElement(Calendar,null,s.map((e,t)=>React__default.default.createElement(Week,{key:"week-"+t.toString(36)},e.map((e,t)=>{var a=new Date(`${e[1]}/${e[2]}/`+e[0]),r=0<d.getTime()-a.getTime(),n=e[1]!==date.zeroPad(new Date(i).getMonth()+1,2),r=o?r:n,n=Math.abs(a.getTime()-d.getTime())<.5,a=l&&l.getTime()===a.getTime();return React__default.default.createElement(Day,{className:((n?"today":"")+(r?" not-current":"")+(a?" selected":"")).trim(),"data-day":e[2],"data-month":e[1],"data-year":e[0],key:"day-"+t.toString(36),onClick:c},(""+e[2]).startsWith("0")?(""+e[2])[1]:e[2])}))))))))},Wrapper=styled.styled.div`
|
|
3
3
|
position: relative;
|
|
4
4
|
width: fit-content;
|
|
5
5
|
font-family: var(--font-inter);
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.25);
|
|
13
13
|
`,InnerWrapper=styled.styled.div`
|
|
14
14
|
display: flex;
|
|
15
|
-
gap:
|
|
16
|
-
padding:
|
|
15
|
+
gap: 20px;
|
|
16
|
+
padding: 20px;
|
|
17
17
|
position: relative;
|
|
18
18
|
border-radius: 25px;
|
|
19
19
|
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
display: flex;
|
|
33
33
|
justify-content: space-between;
|
|
34
34
|
align-items: center;
|
|
35
|
-
margin-bottom:
|
|
35
|
+
margin-bottom: 18px;
|
|
36
36
|
user-select: none;
|
|
37
37
|
`,Arrow=styled.styled.button`
|
|
38
38
|
appearance: none;
|
|
39
39
|
border: none;
|
|
40
40
|
outline: none;
|
|
41
|
-
padding:
|
|
41
|
+
padding: 8px;
|
|
42
42
|
display: flex;
|
|
43
43
|
justify-content: center;
|
|
44
44
|
align-items: center;
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
}
|
|
56
56
|
`,WeekdayWrapper=styled.styled.div`
|
|
57
57
|
display: flex;
|
|
58
|
-
gap:
|
|
58
|
+
gap: 20px;
|
|
59
59
|
user-select: none;
|
|
60
60
|
`,Calendar=styled.styled.div`
|
|
61
61
|
display: flex;
|
|
62
62
|
flex-direction: column;
|
|
63
|
-
gap:
|
|
64
|
-
margin:
|
|
63
|
+
gap: 16px;
|
|
64
|
+
margin: 16px 0px;
|
|
65
65
|
user-select: none;
|
|
66
66
|
`,Week=styled.styled.div`
|
|
67
67
|
display: flex;
|
|
68
|
-
gap:
|
|
68
|
+
gap: 20px;
|
|
69
69
|
border-radius: 24px;
|
|
70
70
|
`,Day=styled.styled.button`
|
|
71
71
|
outline: none;
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
display: flex;
|
|
75
75
|
align-items: center;
|
|
76
76
|
justify-content: center;
|
|
77
|
-
width:
|
|
78
|
-
height:
|
|
77
|
+
width: 28px;
|
|
78
|
+
height: 28px;
|
|
79
79
|
border-radius: 50%;
|
|
80
80
|
cursor: pointer;
|
|
81
81
|
font-family: var(--font-inter);
|
|
@@ -101,10 +101,6 @@
|
|
|
101
101
|
background-color: var(--color-blue-9);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`,BottomWrapper=styled.styled.div`
|
|
105
|
-
display: flex;
|
|
106
|
-
justify-content: flex-end;
|
|
107
|
-
gap: 18px;
|
|
108
104
|
`,Input=styled.styled.input`
|
|
109
105
|
width: 100%;
|
|
110
106
|
padding: 0px;
|