Skip to content

Commit

Permalink
fix: issue of the weight in table
Browse files Browse the repository at this point in the history
  • Loading branch information
HamzaAmar committed Oct 15, 2024
1 parent d5a0b93 commit d6ca020
Show file tree
Hide file tree
Showing 18 changed files with 9,369 additions and 6,314 deletions.
2 changes: 1 addition & 1 deletion apps/docs/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions apps/stories/stories/table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,16 @@ export const NormalTableColor = () => {
export const TableSize = () => {
return (
<Flex direction="col" gap="4">
<Heading size="4">Table Size SMALL</Heading>
<Heading size="1">Table Size Extra SMALL</Heading>
<NormalTableExample size="2" />
<Heading size="1">Table Size Medium</Heading>
<NormalTableExample size="4" />
<Heading size="4">Table Size Medium</Heading>
<NormalTableExample />
<Heading size="4">Table Size Large</Heading>
<NormalTableExample gap="6" />
<Heading size="1">Table Size Large</Heading>
<NormalTableExample size="6" />
<Heading size="1">Table Size Large</Heading>
<NormalTableExample size="7" />
<Heading size="1">Table Size Large</Heading>
<NormalTableExample size="9" />
</Flex>
)
}
42 changes: 21 additions & 21 deletions examples/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@
"typecheck": "tsc"
},
"dependencies": {
"@pillar-ui/core": "^0.6.0",
"@remix-run/node": "^2.8.1",
"@remix-run/react": "^2.8.1",
"@remix-run/serve": "^2.8.1",
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@pillar-ui/core": "^0.10.8",
"@remix-run/node": "^2.13.1",
"@remix-run/react": "^2.13.1",
"@remix-run/serve": "^2.13.1",
"isbot": "^4.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@remix-run/dev": "^2.8.1",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint": "^8.38.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"typescript": "^5.1.6",
"vite": "^5.1.0",
"vite-tsconfig-paths": "^4.2.1"
"@remix-run/dev": "^2.13.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"typescript": "^5.6.3",
"vite": "^5.4.9",
"vite-tsconfig-paths": "^4.3.2"
},
"engines": {
"node": ">=18.0.0"
Expand Down
15,338 changes: 9,261 additions & 6,077 deletions examples/remix/yarn.lock

Large diffs are not rendered by default.

Binary file modified examples/with-cra/.yarn/install-state.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions examples/with-cra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@pillar-ui/core": "^0.8.5",
"@pillar-ui/icons": "^0.7.3",
"@pillar-ui/utils": "^0.7.3",
"@pillar-ui/core": "^0.10.8",
"@pillar-ui/icons": "^0.8.2",
"@pillar-ui/utils": "^0.8.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
69 changes: 4 additions & 65 deletions examples/with-cra/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,74 +1,13 @@
import { Button, Paper, InputPassword, FormController, Input } from '@pillar-ui/core'
import { Envelop, Lock } from '@pillar-ui/icons'
import { toCapitalize } from '@pillar-ui/utils'
import { useState } from 'react'
import { Button, Paper } from '@pillar-ui/core'
import '@pillar-ui/core/main.css'

function App() {
const [formData, setFormData] = useState({})
const [error, setError] = useState({})

function handleChange(event) {
const { name, value } = event.target
const newValue = name === 'email' ? toCapitalize(value) : value
setFormData((prevFormValues) => ({ ...prevFormValues, [name]: newValue }))
}

function handleSubmit(e) {
e.preventDefault()

const form = e.target

if (form.checkValidity()) {
setError({})
} else {
const validationErrors = {}

for (let i = 0; i < form.elements.length; i++) {
const field = form.elements[i]
if (!field.checkValidity()) {
validationErrors[field.name] = field.validationMessage
}
}

setError(validationErrors)
}

console.log(formData)
}
const [count, setCount] = useState(0)

return (
<Paper className="F-c">
<Paper as="form" flow="4" onSubmit={handleSubmit} width="60c" border>
<FormController required label="Name" error={error.name}>
<Input
value={formData.name}
name="name"
onChange={handleChange}
placeholder="Default Input"
suffix={<Envelop />}
/>
</FormController>
<FormController required label="Email" error={error.email}>
<Input
prefixInput={<Envelop width={16} />}
value={formData.email}
name="email"
onChange={handleChange}
placeholder="Default Input"
/>
</FormController>
<FormController
error={error.password}
required
minLength={7}
label="Password"
hint="Enter your password (at least 7 characters)"
>
<InputPassword value={formData.password} name="password" onChange={handleChange} />
</FormController>
<Button icon={<Lock />}> Login </Button>
</Paper>
<Paper width="screen" height="screen" className="F-c">
<Button onClick={() => setCount((count) => count + 1)}>count is {count}</Button>
</Paper>
)
}
Expand Down
1 change: 0 additions & 1 deletion examples/with-cra/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import reportWebVitals from './reportWebVitals'
import App from './App'

Expand Down
33 changes: 18 additions & 15 deletions examples/with-cra/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2318,30 +2318,33 @@ __metadata:
languageName: node
linkType: hard

"@pillar-ui/core@npm:^0.8.5":
version: 0.8.5
resolution: "@pillar-ui/core@npm:0.8.5"
"@pillar-ui/core@npm:^0.10.8":
version: 0.10.8
resolution: "@pillar-ui/core@npm:0.10.8"
peerDependencies:
"@pillar-ui/hooks": 0.7.4
react: ^18.0.0
react-dom: ^18.0.0
checksum: 10c0/ab3e9acb46ea59981474b9d5fdc67a83f7e8c55743fa0ff4cd4adce3bd5bb51bbb37935d220e322e1dccc1a4d4987187716ee324898de3c56cfb302d40fa8102
checksum: 10c0/fc7a8d507da2905021238b0daad8c9fe10d0cc7040466ca986e9e77856a71a6dc90dfc02abfbba411134e4ffb5117e18816a7533b56ef20dd2bc6215bbd2aa0c
languageName: node
linkType: hard

"@pillar-ui/icons@npm:^0.7.3":
version: 0.7.3
resolution: "@pillar-ui/icons@npm:0.7.3"
"@pillar-ui/icons@npm:^0.8.2":
version: 0.8.2
resolution: "@pillar-ui/icons@npm:0.8.2"
peerDependencies:
react: ^18.0.0
react-dom: ^18.0.0
checksum: 10c0/ff61fd53fb1ed93a4acf13a7d0003ace0735968a8a851b123a815667e05560610f304c5d20ea75e3063a32f421c4b6c19ff98ba36b891f835b020924dc7500c6
checksum: 10c0/ce8b377fc98049dc004c13b2d081fd8636e94cbe9917261961bc7b3737dafc83cc9ff6923262d15ceb4e43e7bf52fa2dcae9323ca1d96870b6920fcac81aa9ca
languageName: node
linkType: hard

"@pillar-ui/utils@npm:^0.7.3":
version: 0.7.3
resolution: "@pillar-ui/utils@npm:0.7.3"
checksum: 10c0/46758bd9172996bd0e1308155ecdd80ffa18f93eabe1cf6b549fbefb248c27a101be857611cfad842afb7e8be2c9c0c5cf4ccc34458bbef321163474e748bf45
"@pillar-ui/utils@npm:^0.8.5":
version: 0.8.5
resolution: "@pillar-ui/utils@npm:0.8.5"
peerDependencies:
react: ^18.3.1
checksum: 10c0/a446a5ec0c09274bd267b869e9e65253e85b286d734c9dd4a03f3d6cc72ba26d7f5a5aa1a154ce85c29b7498c3df0928a26b587760222e050aa26a3c2a8f2a5c
languageName: node
linkType: hard

Expand Down Expand Up @@ -13444,9 +13447,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "with-cra@workspace:."
dependencies:
"@pillar-ui/core": "npm:^0.8.5"
"@pillar-ui/icons": "npm:^0.7.3"
"@pillar-ui/utils": "npm:^0.7.3"
"@pillar-ui/core": "npm:^0.10.8"
"@pillar-ui/icons": "npm:^0.8.2"
"@pillar-ui/utils": "npm:^0.8.5"
"@testing-library/jest-dom": "npm:^5.17.0"
"@testing-library/react": "npm:^13.4.0"
"@testing-library/user-event": "npm:^13.5.0"
Expand Down
Binary file modified examples/with-vite/.yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions examples/with-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@pillar-ui/core": "^0.10.8",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
26 changes: 5 additions & 21 deletions examples/with-vite/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'
import { Button, Paper } from '@pillar-ui/core'
import '@pillar-ui/core/main.css'

function App() {
const [count, setCount] = useState(0)

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank" rel="noreferrer">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
</>
<Paper width="screen" height="screen" className="F-c">
<Button onClick={() => setCount((count) => count + 1)}>count is {count}</Button>
</Paper>
)
}

