@dhua5922/react-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/dist/components/Calendar/Calendar.d.ts +9 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarContext.d.ts +9 -0
- package/dist/components/Calendar/CalendarContext.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarDay.d.ts +10 -0
- package/dist/components/Calendar/CalendarDay.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarDays.d.ts +5 -0
- package/dist/components/Calendar/CalendarDays.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarHeader.d.ts +5 -0
- package/dist/components/Calendar/CalendarHeader.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarLeft.d.ts +8 -0
- package/dist/components/Calendar/CalendarLeft.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarRight.d.ts +8 -0
- package/dist/components/Calendar/CalendarRight.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarTitle.d.ts +5 -0
- package/dist/components/Calendar/CalendarTitle.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarWeekday.d.ts +5 -0
- package/dist/components/Calendar/CalendarWeekday.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarWeekdays.d.ts +5 -0
- package/dist/components/Calendar/CalendarWeekdays.d.ts.map +1 -0
- package/dist/components/Calendar/index.d.ts +22 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Center/Center.d.ts +9 -0
- package/dist/components/Center/Center.d.ts.map +1 -0
- package/dist/components/Center/index.d.ts +2 -0
- package/dist/components/Center/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2604 -0
- package/dist/types/common.d.ts +13 -0
- package/dist/types/common.d.ts.map +1 -0
- package/package.json +96 -0
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# React Kit
|
|
2
|
+
|
|
3
|
+
A React component library workspace built with TypeScript, Vite, Storybook, and live-editable documentation.
|
|
4
|
+
|
|
5
|
+
## Documentation Site
|
|
6
|
+
|
|
7
|
+
- [https://huadylan.com/react-kit/storybook/](https://huadylan.com/react-kit/storybook/)
|
|
8
|
+
- Getting started guide: [`documentation/GETTING_STARTED.md`](/Users/dylanhua/Desktop/Coding/Personal/react-kit/documentation/GETTING_STARTED.md)
|
|
9
|
+
|
|
10
|
+
## Development
|
|
11
|
+
|
|
12
|
+
1. Install dependencies
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
yarn
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Start Storybook
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
yarn storybook
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
3. Serve the static documentation shell
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn docs:dev
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Scripts
|
|
31
|
+
|
|
32
|
+
- `npm run dev` - start the Vite dev server
|
|
33
|
+
- `npm run build` - build the package
|
|
34
|
+
- `npm run build:docs` - build Storybook into `documentation/storybook`
|
|
35
|
+
- `npm run storybook` - start Storybook locally
|
|
36
|
+
- `npm run build-storybook` - build Storybook into `storybook-static`
|
|
37
|
+
- `npm run docs:dev` - serve the `documentation/` folder locally
|
|
38
|
+
- `npm run typecheck` - run TypeScript without emitting files
|
|
39
|
+
- `npm run lint` - run ESLint on `src`
|
|
40
|
+
- `npm run test` - run Vitest
|
|
41
|
+
- `npm run validate` - run typecheck, lint, and tests
|
|
42
|
+
|
|
43
|
+
## Contribution
|
|
44
|
+
|
|
45
|
+
See [CONTRIBUTING.md](/Users/dylanhua/Desktop/Coding/Personal/react-kit/CONTRIBUTING.md)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props extends Omit<React.HTMLProps<HTMLDivElement>, 'value' | 'onChange'> {
|
|
4
|
+
value: Date;
|
|
5
|
+
onChange: (date: Date) => void;
|
|
6
|
+
}
|
|
7
|
+
declare function Calendar({ children, value, onChange, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Calendar;
|
|
9
|
+
//# sourceMappingURL=Calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/Calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,UAAU,KAAM,SAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACjF,KAAK,EAAE,IAAI,CAAA;IACX,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/B;AAED,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAiB/D;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface DefaultValue {
|
|
2
|
+
value: Date;
|
|
3
|
+
onChange: (date: Date) => void;
|
|
4
|
+
currentMonth: Date;
|
|
5
|
+
setCurrentMonth: (date: Date) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const CalendarContext: import('react').Context<DefaultValue>;
|
|
8
|
+
export default CalendarContext;
|
|
9
|
+
//# sourceMappingURL=CalendarContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarContext.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarContext.tsx"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,YAAY,EAAE,IAAI,CAAC;IACnB,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACvC;AAED,QAAA,MAAM,eAAe,uCAKH,CAAC;AAEnB,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props extends Omit<React.HTMLProps<HTMLDivElement>, 'value' | 'onClick'> {
|
|
4
|
+
value: Date;
|
|
5
|
+
onClick?: (value: Date) => void;
|
|
6
|
+
textStyle?: React.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
declare function CalendarDay({ children, value, onClick, textStyle, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default CalendarDay;
|
|
10
|
+
//# sourceMappingURL=CalendarDay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarDay.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarDay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,UAAU,KAAM,SAAQ,IAAI,CAC1B,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAC/B,OAAO,GAAG,SAAS,CACpB;IACC,KAAK,EAAE,IAAI,CAAA;IACX,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAA;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAChC;AA2BD,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAuC5E;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarDays.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarDays.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAiBzC,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,2CAkC5E;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,2CAEjC;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props extends React.HTMLProps<HTMLDivElement> {
|
|
4
|
+
onPress?: (date: Date) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function CalendarLeft({ children, onPress, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default CalendarLeft;
|
|
8
|
+
//# sourceMappingURL=CalendarLeft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarLeft.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarLeft.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,UAAU,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/B;AAED,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAe3D;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props extends React.HTMLProps<HTMLDivElement> {
|
|
4
|
+
onPress?: (date: Date) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function CalendarRight({ children, onPress, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default CalendarRight;
|
|
8
|
+
//# sourceMappingURL=CalendarRight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRight.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarRight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,UAAU,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/B;AAED,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAe5D;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarTitle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAA;AASzC,iBAAS,aAAa,CAAC,EACrB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,2CAOjC;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarWeekday.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarWeekday.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,2CAEjC;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarWeekdays.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/CalendarWeekdays.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,iBAAS,gBAAgB,CAAC,EACxB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,2CASjC;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as CalendarParent } from './Calendar';
|
|
2
|
+
import { default as CalendarDay } from './CalendarDay';
|
|
3
|
+
import { default as CalendarDays } from './CalendarDays';
|
|
4
|
+
import { default as CalendarHeader } from './CalendarHeader';
|
|
5
|
+
import { default as CalendarLeft } from './CalendarLeft';
|
|
6
|
+
import { default as CalendarRight } from './CalendarRight';
|
|
7
|
+
import { default as CalendarTitle } from './CalendarTitle';
|
|
8
|
+
import { default as CalendarWeekday } from './CalendarWeekday';
|
|
9
|
+
import { default as CalendarWeekdays } from './CalendarWeekdays';
|
|
10
|
+
|
|
11
|
+
declare const Calendar: typeof CalendarParent & {
|
|
12
|
+
Day: typeof CalendarDay;
|
|
13
|
+
Days: typeof CalendarDays;
|
|
14
|
+
Header: typeof CalendarHeader;
|
|
15
|
+
Left: typeof CalendarLeft;
|
|
16
|
+
Right: typeof CalendarRight;
|
|
17
|
+
Title: typeof CalendarTitle;
|
|
18
|
+
Weekday: typeof CalendarWeekday;
|
|
19
|
+
Weekdays: typeof CalendarWeekdays;
|
|
20
|
+
};
|
|
21
|
+
export default Calendar;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,YAAY,CAAA;AACvC,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AAEjD,QAAA,MAAM,QAAQ;;;;;;;;;CASZ,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseComponentProps } from '../../types/common';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Props extends React.HTMLProps<HTMLDivElement>, BaseComponentProps {
|
|
5
|
+
type?: 'vertical' | 'horizontal' | '';
|
|
6
|
+
}
|
|
7
|
+
declare function Center({ type, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Center;
|
|
9
|
+
//# sourceMappingURL=Center.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../../src/components/Center/Center.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,UAAU,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,kBAAkB;IACzE,IAAI,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,EAAE,CAAA;CACtC;AAkBD,iBAAS,MAAM,CAAC,EAAE,IAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAI7C;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Center/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG/C,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|