@j2-health/design-system 0.1.0 → 0.2.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 (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -12
  3. package/dist/index.cjs +2 -2
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.ts +42 -42
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib.d.ts +1 -1
  9. package/dist/src/components/alert/index.d.ts +1 -1
  10. package/dist/src/components/barchart/BarChart.d.ts +1 -1
  11. package/dist/src/components/barchart/index.d.ts +1 -1
  12. package/dist/src/components/breadcrumb/index.d.ts +1 -1
  13. package/dist/src/components/bulkActionBar/index.d.ts +1 -1
  14. package/dist/src/components/button/index.d.ts +1 -1
  15. package/dist/src/components/card/index.d.ts +1 -1
  16. package/dist/src/components/checkbox/index.d.ts +1 -1
  17. package/dist/src/components/checkboxTree/TreeNode.d.ts +1 -1
  18. package/dist/src/components/checkboxTree/index.d.ts +1 -1
  19. package/dist/src/components/checkboxTree/utils.d.ts +1 -1
  20. package/dist/src/components/collapse/index.d.ts +1 -1
  21. package/dist/src/components/drawer/index.d.ts +1 -1
  22. package/dist/src/components/dropdown/index.d.ts +1 -1
  23. package/dist/src/components/filterform/FilterGroup.d.ts +2 -2
  24. package/dist/src/components/filterform/FilterInput.d.ts +2 -2
  25. package/dist/src/components/filterform/FiltersForm.d.ts +1 -1
  26. package/dist/src/components/filterform/filterHelpers.d.ts +1 -1
  27. package/dist/src/components/filterform/index.d.ts +2 -2
  28. package/dist/src/components/filterform/useFilterField.d.ts +1 -1
  29. package/dist/src/components/filterform/useFiltersForm.d.ts +1 -1
  30. package/dist/src/components/form/index.d.ts +1 -1
  31. package/dist/src/components/input/index.d.ts +3 -3
  32. package/dist/src/components/inputnumber/index.d.ts +1 -1
  33. package/dist/src/components/legacyNavMenu/index.d.ts +4 -4
  34. package/dist/src/components/listpopover/ListPopover.d.ts +1 -1
  35. package/dist/src/components/listpopover/index.d.ts +1 -1
  36. package/dist/src/components/menu/index.d.ts +2 -2
  37. package/dist/src/components/message/index.d.ts +2 -2
  38. package/dist/src/components/modal/index.d.ts +2 -2
  39. package/dist/src/components/navMenu/index.d.ts +1 -1
  40. package/dist/src/components/notification/index.d.ts +2 -2
  41. package/dist/src/components/notificationModal/index.d.ts +2 -2
  42. package/dist/src/components/pagination/index.d.ts +1 -1
  43. package/dist/src/components/popover/index.d.ts +1 -1
  44. package/dist/src/components/progress/index.d.ts +1 -1
  45. package/dist/src/components/radio/index.d.ts +1 -1
  46. package/dist/src/components/rate/index.d.ts +1 -1
  47. package/dist/src/components/select/index.d.ts +4 -4
  48. package/dist/src/components/skeleton/index.d.ts +1 -1
  49. package/dist/src/components/spinner/index.d.ts +1 -1
  50. package/dist/src/components/steps/index.d.ts +2 -2
  51. package/dist/src/components/switch/index.d.ts +1 -1
  52. package/dist/src/components/table/index.d.ts +1 -1
  53. package/dist/src/components/tabs/index.d.ts +1 -1
  54. package/dist/src/components/tag/index.d.ts +1 -1
  55. package/dist/src/components/tooltip/index.d.ts +1 -1
  56. package/dist/src/components/vennDiagram/VennDiagram.d.ts +1 -1
  57. package/dist/src/components/vennDiagram/index.d.ts +1 -1
  58. package/dist/src/index.d.ts +4 -2
  59. package/dist/tailwind.cjs +8 -5
  60. package/dist/tailwind.cjs.map +1 -1
  61. package/dist/tailwind.config.d.ts +8 -8
  62. package/dist/tailwind.js +8 -5
  63. package/dist/tailwind.js.map +1 -1
  64. package/package.json +6 -7
  65. package/dist/favicon.png +0 -0
  66. package/dist/vite.svg +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 J2 Health, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -44,8 +44,14 @@ $ npm install @j2-health/design-system
44
44
  ```
45
45
 
46
46
  The package ships a prebuilt bundle plus type declarations, and expects the
47
- consuming app to provide the peer dependencies listed in `package.json`
48
- (react, antd, formik, highcharts, tailwindcss, ...).
47
+ consuming app to provide the peer dependencies listed in `package.json` (react,
48
+ antd, formik, highcharts, tailwindcss, ...).
49
+
50
+ > **Tailwind v3 only.** The preset is a Tailwind 3 config. Installing Tailwind
51
+ > without a version pin gets you v4, which does not satisfy the
52
+ > `tailwindcss@^3.4.14` peer range — npm reports it as a warning and installs it
53
+ > anyway, so the mismatch is easy to miss. Pin it:
54
+ > `npm i -D tailwindcss@^3.4.14`.
49
55
 
50
56
  Wire it up in three places:
51
57
 
@@ -56,8 +62,7 @@ Wire it up in three places:
56
62
  ```
57
63
 
58
64
  2. **Styles** — import the compiled component styles once (e.g. in your app
59
- entry), and pull the base stylesheet (design tokens, `@tailwind`
60
- directives, base element styles) into your own CSS pipeline:
65
+ entry), and pull the base stylesheet into your own CSS pipeline:
61
66
 
62
67
  ```tsx
63
68
  // app entry
@@ -65,10 +70,18 @@ Wire it up in three places:
65
70
  ```
