@douglasneuroinformatics/libui 2.8.1 → 2.8.2

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.
@@ -70,6 +70,7 @@
70
70
  @layer base {
71
71
  * {
72
72
  @apply border-border;
73
+ scrollbar-width: thin;
73
74
  }
74
75
  body {
75
76
  @apply bg-background text-foreground;
@@ -31,7 +31,7 @@ export const mockStorage = (name) => {
31
31
  this.store = {};
32
32
  }
33
33
  getItem(key) {
34
- return this.store[key] || null;
34
+ return this.store[key] ?? null;
35
35
  }
36
36
  removeItem(key) {
37
37
  delete this.store[key];
package/package.json CHANGED
@@ -1,18 +1,15 @@
1
1
  {
2
2
  "name": "@douglasneuroinformatics/libui",
3
3
  "type": "module",
4
- "version": "2.8.1",
4
+ "version": "2.8.2",
5
5
  "packageManager": "pnpm@9.3.0",
6
- "description": "Generic UI components for DNP projects, built using React and TailwindCSS",
7
- "author": {
8
- "name": "Douglas Neuroinformatics",
9
- "email": "support@douglasneuroinformatics.ca"
10
- },
6
+ "description": "Generic UI components for DNP projects, built using React and Tailwind CSS",
7
+ "author": "Joshua Unrau",
11
8
  "license": "Apache-2.0",
12
9
  "homepage": "https://github.com/DouglasNeuroInformatics/libui#readme",
13
10
  "repository": {
14
11
  "type": "git",
15
- "url": "git+https://github.com/DouglasNeuroInformatics/libui"
12
+ "url": "https://github.com/DouglasNeuroInformatics/libui"
16
13
  },
17
14
  "bugs": {
18
15
  "url": "https://github.com/DouglasNeuroInformatics/libui/issues"
@@ -116,11 +113,10 @@
116
113
  "devDependencies": {
117
114
  "@commitlint/cli": "^19.3.0",
118
115
  "@commitlint/config-conventional": "^19.2.2",
119
- "@commitlint/types": "^19.0.3",
120
116
  "@douglasneuroinformatics/eslint-config": "^4.2.2",
121
- "@semantic-release/changelog": "^6.0.3",
122
- "@semantic-release/git": "^10.0.1",
123
- "@semantic-release/npm": "^12.0.1",
117
+ "@douglasneuroinformatics/prettier-config": "^0.0.1",
118
+ "@douglasneuroinformatics/semantic-release": "^0.0.1",
119
+ "@douglasneuroinformatics/tsconfig": "^1.0.1",
124
120
  "@storybook/addon-essentials": "^8.1.6",
125
121
  "@storybook/addon-interactions": "^8.1.6",
126
122
  "@storybook/addon-links": "^8.1.6",
@@ -147,9 +143,8 @@
147
143
  "husky": "^9.0.11",
148
144
  "jsdom": "24.1.0",
149
145
  "postcss": "^8.4.38",
150
- "prettier": "^3.3.1",
146
+ "prettier": "^3.3.2",
151
147
  "prettier-plugin-tailwindcss": "^0.6.2",
152
- "semantic-release": "^23.0.8",
153
148
  "sort-json": "^2.0.1",
154
149
  "storybook": "^8.1.6",
155
150
  "storybook-react-i18next": "^3.1.1",
@@ -157,5 +152,15 @@
157
152
  "typescript": "~5.4.5",
158
153
  "vite": "5.2.13",
159
154
  "vitest": "^1.6.0"
155
+ },
156
+ "commitlint": {
157
+ "extends": [
158
+ "@commitlint/config-conventional"
159
+ ]
160
+ },
161
+ "release": {
162
+ "extends": [
163
+ "@douglasneuroinformatics/semantic-release"
164
+ ]
160
165
  }
161
166
  }
@@ -72,7 +72,7 @@ export const DatePicker = React.forwardRef<React.ElementRef<typeof Card>, DatePi
72
72
  // the duration is doubled because presumably it is to mount old and mount new
73
73
  const [canSetMonth, setCanSetMonth] = useState(true);
74
74
 
75
- const monthName = t(`months.${MONTHS[date.getMonth()]}`);
75
+ const monthName = t(`months.${MONTHS[date.getMonth()]!}`);
76
76
 
77
77
  const handleYearSelection = (date: Date) => {
78
78
  dispatch({ type: 'set-year', value: date.getFullYear() });
@@ -19,7 +19,7 @@ export type FieldsComponentProps<T extends FormDataType> = {
19
19
  /** Renders an object containing key value pairs, where the value is a FormField of some kind */
20
20
  export const FieldsComponent = <T extends FormDataType>({ fields, ...props }: FieldsComponentProps<T>) => {
21
21
  return Object.keys(fields).map((name) => {
22
- const field = fields[name];
22
+ const field = fields[name]!;
23
23
  if (field.kind === 'dynamic') {
24
24
  return <DynamicField {...props} field={field} key={name} name={name} />;
25
25
  }
@@ -41,7 +41,7 @@ export const NumberRecordField = <T extends NumberRecordFieldValue = NumberRecor
41
41
  </Heading>
42
42
  <div className="space-y-6">
43
43
  {Object.keys(items).map((name) => {
44
- const item = items[name];
44
+ const item = items[name]!;
45
45
  return (
46
46
  <NumberField
47
47
  error={recordError?.[name]}
@@ -73,12 +73,12 @@ export const RecordArrayField = memo(function RecordArrayField({
73
73
  if (!newArrayError[i]) {
74
74
  newArrayError[i] = {};
75
75
  }
76
- newArrayError[i][name] = error;
76
+ newArrayError[i]![name] = error;
77
77
  setArrayError(newArrayError);
78
78
  }}
79
79
  setValue={(value) => {
80
80
  const newArrayValue = [...arrayValue];
81
- newArrayValue[i][name] = value;
81
+ newArrayValue[i]![name] = value;
82
82
  setArrayValue(newArrayValue);
83
83
  }}
84
84
  value={arrayValue?.[i]?.[name]}
@@ -28,7 +28,7 @@ export function getFormFields<T extends FormDataType>(content: FormContent<T>):
28
28
  if (!Array.isArray(content)) {
29
29
  return content;
30
30
  }
31
- return content.reduce((prev, current) => ({ ...prev, ...current.fields }), content[0].fields) as FormFields<T>;
31
+ return content.reduce((prev, current) => ({ ...prev, ...current.fields }), content[0]!.fields) as FormFields<T>;
32
32
  }
33
33
 
34
34
  /**
@@ -23,7 +23,7 @@ describe('useNotificationsStore', () => {
23
23
  expect(result.current.notifications.length).toBe(1);
24
24
  expect(result.current.notifications[0]).toMatchObject({ message: 'test' });
25
25
  act(() => {
26
- result.current.dismissNotification(result.current.notifications[0].id);
26
+ result.current.dismissNotification(result.current.notifications[0]!.id);
27
27
  });
28
28
  expect(result.current.notifications.length).toBe(0);
29
29
  });
package/src/i18n.ts CHANGED
@@ -69,8 +69,8 @@ i18n.addPreInitTranslations = function (this, translations) {
69
69
  return;
70
70
  }
71
71
  const resources = createResources(translations);
72
- Object.assign(this.options.resources.en, resources.en);
73
- Object.assign(this.options.resources.fr, resources.fr);
72
+ Object.assign(this.options.resources.en!, resources.en);
73
+ Object.assign(this.options.resources.fr!, resources.fr);
74
74
  };
75
75
 
76
76
  i18n.use(initReactI18next).use(LanguageDetector);
@@ -70,6 +70,7 @@
70
70
  @layer base {
71
71
  * {
72
72
  @apply border-border;
73
+ scrollbar-width: thin;
73
74
  }
74
75
  body {
75
76
  @apply bg-background text-foreground;
@@ -35,7 +35,7 @@ export const mockStorage = (name: 'localStorage' | 'sessionStorage'): void => {
35
35
  }
36
36
 
37
37
  getItem(key: string) {
38
- return this.store[key] || null;
38
+ return this.store[key] ?? null;
39
39
  }
40
40
 
41
41
  removeItem(key: string) {