Skip to content

Commit

Permalink
WIP DatePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
nighto committed Nov 27, 2024
1 parent bbf99c8 commit 467a5b2
Show file tree
Hide file tree
Showing 8 changed files with 319 additions and 27 deletions.
2 changes: 2 additions & 0 deletions app/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export { SubmitButton } from '../src/components/forms/context/SubmitButton/Submi

// Forms > Controls
export { Checkbox } from '../src/components/forms/controls/Checkbox/Checkbox.tsx';
export { DatePicker } from '../src/components/forms/controls/DatePicker/DatePicker.tsx';
export { Input } from '../src/components/forms/controls/Input/Input.tsx';
export { Radio } from '../src/components/forms/controls/Radio/Radio.tsx';
export { SegmentedControl } from '../src/components/forms/controls/SegmentedControl/SegmentedControl.tsx';
Expand All @@ -40,6 +41,7 @@ export { Switch } from '../src/components/forms/controls/Switch/Switch.tsx';
export { CheckboxField } from '../src/components/forms/fields/CheckboxField/CheckboxField.tsx';
export { CheckboxGroup } from '../src/components/forms/fields/CheckboxGroup/CheckboxGroup.tsx';
export { InputField } from '../src/components/forms/fields/InputField/InputField.tsx';
export { InputFieldWithTags } from '../src/components/forms/fields/InputFieldWithTags/InputFieldWithTags.tsx';
export { RadioField } from '../src/components/forms/fields/RadioField/RadioField.tsx';
export { RadioGroup } from '../src/components/forms/fields/RadioGroup/RadioGroup.tsx';

Expand Down
47 changes: 44 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
"react-toastify": "^10.0.6",
"effect": "^3.10.15",
"react-hook-form": "^7.53.2",
"optics-ts": "^2.4.1"
"optics-ts": "^2.4.1",
"react-datepicker": "^7.5.0"
},
"overrides": {
"@types/react": "npm:types-react@rc",
Expand Down
48 changes: 25 additions & 23 deletions package.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const packageConfig = {
author: 'Fortanix',
description: 'Fortanix Baklava design system',
repository: { type: 'git', url: 'git+https://github.com/fortanix/baklava.git' },

files: [
'src',
'app',
Expand All @@ -34,77 +34,77 @@ const packageConfig = {
'default': './src/styling/variables.scss',
},
},

scripts: {
// Utilities
'gen-package': 'node package.json.js', // Update `package.json`
// Use --force currently since we're using React v19 rc. Once peer deps are updated remove this.
'install-project': 'npm run gen-package && npm install --force',
'ci-project': 'npm ci --force',

// CLI
'node': 'node --import=tsx',
'repl': 'tsx',
'plop': 'NODE_OPTIONS="--import tsx" plop',
'import': 'tsx scripts/import.ts',

// Library
//'lib:build': '',

// App
'serve:dev': 'vite --config=./vite.config.ts serve',
//'build': 'vite --config=./vite.config.ts --emptyOutDir build && cp src/types/vite-env.d.ts dist && echo \'{"name": "@fortanix/baklava","main": "./baklava.js"}\' > dist/package.json',
'build': 'vite --config=./vite.config.ts --emptyOutDir build',

// Storybook
'storybook:serve': 'storybook dev -p 6006',
'storybook:build': 'storybook build --docs',

// Static analysis
'check:types': 'tsc --noEmit',
'lint:style': `stylelint 'src/**/*.scss'`,
'lint:script': 'biome lint',
'lint': 'npm run lint:style && npm run lint:script',

// Test
// Note: use `vitest run --root=. src/...` to run a single test file
//'test': 'vitest run --root=.', // Need to specify `--root=.` since the vite root is set to `./app`
'test': 'npm run check:types && npm run lint:style',
'test-ui': 'vitest --ui',
'coverage': 'vitest run --coverage',

// Shorthands
'start': 'npm run storybook:serve',

// Hooks
'prepare': 'npm run build',
},

// Dev dependencies (only needed when building, or making changes to the code)
devDependencies: {
// CLI
'plop': '^4.0.1',
'tsx': '^4.19.2',
'glob': '^11.0.0',

// Build
'vite': '^5.4.11',
'@vitejs/plugin-react': '^4.3.3',
'vite-plugin-dts': '^4.3.0',
'vite-plugin-lib-inject-css': '^2.1.1',
'vite-plugin-svg-icons': '^2.0.1',

// Static analysis
'typescript': '^5.6.3',
'@types/node': '^22.9.0',
'stylelint': '^16.10.0',
'stylelint-config-standard-scss': '^13.1.0',
'@biomejs/biome': '^1.9.4',

// Testing
'vitest': '^2.1.5',
'@vitest/ui': '^2.1.5',

// Storybook
'storybook': '^8.4.4',
'@storybook/react': '^8.4.4',
Expand All @@ -122,7 +122,7 @@ const packageConfig = {
'storybook-dark-mode': '^4.0.2',
'@percy/cli': '^1.30.2',
'@percy/storybook': '^6.0.2',

// Styling
'vite-css-modules': '^1.6.0',
'typescript-plugin-css-modules': '^5.0.1',
Expand All @@ -134,33 +134,35 @@ const packageConfig = {
//'@csstools/postcss-light-dark-function': '^1.0.5',
'postcss-color-contrast': '^1.1.0',
'lightningcss': '^1.28.1',

// React
//'@types/react': '^18.3.7',
//'@types/react-dom': '^18.2.22',
'@types/react': 'npm:types-react@rc',
'@types/react-dom': 'npm:types-react-dom@rc',
},

// Dependencies needed when running the generated build
dependencies: {
// Utilities
'date-fns': '^4.1.0',
'message-tag': '^0.10.0',

// React
'classnames': '^2.5.1',
'react': '^19.0.0-rc.1',
'react-dom': '^19.0.0-rc.1',
'react-error-boundary': '^4.1.2',

'@floating-ui/react': '^0.26.28',
'react-toastify': '^10.0.6',

'effect': '^3.10.15',
'react-hook-form': '^7.53.2',

'optics-ts': '^2.4.1',

'react-datepicker': '^7.5.0',
},
overrides: {
// See https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing
Expand All @@ -176,7 +178,7 @@ const packageConfig = {
const packageConfigWithComment = {
// http://stackoverflow.com/questions/14221579/how-do-i-add-comments-to-package-json
'//': 'NOTE: This is a generated file. Do not edit this file directly, use package.json.js instead.',

...packageConfig,
};

Expand Down
Loading

0 comments on commit 467a5b2

Please sign in to comment.