techsbcn-storybook 0.26.3 → 2.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.
Files changed (163) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +92 -132
  3. package/dist/components/fields/ButtonComponent/ButtonComponent.d.ts +16 -16
  4. package/dist/components/fields/DatePickerComponent/DatePickerComponent.d.ts +26 -26
  5. package/dist/components/fields/SelectFieldComponent/SelectAsyncField.d.ts +28 -28
  6. package/dist/components/fields/SelectFieldComponent/SelectField.d.ts +29 -29
  7. package/dist/components/fields/TextFieldComponent/TextFieldComponent.d.ts +34 -34
  8. package/dist/components/fields/TextSimpleComponent/TextSimpleComponent.d.ts +32 -32
  9. package/dist/components/forms/ChangePasswordForm.d.ts +21 -21
  10. package/dist/components/forms/LoginForm.d.ts +20 -20
  11. package/dist/components/forms/ResetPasswordForm.d.ts +17 -17
  12. package/dist/components/layouts/DrawerLayout/DrawerSidebar/DrawerSidebar.d.ts +11 -11
  13. package/dist/components/layouts/MainLayoutSimple/MainLayoutSimple.d.ts +10 -10
  14. package/dist/components/layouts/Standard/AppHeader/AppHeader.d.ts +11 -11
  15. package/dist/components/layouts/Standard/AppSidebar/AppSidebar.d.ts +11 -11
  16. package/dist/components/modals/ModalComponent.d.ts +20 -20
  17. package/dist/components/navigation/VerticalNav/NavIcon.d.ts +7 -7
  18. package/dist/components/navigation/VerticalNav/VerticalNav.d.ts +23 -23
  19. package/dist/components/navigation/VerticalNav/VerticalNavItem.d.ts +9 -9
  20. package/dist/components/navigation/VerticalNav/VerticalNavItemCollapse.d.ts +9 -9
  21. package/dist/components/navigation/components/UserInfo.d.ts +12 -12
  22. package/dist/components/tables/ImageTableComponent/ImageTableComponent.d.ts +8 -8
  23. package/dist/components/tables/SearchComponent/SearchComponent.d.ts +26 -26
  24. package/dist/components/tables/SimpleTableComponent/SimpleTableComponent.d.ts +86 -86
  25. package/dist/components/tables/TableComponent/TableComponent.d.ts +89 -89
  26. package/dist/components/wrappers/CardComponent/CardComponent.d.ts +13 -13
  27. package/dist/components/wrappers/LinearProgressComponent/LinearProgressComponent.d.ts +3 -3
  28. package/dist/components/wrappers/MainWrapperComponent/MainWrapperComponent.d.ts +15 -15
  29. package/dist/components/wrappers/PublicFormWrapper/PublicFormWrapper.d.ts +8 -8
  30. package/dist/components/wrappers/TabsComponent/TabsComponent.d.ts +17 -17
  31. package/dist/helpers/CheckPermission.d.ts +1 -1
  32. package/dist/helpers/FileDownloader.d.ts +5 -5
  33. package/dist/helpers/GroupBy.d.ts +1 -1
  34. package/dist/helpers/hooks.d.ts +2 -3
  35. package/dist/helpers/index.d.ts +4 -4
  36. package/dist/index.d.ts +24 -24
  37. package/dist/index.js +2628 -5
  38. package/dist/index.js.map +1 -0
  39. package/dist/index.mjs +2576 -0
  40. package/dist/index.mjs.map +1 -0
  41. package/dist/interfaces/index.d.ts +5 -6
  42. package/dist/interfaces/search/BasicEntity.d.ts +5 -5
  43. package/dist/interfaces/search/SearchFilters.d.ts +11 -11
  44. package/dist/interfaces/search/SearchResult.d.ts +4 -4
  45. package/dist/interfaces/search/SearchSimpleResult.d.ts +5 -5
  46. package/dist/interfaces/shared/ObjectKey.d.ts +3 -3
  47. package/package.json +68 -108
  48. package/dist/data/Routes.d.ts +0 -2
  49. package/dist/data/SelectMock.d.ts +0 -11
  50. package/dist/data/UserList.d.ts +0 -19
  51. package/dist/data/Values.d.ts +0 -2
  52. package/dist/data/_globalization/es.d.ts +0 -122
  53. package/dist/data/enums/ActiveStatus.d.ts +0 -4
  54. package/dist/data/enums/scopes.d.ts +0 -5
  55. package/dist/data/index.d.ts +0 -6
  56. package/dist/i18n.d.ts +0 -2
  57. package/dist/interfaces/file/File.d.ts +0 -7
  58. package/dist/stories/Fields/Fields.stories.d.ts +0 -6
  59. package/dist/stories/Fields/TextFieldComponent.stories.d.ts +0 -4
  60. package/dist/stories/Fields/TextSimpleComponent.stories.d.ts +0 -4
  61. package/dist/stories/Forms/Forms.stories.d.ts +0 -6
  62. package/dist/stories/Layouts/MainLayoutSimple.stories.d.ts +0 -6
  63. package/dist/stories/MainWrapper/MainWrapper.stories.d.ts +0 -4
  64. package/dist/stories/Modal/Modal.stories.d.ts +0 -4
  65. package/dist/stories/Tables/SimpleTable.stories.d.ts +0 -4
  66. package/dist/stories/Tables/TableComponent.stories.d.ts +0 -4
  67. package/dist/stories/Tables/Tables.stories.d.ts +0 -5
  68. package/dist/stories/Wrappers/Card.stories.d.ts +0 -4
  69. package/dist/stories/button/Button.stories.d.ts +0 -12
  70. package/dist/techsbcn-storybook.cjs.development.js +0 -3309
  71. package/dist/techsbcn-storybook.cjs.development.js.map +0 -1
  72. package/dist/techsbcn-storybook.cjs.production.min.js +0 -2
  73. package/dist/techsbcn-storybook.cjs.production.min.js.map +0 -1
  74. package/dist/techsbcn-storybook.esm.js +0 -3281
  75. package/dist/techsbcn-storybook.esm.js.map +0 -1
  76. package/src/components/fields/ButtonComponent/ButtonComponent.scss +0 -61
  77. package/src/components/fields/ButtonComponent/ButtonComponent.tsx +0 -45
  78. package/src/components/fields/DatePickerComponent/DatePickerComponent.scss +0 -51
  79. package/src/components/fields/DatePickerComponent/DatePickerComponent.tsx +0 -92
  80. package/src/components/fields/SelectFieldComponent/SelectAsyncField.tsx +0 -113
  81. package/src/components/fields/SelectFieldComponent/SelectField.scss +0 -99
  82. package/src/components/fields/SelectFieldComponent/SelectField.tsx +0 -80
  83. package/src/components/fields/TextFieldComponent/TextFieldComponent.scss +0 -54
  84. package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +0 -114
  85. package/src/components/fields/TextSimpleComponent/TextSimpleComponent.scss +0 -67
  86. package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +0 -123
  87. package/src/components/forms/ChangePasswordForm.tsx +0 -153
  88. package/src/components/forms/LoginForm.tsx +0 -125
  89. package/src/components/forms/ResetPasswordForm.tsx +0 -75
  90. package/src/components/layouts/DrawerLayout/DrawerSidebar/DrawerSidebar.scss +0 -7
  91. package/src/components/layouts/DrawerLayout/DrawerSidebar/DrawerSidebar.tsx +0 -36
  92. package/src/components/layouts/MainLayoutSimple/MainLayoutSimple.scss +0 -9
  93. package/src/components/layouts/MainLayoutSimple/MainLayoutSimple.tsx +0 -24
  94. package/src/components/layouts/Standard/AppHeader/AppHeader.scss +0 -17
  95. package/src/components/layouts/Standard/AppHeader/AppHeader.tsx +0 -37
  96. package/src/components/layouts/Standard/AppSidebar/AppSidebar.scss +0 -7
  97. package/src/components/layouts/Standard/AppSidebar/AppSidebar.tsx +0 -66
  98. package/src/components/modals/ModalComponent.tsx +0 -89
  99. package/src/components/navigation/VerticalNav/NavIcon.tsx +0 -20
  100. package/src/components/navigation/VerticalNav/VerticalNav.scss +0 -71
  101. package/src/components/navigation/VerticalNav/VerticalNav.tsx +0 -44
  102. package/src/components/navigation/VerticalNav/VerticalNavItem.tsx +0 -46
  103. package/src/components/navigation/VerticalNav/VerticalNavItemCollapse.tsx +0 -104
  104. package/src/components/navigation/components/UserInfo.scss +0 -5
  105. package/src/components/navigation/components/UserInfo.tsx +0 -51
  106. package/src/components/tables/ImageTableComponent/ImageTableComponent.tsx +0 -45
  107. package/src/components/tables/SearchComponent/SearchComponent.scss +0 -61
  108. package/src/components/tables/SearchComponent/SearchComponent.tsx +0 -168
  109. package/src/components/tables/SimpleTableComponent/SimpleTableComponent.scss +0 -188
  110. package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +0 -524
  111. package/src/components/tables/TableComponent/TableComponent.scss +0 -275
  112. package/src/components/tables/TableComponent/TableComponent.tsx +0 -606
  113. package/src/components/wrappers/CardComponent/CardComponent.scss +0 -23
  114. package/src/components/wrappers/CardComponent/CardComponent.tsx +0 -39
  115. package/src/components/wrappers/LinearProgressComponent/LinearProgressComponent.scss +0 -17
  116. package/src/components/wrappers/LinearProgressComponent/LinearProgressComponent.tsx +0 -12
  117. package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.scss +0 -38
  118. package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +0 -55
  119. package/src/components/wrappers/PublicFormWrapper/PublicFormWrapper.scss +0 -7
  120. package/src/components/wrappers/PublicFormWrapper/PublicFormWrapper.tsx +0 -26
  121. package/src/components/wrappers/TabsComponent/TabsComponent.scss +0 -22
  122. package/src/components/wrappers/TabsComponent/TabsComponent.tsx +0 -54
  123. package/src/content/fonts/feather.eot +0 -0
  124. package/src/content/fonts/feather.svg +0 -759
  125. package/src/content/fonts/feather.ttf +0 -0
  126. package/src/content/fonts/feather.woff +0 -0
  127. package/src/content/img/icon-logo-techsbcn.svg +0 -1
  128. package/src/content/img/logo.png +0 -0
  129. package/src/data/Routes.tsx +0 -6
  130. package/src/data/SelectMock.tsx +0 -79
  131. package/src/data/UserList.tsx +0 -119
  132. package/src/data/Values.tsx +0 -106
  133. package/src/data/_globalization/es.js +0 -121
  134. package/src/data/enums/ActiveStatus.tsx +0 -4
  135. package/src/data/enums/scopes.ts +0 -5
  136. package/src/data/index.ts +0 -6
  137. package/src/helpers/CheckPermission.tsx +0 -23
  138. package/src/helpers/FileDownloader.tsx +0 -34
  139. package/src/helpers/GroupBy.tsx +0 -6
  140. package/src/helpers/hooks.tsx +0 -22
  141. package/src/helpers/index.tsx +0 -4
  142. package/src/i18n.tsx +0 -24
  143. package/src/index.tsx +0 -24
  144. package/src/interfaces/file/File.tsx +0 -8
  145. package/src/interfaces/index.tsx +0 -6
  146. package/src/interfaces/search/BasicEntity.tsx +0 -6
  147. package/src/interfaces/search/SearchFilters.tsx +0 -19
  148. package/src/interfaces/search/SearchResult.tsx +0 -4
  149. package/src/interfaces/search/SearchSimpleResult.tsx +0 -5
  150. package/src/interfaces/shared/ObjectKey.tsx +0 -3
  151. package/src/stories/Fields/Fields.stories.tsx +0 -678
  152. package/src/stories/Fields/TextFieldComponent.stories.tsx +0 -55
  153. package/src/stories/Fields/TextSimpleComponent.stories.tsx +0 -58
  154. package/src/stories/Forms/Forms.stories.tsx +0 -89
  155. package/src/stories/Layouts/MainLayoutSimple.stories.tsx +0 -330
  156. package/src/stories/MainWrapper/MainWrapper.stories.tsx +0 -193
  157. package/src/stories/Modal/Modal.stories.tsx +0 -32
  158. package/src/stories/Tables/SimpleTable.stories.tsx +0 -113
  159. package/src/stories/Tables/TableComponent.stories.tsx +0 -116
  160. package/src/stories/Tables/Tables.stories.tsx +0 -311
  161. package/src/stories/Wrappers/Card.stories.tsx +0 -85
  162. package/src/stories/button/Button.stories.tsx +0 -80
  163. package/src/styles/Globals.scss +0 -137
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 techsbcn
3
+ Copyright (c) 2026 techsbcn
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,180 +1,140 @@
1
- # TSDX React w/ Storybook User Guide
1
+ # techsbcn-storybook
2
2
 