Expand Down
68 changes: 0 additions & 68 deletions examples/with-vite/src/index.css

This file was deleted.

1 change: 0 additions & 1 deletion examples/with-vite/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './App.tsx'
import './index.css'

createRoot(document.getElementById('root')!).render(
<StrictMode>
Expand Down
12 changes: 12 additions & 0 deletions examples/with-vite/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,17 @@ __metadata:
languageName: node
linkType: hard

"@pillar-ui/core@npm:^0.10.8":
version: 0.10.8
resolution: "@pillar-ui/core@npm:0.10.8"
peerDependencies:
"@pillar-ui/hooks": 0.7.4
react: ^18.0.0
react-dom: ^18.0.0
checksum: 10c0/fc7a8d507da2905021238b0daad8c9fe10d0cc7040466ca986e9e77856a71a6dc90dfc02abfbba411134e4ffb5117e18816a7533b56ef20dd2bc6215bbd2aa0c
languageName: node
linkType: hard

"@pkgjs/parseargs@npm:^0.11.0":
version: 0.11.0
resolution: "@pkgjs/parseargs@npm:0.11.0"
Expand Down Expand Up @@ -2891,6 +2902,7 @@ __metadata:
resolution: "with-vite@workspace:."
dependencies:
"@eslint/js": "npm:^9.8.0"
"@pillar-ui/core": "npm:^0.10.8"
"@types/react": "npm:^18.3.3"
"@types/react-dom": "npm:^18.3.0"
"@vitejs/plugin-react": "npm:^4.3.1"
Expand Down
3 changes: 1 addition & 2 deletions packages/pillar-core/src/core/table/table.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { Color, Size } from '../../types'

type Variant = 'default' | 'striped' | 'soft' | 'head-color'
type Type = 'head' | 'body'
type Weight = 'thin' | 'extra-light' | 'light' | 'normal' | 'medium' | 'semi-bold' | 'bold' | 'extra-bold' | 'black'

// type Border = "none" | 'soft';

Expand All @@ -16,7 +15,7 @@ export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
}

export interface TableColumnProps {
weight?: Weight
weight?: Size
}
export interface TableRowProps {
children: ReactNode
Expand Down
Loading

0 comments on commit d6ca020

Please sign in to comment.