66
71
 
67
72
  ```css
68
- /* your root stylesheet — processed by YOUR Tailwind/PostCSS build */
73
+ /* your root stylesheet — processed by YOUR Tailwind/PostCSS build.
74
+ This @import must be the FIRST statement in the file: it carries an
75
+ @import of its own (the Rubik webfont), and CSS drops an @import that
76
+ follows other rules. */
69
77
  @import '@j2-health/design-system/stylesheets/index.css';
70
78
  ```
71
79
 
80
+ **This file is your Tailwind entry point.** It supplies `@tailwind base`,
81
+ `@tailwind components`, and `@tailwind utilities` along with the design
82
+ tokens and base element styles, so remove those directives from your own
83
+ stylesheet — keeping both emits every Tailwind layer twice.
84
+
72
85
  3. **Tailwind** — use the preset and scan the package's compiled output so
73
86
  utility classes used inside components are generated by your build:
74
87
 
@@ -89,18 +102,52 @@ Wire it up in three places:
89
102
 
90
103
  Include this repo as a git submodule and compile its raw TypeScript source with
91
104
  your own toolchain (vite alias + tsconfig paths + tailwind content globs
92
- pointing into the submodule). The npm entry point for this mode is `index.ts`
93
- at the repo root; submodule consumers should alias `design-system` to that file
105
+ pointing into the submodule). The npm entry point for this mode is `index.ts` at
106
+ the repo root; submodule consumers should alias `design-system` to that file
94
107
  explicitly, since the package.json `exports` map points at `dist/`, which only
95
108
  exists in the published package.
96
109
 
110
+ ### Local development against a consuming app
111
+
112
+ To work on a component and see it live in an app that depends on this package, point the
113
+ app's bundler at this checkout's source rather than linking the built package. Consuming
114
+ apps support this through a `DESIGN_SYSTEM_LOCAL` environment variable:
115
+
116
+ ```bash
117
+ DESIGN_SYSTEM_LOCAL=/path/to/design-system npm run dev
118
+ ```
119
+
120
+ **Do not use `npm link` or `npm install ../design-system`.** This package declares 12 peer
121
+ dependencies that are also devDependencies, because Storybook and the test suite need them
122
+ to run. A linked install resolves those imports from this checkout's own `node_modules`
123
+ rather than the app's, so the app ends up with two copies of React and two copies of antd.
124
+
125
+ Two copies of React raise `Invalid hook call`, which is at least obvious. Two copies of antd
126
+ fail silently: `AppConfigProvider` supplies the theme through antd's `ConfigProvider`, a
127
+ React context singleton, so a component resolved from the second copy reads an empty context
128
+ and renders unthemed with no error and no warning. Because it only reproduces under a linked
129
+ install, it looks like a bug in this library that disappears the moment you publish.
130
+
131
+ Consuming apps must also set `resolve.dedupe` for `react`, `react-dom`, and `antd`, since a
132
+ local checkout has its own `node_modules`.
133
+
97
134
  ### Publishing to npm
98
135
 
99
136
  The package is published publicly (the source is public anyway). Publishing is
100
137
  tag-driven via
101
- [.github/workflows/publish-workflow.yml](.github/workflows/publish-workflow.yml)
102
- and requires the `NPM_TOKEN` repository secret (an npm automation token with
103
- publish rights on the `@j2-health` org).
138
+ [.github/workflows/publish-workflow.yml](.github/workflows/publish-workflow.yml).
139
+
140
+ There is **no publish token**. npm authenticates the release through trusted
141
+ publishing (OIDC): npm is configured to trust this repository and this workflow
142
+ file by name, and GitHub mints a short-lived identity token for the job. Two
143
+ consequences worth knowing before you change anything here:
144
+
145
+ - **Renaming or moving `publish-workflow.yml` breaks publishing.** The trusted
146
+ publisher is matched on the exact filename, case-sensitive. Update it on
147
+ npmjs.com in the same change.
148
+ - **Do not lower `.node-version` below 24.5.0.** Trusted publishing needs
149
+ npm >= 11.5.1, which is exactly what Node 24.5.0 ships. The workflow asserts
150
+ this rather than letting it surface later as an unexplained 401.
104
151
 
105
152
  To release a new version from `main`:
106
153
 
@@ -109,5 +156,7 @@ $ npm version minor # or patch / major — bumps package.json and creates
109
156
  $ git push origin main --follow-tags
110
157
  ```
111
158
 
112
- The workflow verifies the tag matches `package.json`, runs lint and tests,
113
- builds the library, and publishes.
159
+ The workflow packs the tarball and builds a scratch consumer against it, then
160
+ verifies the tag matches `package.json`, runs lint, tests and type-check, builds
161
+ the library, and publishes. Provenance is generated automatically by trusted
162
+ publishing, so `--provenance` is not passed.
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@ require("@highcharts/react/options/Accessibility.js");
10
10
  require("@highcharts/react/options/Exporting.js");
11
11
  const server = require("react-dom/server");
12
12
  const cx = require("classnames");
13
- const lodash = require("lodash");
13
+ const cloneDeep = require("lodash/cloneDeep.js");
14
14
  const formikAntd = require("formik-antd");
15
15
  const formik = require("formik");
16
16
  require("@highcharts/react/series/Venn.js");
@@ -1466,7 +1466,7 @@ const ValueInput = ({
1466
1466
  }
1467
1467
  };
1468
1468
  const copyFilterGroups = (filterGroups) => {
1469
- return lodash.cloneDeep(filterGroups);
1469
+ return cloneDeep(filterGroups);
1470
1470
  };
1471
1471
  const addFilter = (filter, filterGroups) => {
1472
1472
  const copy = copyFilterGroups(filterGroups);