3
- Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.
3
+ A React component library built by [TechsBCN](https://techsbcn.com) on top of Material UI. It provides a set of ready-to-use components — form fields, tables, layouts, navigation, modals and wrappers — designed to be consumed across internal projects with a consistent look and feel.
4
4
 
5
- > This TSDX setup is meant for developing React component libraries (not apps!) that can be published to NPM. If you’re looking to build a React-based app, you should use `create-react-app`, `razzle`, `nextjs`, `gatsby`, or `react-static`.
5
+ Components are developed and documented in [Storybook](https://storybook.js.org/) and shipped as an npm package.
6
6
 
7
- > If you’re new to TypeScript and React, checkout [this handy cheatsheet](https://github.com/sw-yx/react-typescript-cheatsheet/)
7
+ ## Requirements
8
8
 
9
- ## Commands
9
+ - **Node.js** `>= 18`
10
+ - **React** `>= 18` (declared as a peer dependency)
11
+ - **Yarn** (the repository is pinned to Yarn 4 via `packageManager`)
10
12
 
11
- TSDX scaffolds your new library inside `/src`, and also sets up a [Parcel-based](https://parceljs.org) playground for it inside `/example`.
12
-
13
- The recommended workflow is to run TSDX in one terminal:
13
+ ## Installation
14
14
 
15
15
  ```bash
16
- npm start # or yarn start
16
+ yarn add techsbcn-storybook
17
17
  ```
18
18
 
19
- This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
20
-
21
- Then run either Storybook or the example playground:
22
-
23
- ### Storybook
24
-
25
- Run inside another terminal:
19
+ or
26
20
 
27
21
  ```bash
28
- yarn storybook
22
+ npm install techsbcn-storybook
29
23
  ```
30
24
 
31
- This loads the stories from `./stories`.
25
+ Because MUI, Emotion, React Hook Form, Yup, i18next, dayjs and Font Awesome are runtime dependencies of this library, they are installed automatically.
32
26
 
33
- > NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
27
+ ## Usage
34
28
 
35
- ### Example
29
+ Import components directly from the package root:
36
30
 
37
- Then run the example inside another:
31
+ ```tsx
32
+ import { TextFieldComponent, ButtonComponent, TableComponent } from 'techsbcn-storybook';
38
33
 
39
- ```bash
40
- cd example
41
- npm i # or yarn to install dependencies
42
- npm start # or yarn start
34
+ export const Example = () => (
35
+ <>
36
+ <TextFieldComponent name="email" label="Email" />
37
+ <ButtonComponent onClick={() => console.log('clicked')}>Send</ButtonComponent>
38
+ </>
39
+ );
43
40
  ```
44
41
 
45
- The default example imports and live reloads whatever is in `/dist`, so if you are seeing an out of date component, make sure TSDX is running in watch mode like we recommend above. **No symlinking required**, we use [Parcel's aliasing](https://parceljs.org/module_resolution.html#aliases).
46
-
47
- To do a one-off build, use `npm run build` or `yarn build`.
48
-
49
- To run tests, use `npm test` or `yarn test`.
50
-
51
- ## Configuration
42
+ ### Available component groups
52
43
 
53
- Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
44
+ | Group | Components |
45
+ | --- | --- |
46
+ | **Fields** | `ButtonComponent`, `TextFieldComponent`, `TextSimpleComponent`, `SelectField`, `SelectAsyncField`, `DatePickerComponent` |
47
+ | **Forms** | `LoginForm`, `ChangePasswordForm`, `ResetPasswordForm` |
48
+ | **Tables** | `TableComponent`, `SimpleTableComponent`, `SearchComponent` |
49
+ | **Layouts** | `MainLayoutSimple`, `AppHeader`, `AppSidebar`, `DrawerSidebar` |
50
+ | **Navigation** | `VerticalNav`, `UserInfo` |
51
+ | **Modals** | `ModalComponent` |
52
+ | **Wrappers** | `MainWrapperComponent`, `PublicFormWrapper`, `TabsComponent`, `LinearProgressComponent`, `CardComponent` |
54
53
 
55
- ### Jest
54
+ See the Storybook documentation for the full API of each component.
56
55
 
57
- Jest tests are set up to run with `npm test` or `yarn test`.
56
+ ## Development
58
57
 
59
- ### Bundle analysis
58
+ ### Getting started
60
59
 
61
- Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `npm run size` and visulize it with `npm run analyze`.
60
+ ```bash
61
+ yarn install
62
+ yarn storybook
63
+ ```
62
64
 
63
- #### Setup Files
65
+ Storybook runs on [http://localhost:6006](http://localhost:6006) and hot-reloads on changes inside `src/`.
64
66
 
65
- This is the folder structure we set up for you:
67
+ ### Project structure
66
68
 
67
69
  ```txt
68
- /example
69
- index.html
70
- index.tsx # test your component here in a demo app
71
- package.json
72
- tsconfig.json
73
- /src
74
- index.tsx # EDIT THIS
75
- /test
76
- blah.test.tsx # EDIT THIS
77
- /stories
78
- Thing.stories.tsx # EDIT THIS
79
- /.storybook
80
- main.js
81
- preview.js
82
- .gitignore
83
- package.json
84
- README.md # EDIT THIS
85
- tsconfig.json
70
+ src/
71
+ components/ # Library source — grouped by category
72
+ fields/
73
+ forms/
74
+ layouts/
75
+ modals/
76
+ navigation/
77
+ tables/
78
+ wrappers/
79
+ content/ # Static assets (images, icons) used by stories
80
+ data/ # Mock data and enums used only by stories
81
+ helpers/ # Shared utilities and hooks
82
+ interfaces/ # Shared TypeScript interfaces
83
+ stories/ # Storybook stories
84
+ i18n.tsx # Storybook-only i18n bootstrap
85
+ index.tsx # Public entry point (barrel of every exported component)
86
+ .storybook/ # Storybook configuration
87
+ tsup.config.ts # Build configuration (JS bundles)
88
+ tsconfig.build.json # Build configuration (type declarations)
86
89
  ```
87
90
 
88
- #### React Testing Library
89
-
90
- We do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this.
91
-
92
- ### Rollup
91
+ Only files under `src/components/` are shipped in the published package. Stories, mock data and the Storybook i18n bootstrap are excluded from the build.
93
92
 
94
- TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.
93
+ ### Scripts
95
94
 
96
- ### TypeScript
95
+ | Script | Description |
96
+ | --- | --- |
97
+ | `yarn start` | Runs `tsup` in watch mode (rebuilds `dist/` on every change) |
98
+ | `yarn build` | Produces the distributable output in `dist/`: CJS + ESM bundles, sourcemaps and type declarations |
99
+ | `yarn storybook` | Starts Storybook in development mode |
100
+ | `yarn build-storybook` | Builds the static Storybook site |
101
+ | `yarn lint` | Runs ESLint with autofix over the codebase |
102
+ | `yarn test` | Runs the Jest test suite |
103
+ | `yarn size` | Reports the bundle size using [size-limit](https://github.com/ai/size-limit) |
104
+ | `yarn analyze` | Opens the size-limit visual report |
97
105
 
98
- `tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.
106
+ ## Build pipeline
99
107
 
100
- ## Continuous Integration
108
+ The library is built in three steps, wired together in the `build` script:
101
109
 
102
- ### GitHub Actions
110
+ 1. **`tsup`** bundles `src/index.tsx` into CommonJS (`dist/index.js`) and ES Modules (`dist/index.mjs`) using esbuild, with SCSS compiled through `esbuild-sass-plugin` and static assets (SVG/PNG) emitted as separate files.
111
+ 2. **`tsc -p tsconfig.build.json`** emits `.d.ts` declarations for the public API, excluding stories, tests, mock data and the Storybook i18n bootstrap.
112
+ 3. **`node strip-asset-imports-dts.mjs`** post-processes the emitted declarations to remove side-effect imports of `.scss`, `.css`, `.svg` and `.png` files, so consumers do not need loaders for those assets.
103
113
 
104
- Two actions are added by default:
114
+ ## Tech stack
105
115
 
106
- - `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
107
- - `size` which comments cost comparison of your library on every pull request using [size-limit](https://github.com/ai/size-limit)
116
+ - **UI**: React 19, Material UI 9, Emotion, Font Awesome 7
117
+ - **Forms & validation**: React Hook Form 7, Yup 1, `@hookform/resolvers`
118
+ - **Dates**: `@mui/x-date-pickers`, `dayjs`
119
+ - **i18n**: `i18next`, `react-i18next`, `i18next-browser-languagedetector`
120
+ - **Routing (form components)**: `react-router-dom` 7
121
+ - **Language & tooling**: TypeScript 6, ESLint 9 (flat config), Prettier 3, Jest 30, Storybook 10, tsup 8
108
122
 
109
- ## Optimizations
110
-
111
- Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:
112
-
113
- ```js
114
- // ./types/index.d.ts
115
- declare var __DEV__: boolean;
116
-
117
- // inside your code...
118
- if (__DEV__) {
119
- }
120
- ```
123
+ ## Publishing
121
124
 
122
- You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.
123
-
124
- ## Module Formats
125
-
126
- CJS, ESModules, and UMD module formats are supported.
127
-
128
- The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.
129
-
130
- ## Deploying the Example Playground
131
-
132
- The Playground is just a simple [Parcel](https://parceljs.org) app, you can deploy it anywhere you would normally deploy that. Here are some guidelines for **manually** deploying with the Netlify CLI (`npm i -g netlify-cli`):
125
+ The package is published to npm with only the `dist/` folder included (whitelisted through the `files` field in `package.json`). Before publishing, you can preview the tarball contents with:
133
126
 
134
127
  ```bash
135
- cd example # if not already in the example folder
136
- npm run build # builds to dist
137
- netlify deploy # deploy the dist folder
128
+ npm pack --dry-run
138
129
  ```
139
130
 
140
- Alternatively, if you already have a git repo connected, you can set up continuous deployment with Netlify:
131
+ To publish a new version:
141
132
 
142
133
  ```bash
143
- netlify init
144
- # build command: yarn build && cd example && yarn && yarn build
145
- # directory to deploy: example/dist
146
- # pick yes for netlify.toml
134
+ yarn build
135
+ yarn npm publish
147
136
  ```
148
137
 
149
- ## Named Exports
150
-
151
- Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.
152
-
153
- ## Including Styles
154
-
155
- There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.
156
-
157
- For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.
158
-
159
- ## Publishing to NPM
160
-
161
- We recommend using [np](https://github.com/sindresorhus/np).
162
-
163
- ## Usage with Lerna
164
-
165
- When creating a new package with TSDX within a project set up with Lerna, you might encounter a `Cannot resolve dependency` error when trying to run the `example` project. To fix that you will need to make changes to the `package.json` file _inside the `example` directory_.
166
-
167
- The problem is that due to the nature of how dependencies are installed in Lerna projects, the aliases in the example project's `package.json` might not point to the right place, as those dependencies might have been installed in the root of your Lerna project.
168
-
169
- Change the `alias` to point to where those packages are actually installed. This depends on the directory structure of your Lerna project, so the actual path might be different from the diff below.
170
-
171
- ```diff
172
- "alias": {
173
- - "react": "../node_modules/react",
174
- - "react-dom": "../node_modules/react-dom"
175
- + "react": "../../../node_modules/react",
176
- + "react-dom": "../../../node_modules/react-dom"
177
- },
178
- ```
138
+ ## License
179
139
 
180
- An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64)
140
+ [MIT](./LICENSE) © TechsBCN
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import './ButtonComponent.scss';
3
- export interface ButtonComponentProps {
4
- className?: string;
5
- label?: any;
6
- startIcon?: React.ReactNode;
7
- endIcon?: React.ReactNode;
8
- onClick?: () => void;
9
- loading?: boolean;
10
- form?: string;
11
- type?: 'button' | 'submit' | 'reset';
12
- disabled?: boolean;
13
- component?: any;
14
- reverseColors?: boolean;
15
- }
16
- export declare const ButtonComponent: React.FC<ButtonComponentProps>;
1
+ import React from 'react';
2
+
3
+ export interface ButtonComponentProps {
4
+ className?: string;
5
+ label?: any;
6
+ startIcon?: React.ReactNode;
7
+ endIcon?: React.ReactNode;
8
+ onClick?: () => void;
9
+ loading?: boolean;
10
+ form?: string;
11
+ type?: 'button' | 'submit' | 'reset';
12
+ disabled?: boolean;
13
+ component?: any;
14
+ reverseColors?: boolean;
15
+ }
16
+ export declare const ButtonComponent: React.FC<ButtonComponentProps>;
@@ -1,26 +1,26 @@
1
- import React from 'react';
2
- import './DatePickerComponent.scss';
3
- import { Dayjs } from 'dayjs';
4
- declare type CalendarPickerView = 'year' | 'day' | 'month';
5
- export interface DatePickerComponentProps {
6
- id?: string;
7
- label?: string;
8
- name?: string;
9
- value?: string | Dayjs | null;
10
- className?: string;
11
- inputFormat?: string;
12
- required?: boolean;
13
- disabled?: boolean;
14
- error?: boolean;
15
- startIcon?: React.ReactNode;
16
- fullWidth?: boolean;
17
- helperText?: string;
18
- inputRef?: React.Ref<any>;
19
- onChange: (value: any, keyboardInputValue?: string | undefined) => void;
20
- noBorders?: boolean;
21
- maxDate?: any;
22
- minDate?: any;
23
- views?: CalendarPickerView[];
24
- }
25
- export declare const DatePickerComponent: React.FC<DatePickerComponentProps>;
26
- export {};
1
+ import React from 'react';
2
+
3
+ import { Dayjs } from 'dayjs';
4
+ declare type CalendarPickerView = 'year' | 'day' | 'month';
5
+ export interface DatePickerComponentProps {
6
+ id?: string;
7
+ label?: string;
8
+ name?: string;
9
+ value?: string | Dayjs | null;
10
+ className?: string;
11
+ inputFormat?: string;
12
+ required?: boolean;
13
+ disabled?: boolean;
14
+ error?: boolean;
15
+ startIcon?: React.ReactNode;
16
+ fullWidth?: boolean;
17
+ helperText?: string;
18
+ inputRef?: React.Ref<any>;
19
+ onChange: (value: any, context?: any) => void;
20
+ noBorders?: boolean;
21
+ maxDate?: any;
22
+ minDate?: any;
23
+ views?: CalendarPickerView[];
24
+ }
25
+ export declare const DatePickerComponent: React.FC<DatePickerComponentProps>;
26
+ export {};
@@ -1,28 +1,28 @@
1
- import React from 'react';
2
- import { SearchFilters } from '../../../interfaces';
3
- import './SelectField.scss';
4
- declare type MenuPlacement = 'bottom' | 'auto' | 'top';
5
- interface SelectAsyncFieldProps {
6
- name: string;
7
- placeholder?: string;
8
- defaultOptions?: any[];
9
- isMulti?: boolean;
10
- className?: string;
11
- disabled?: boolean;
12
- onChange?: (value: any, name: string) => void;
13
- onChangeValue?: (value: any) => void;
14
- onChangeOption?: (value: any, label: string, extra?: any) => void;
15
- searchPromise: (filters: SearchFilters) => Promise<any>;
16
- invalid?: boolean;
17
- isClearable?: boolean;
18
- helperText?: string;
19
- filters?: any;
20
- inputRef?: React.Ref<any>;
21
- label?: string;
22
- menuPlacement?: MenuPlacement;
23
- value?: any[];
24
- getOptionLabel?: (option: any) => any;
25
- noBorders?: boolean;
26
- }
27
- export declare const SelectAsyncField: React.FunctionComponent<SelectAsyncFieldProps>;
28
- export {};
1
+ import React from 'react';
2
+ import { SearchFilters } from '../../../interfaces';
3
+
4
+ type MenuPlacement = 'bottom' | 'auto' | 'top';
5
+ interface SelectAsyncFieldProps {
6
+ name: string;
7
+ placeholder?: string;
8
+ defaultOptions?: any[];
9
+ isMulti?: boolean;
10
+ className?: string;
11
+ disabled?: boolean;
12
+ onChange?: (value: any, name: string) => void;
13
+ onChangeValue?: (value: any) => void;
14
+ onChangeOption?: (value: any, label: string, extra?: any) => void;
15
+ searchPromise: (filters: SearchFilters) => Promise<any>;
16
+ invalid?: boolean;
17
+ isClearable?: boolean;
18
+ helperText?: string;
19
+ filters?: any;
20
+ inputRef?: React.Ref<any>;
21
+ label?: string;
22
+ menuPlacement?: MenuPlacement;
23
+ value?: any[];
24
+ getOptionLabel?: (option: any) => any;
25
+ noBorders?: boolean;
26
+ }
27
+ export declare const SelectAsyncField: React.FunctionComponent<SelectAsyncFieldProps>;
28
+ export {};
@@ -1,29 +1,29 @@
1
- import React from 'react';
2
- import './SelectField.scss';
3
- declare type MenuPlacement = 'bottom' | 'auto' | 'top';
4
- interface SelectFieldProps {
5
- name: string;
6
- placeholder?: string;
7
- options: any[];
8
- defaultOptions?: any[];
9
- isMulti?: boolean;
10
- className?: string;
11
- disabled?: boolean;
12
- onChange?: (value: any, name: string) => void;
13
- onChangeValue?: (value: any) => void;
14
- onChangeOption?: (option: any, name?: string) => void;
15
- invalid?: boolean;
16
- isClearable?: boolean;
17
- helperText?: string;
18
- isSearchable?: boolean;
19
- inputRef?: React.Ref<any>;
20
- label?: string;
21
- menuPlacement?: MenuPlacement;
22
- isLoading?: boolean;
23
- value?: any[];
24
- getOptionLabel?: (option: any) => any;
25
- addExtraOption?: any;
26
- noBorders?: boolean;
27
- }
28
- export declare const SelectField: React.FunctionComponent<SelectFieldProps>;
29
- export {};
1
+ import React from 'react';
2
+
3
+ type MenuPlacement = 'bottom' | 'auto' | 'top';
4
+ interface SelectFieldProps {
5
+ name: string;
6
+ placeholder?: string;
7
+ options: any[];
8
+ defaultOptions?: any[];
9
+ isMulti?: boolean;
10
+ className?: string;
11
+ disabled?: boolean;
12
+ onChange?: (value: any, name: string) => void;
13
+ onChangeValue?: (value: any) => void;
14
+ onChangeOption?: (option: any, name?: string) => void;
15
+ invalid?: boolean;
16
+ isClearable?: boolean;
17
+ helperText?: string;
18
+ isSearchable?: boolean;
19
+ inputRef?: React.Ref<any>;
20
+ label?: string;
21
+ menuPlacement?: MenuPlacement;
22
+ isLoading?: boolean;
23
+ value?: any[];
24
+ getOptionLabel?: (option: any) => any;
25
+ addExtraOption?: any;
26
+ noBorders?: boolean;
27
+ }
28
+ export declare const SelectField: React.FunctionComponent<SelectFieldProps>;
29
+ export {};
@@ -1,34 +1,34 @@
1
- import React from 'react';
2
- import { StandardTextFieldProps } from '@mui/material/';
3
- import './TextFieldComponent.scss';
4
- export declare type InputType = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
5
- export interface TextFieldComponentProps extends StandardTextFieldProps {
6
- id?: string;
7
- label?: string;
8
- name?: string;
9
- value?: string | number;
10
- className?: string;
11
- type?: InputType;
12
- placeholder?: string;
13
- required?: boolean;
14
- disabled?: boolean;
15
- minNumber?: number;
16
- maxNumber?: number;
17
- error?: boolean;
18
- startIcon?: React.ReactNode;
19
- endIcon?: React.ReactNode;
20
- fullWidth?: boolean;
21
- helperText?: string;
22
- textFieldRef?: any;
23
- inputRef?: React.Ref<any>;
24
- autoComplete?: string;
25
- multiline?: boolean;
26
- rows?: number;
27
- maxLength?: number;
28
- defaultValue?: string | number;
29
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
30
- onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
31
- step?: number | string;
32
- noBorders?: boolean;
33
- }
34
- export declare const TextFieldComponent: React.FC<TextFieldComponentProps>;
1
+ import React from 'react';
2
+ import { StandardTextFieldProps } from '@mui/material';
3
+
4
+ export type InputType = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
5
+ export interface TextFieldComponentProps extends StandardTextFieldProps {
6
+ id?: string;
7
+ label?: string;
8
+ name?: string;
9
+ value?: string | number;
10
+ className?: string;
11
+ type?: InputType;
12
+ placeholder?: string;
13
+ required?: boolean;
14
+ disabled?: boolean;
15
+ minNumber?: number;
16
+ maxNumber?: number;
17
+ error?: boolean;
18
+ startIcon?: React.ReactNode;
19
+ endIcon?: React.ReactNode;
20
+ fullWidth?: boolean;
21
+ helperText?: string;
22
+ textFieldRef?: any;
23
+ inputRef?: React.Ref<any>;
24
+ autoComplete?: string;
25
+ multiline?: boolean;
26
+ rows?: number;
27
+ maxLength?: number;
28
+ defaultValue?: string | number;
29
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
30
+ onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
31
+ step?: number | string;
32
+ noBorders?: boolean;
33
+ }
34
+ export declare const TextFieldComponent: React.FC<TextFieldComponentProps>;
@@ -1,32 +1,32 @@
1
- import React from 'react';
2
- import { BoxProps } from '@mui/material/';
3
- import './TextSimpleComponent.scss';
4
- interface TextSimpleComponentProps {
5
- label?: any | string;
6
- skeletonLabel?: boolean;
7
- isFormLabel?: boolean;
8
- value?: any;
9
- classNameLabel?: string;
10
- className?: string;
11
- error?: boolean;
12
- startIcon?: React.ReactNode;
13
- endIcon?: React.ReactNode;
14
- helperText?: string;
15
- noBorders?: boolean;
16
- fullWidth?: boolean;
17
- noMargin?: boolean;
18
- isLoading?: boolean;
19
- skeletonValue?: SkeletonProps;
20
- componentBoxProps?: BoxProps;
21
- valueBoxProps?: BoxProps;
22
- labelBoxProps?: BoxProps;
23
- helperBoxProps?: BoxProps;
24
- labelMargin?: boolean;
25
- valueInCenter?: boolean;
26
- }
27
- interface SkeletonProps {
28
- useSkeleton: boolean;
29
- mineSkeleton?: any;
30
- }
31
- export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
32
- export {};
1
+ import React from 'react';
2
+ import { BoxProps } from '@mui/material';
3
+
4
+ interface TextSimpleComponentProps {
5
+ label?: any | string;
6
+ skeletonLabel?: boolean;
7
+ isFormLabel?: boolean;
8
+ value?: any;
9
+ classNameLabel?: string;
10
+ className?: string;
11
+ error?: boolean;
12
+ startIcon?: React.ReactNode;
13
+ endIcon?: React.ReactNode;
14
+ helperText?: string;
15
+ noBorders?: boolean;
16
+ fullWidth?: boolean;
17
+ noMargin?: boolean;
18
+ isLoading?: boolean;
19
+ skeletonValue?: SkeletonProps;
20
+ componentBoxProps?: BoxProps;
21
+ valueBoxProps?: BoxProps;
22
+ labelBoxProps?: BoxProps;
23
+ helperBoxProps?: BoxProps;
24
+ labelMargin?: boolean;
25
+ valueInCenter?: boolean;
26
+ }
27
+ interface SkeletonProps {
28
+ useSkeleton: boolean;
29
+ mineSkeleton?: any;
30
+ }
31
+ export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
32
+ export {};