@sakura-ui/sakura-ui 0.0.5 → 0.0.6

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 (65) hide show
  1. package/package.json +4 -7
  2. package/.prettierrc +0 -21
  3. package/README.md +0 -37
  4. package/examples/index.html +0 -13
  5. package/examples/src/index.tsx +0 -10
  6. package/pnpm-workspace.yaml +0 -3
  7. package/src/components/Button.tsx +0 -72
  8. package/src/components/Card.tsx +0 -22
  9. package/src/components/Code.tsx +0 -19
  10. package/src/components/Heading.tsx +0 -109
  11. package/src/components/IconButton.tsx +0 -71
  12. package/src/components/InfoCard.tsx +0 -36
  13. package/src/components/Link.tsx +0 -73
  14. package/src/components/List.tsx +0 -38
  15. package/src/components/Pre.tsx +0 -22
  16. package/src/components/Radio.tsx +0 -39
  17. package/src/components/RadioGroup.tsx +0 -38
  18. package/src/components/Select.tsx +0 -41
  19. package/src/components/Table.tsx +0 -111
  20. package/src/components/Text.tsx +0 -35
  21. package/src/components/Textarea.tsx +0 -32
  22. package/src/components/index.ts +0 -15
  23. package/src/configs/index.ts +0 -92
  24. package/src/index.ts +0 -59
  25. package/src/utils/index.ts +0 -1
  26. /package/{packages/config → config}/coverage/clover.xml +0 -0
  27. /package/{packages/config → config}/coverage/coverage-final.json +0 -0
  28. /package/{packages/config → config}/coverage/lcov-report/base.css +0 -0
  29. /package/{packages/config → config}/coverage/lcov-report/block-navigation.js +0 -0
  30. /package/{packages/config → config}/coverage/lcov-report/favicon.png +0 -0
  31. /package/{packages/config → config}/coverage/lcov-report/index.html +0 -0
  32. /package/{packages/config → config}/coverage/lcov-report/index.ts.html +0 -0
  33. /package/{packages/config → config}/coverage/lcov-report/prettify.css +0 -0
  34. /package/{packages/config → config}/coverage/lcov-report/prettify.js +0 -0
  35. /package/{packages/config → config}/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  36. /package/{packages/config → config}/coverage/lcov-report/sorter.js +0 -0
  37. /package/{packages/config → config}/coverage/lcov.info +0 -0
  38. /package/{packages/config → config}/jest.config.ts +0 -0
  39. /package/{packages/config → config}/package.json +0 -0
  40. /package/{packages/config → config}/src/index.ts +0 -0
  41. /package/{packages/config → config}/tests/index.test.ts +0 -0
  42. /package/{packages/config → config}/tsconfig.json +0 -0
  43. /package/{packages/config → config}/vite.config.ts +0 -0
  44. /package/{packages/react → react}/package.json +0 -0
  45. /package/{packages/react → react}/src/components/Button.tsx +0 -0
  46. /package/{packages/react → react}/src/components/Card.tsx +0 -0
  47. /package/{packages/react → react}/src/components/Code.tsx +0 -0
  48. /package/{packages/react → react}/src/components/Heading.tsx +0 -0
  49. /package/{packages/react → react}/src/components/IconButton.tsx +0 -0
  50. /package/{packages/react → react}/src/components/InfoCard.tsx +0 -0
  51. /package/{packages/react → react}/src/components/Link.tsx +0 -0
  52. /package/{packages/react → react}/src/components/List.tsx +0 -0
  53. /package/{packages/react → react}/src/components/Pre.tsx +0 -0
  54. /package/{packages/react → react}/src/components/Radio.tsx +0 -0
  55. /package/{packages/react → react}/src/components/RadioGroup.tsx +0 -0
  56. /package/{packages/react → react}/src/components/Select.tsx +0 -0
  57. /package/{packages/react → react}/src/components/Table.tsx +0 -0
  58. /package/{packages/react → react}/src/components/Text.tsx +0 -0
  59. /package/{packages/react → react}/src/components/Textarea.tsx +0 -0
  60. /package/{packages/react → react}/src/components/index.ts +0 -0
  61. /package/{packages/react → react}/src/index.ts +0 -0
  62. /package/{packages/react → react}/src/utils/index.ts +0 -0
  63. /package/{packages/react → react}/tsconfig.json +0 -0
  64. /package/{packages/react → react}/tsconfig.node.json +0 -0
  65. /package/{packages/react → react}/vite.config.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura-ui/sakura-ui",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "keywords": [],
5
5
  "author": "glassonion1",
6
6
  "homepage": "https://github.com/glassonion1/sakura-ui",
@@ -10,17 +10,14 @@
10
10
  },
11
11
  "license": "MIT",
12
12
  "exports": {
13
- "./packages/react": {
13
+ "./package.json": "./package.json",
14
+ "./react": {
14
15
  "require": "./dist/index.cjs.js",
15
16
  "import": "./dist/index.es.js"
16
17
  },
17
- "./packages/config": {
18
+ "./config": {
18
19
  "require": "./dist/index.cjs.js",
19
20
  "import": "./dist/index.es.js"
20
21
  }
21
- },
22
- "scripts": {
23
- "dev": "pnpm --parallel --filter \"./**\" dev",
24
- "build": "pnpm --parallel --filter \"./**\" build"
25
22
  }
26
23
  }
package/.prettierrc DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "tabWidth": 2,
3
- "singleQuote": true,
4
- "jsxSingleQuote": false,
5
- "trailingComma": "none",
6
- "semi": false,
7
- "overrides": [
8
- {
9
- "files": ["*.md", "README"],
10
- "options": {
11
- "parser": "markdown-nocjsp"
12
- }
13
- },
14
- {
15
- "files": ["*.mdx"],
16
- "options": {
17
- "parser": "mdx-nocjsp"
18
- }
19
- }
20
- ]
21
- }
package/README.md DELETED
@@ -1,37 +0,0 @@
1
- # Sakura UI
2
- Sakura UI - UI components built with Tailwind CSS for React.
3
-
4
- ## Install
5
- ```
6
- $ npm install @glassonion1/sakura-ui
7
- ```
8
- or
9
- ```
10
- $ yarn add @glassonion1/sakura-ui
11
- ```
12
-
13
- ## Standard Components
14
- - H1-H6 Headings
15
- - Link
16
- - Card
17
- - InfoCard
18
- - Ol
19
- - Ul
20
- - Table
21
- - Caption
22
- - Thead
23
- - Tbody
24
- - Th
25
- - Tr
26
- - Td
27
- - Code
28
- - Pre
29
-
30
- ## Form components
31
- - Button
32
- - IconButton
33
- - Radio
34
- - RadioGroup
35
- - Select
36
- - Text
37
- - Textarea
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Sakura UI Example</title>
7
- <link href="../../dist/style.css" rel="stylesheet" />
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="./src/index.tsx"></script>
12
- </body>
13
- </html>
@@ -1,10 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
3
-
4
- import { Button } from '../../src'
5
-
6
- ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
7
- <React.StrictMode>
8
- <Button>Test</Button>
9
- </React.StrictMode>
10
- )
@@ -1,3 +0,0 @@
1
- packages:
2
- - 'packages/**'
3
- - '!**/test/**'
@@ -1,72 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type ButtonProps = React.ComponentPropsWithoutRef<'button'> & {
5
- variant?: 'primary' | 'secondary'
6
- textAlign?: 'left' | 'right' | 'center'
7
- }
8
-
9
- export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
10
- (props, ref) => {
11
- // Make sure that there is no problem even if className is specified on the side that uses the component
12
- const { className, children, textAlign, variant, ...newProps } = props
13
-
14
- const align = textAlign ?? 'center'
15
-
16
- const style = `
17
- inline-block
18
- p-4
19
- text-base
20
- font-bold
21
- rounded-lg
22
- text-${align}
23
- cursor-pointer
24
- whitespace-nowrap
25
- `
26
-
27
- const primary = `
28
- text-white-1000
29
- bg-sea-600
30
- hover:bg-sea-800
31
- active:bg-sea-800
32
- focus:outline
33
- focus:outline-2
34
- focus:outline-wood-500
35
- disabled:bg-sumi-500
36
- disabled:text-white-1000
37
- disabled:border
38
- disabled:border-solid
39
- disabled:border-sumi-500
40
- `
41
- const secondary = `
42
- border
43
- border-solid
44
- border-sea-600
45
- hover:bg-sea-100
46
- active:bg-sea-100
47
- focus:outline
48
- focus:outline-2
49
- focus:outline-wood-500
50
- disabled:bg-sumi-500
51
- disabled:text-white-1000
52
- disabled:border
53
- disabled:border-solid
54
- disabled:border-sumi-500
55
- `
56
-
57
- const styles = {
58
- primary: primary,
59
- secondary: secondary
60
- }
61
-
62
- return (
63
- <button
64
- className={cx(style, styles[variant ?? 'primary'], className)}
65
- {...newProps}
66
- ref={ref}
67
- >
68
- {children}
69
- </button>
70
- )
71
- }
72
- )
@@ -1,22 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type Props = React.ComponentProps<'div'>
5
-
6
- export const Card = (props: Props) => {
7
- const { className, children, ...newProps } = props
8
-
9
- const style = `
10
- bg-sumi-50
11
- border
12
- border-solid
13
- border-sumi-900
14
- rounded-[12px]
15
- p-4
16
- `
17
- return (
18
- <div className={cx(style, props.className)} {...newProps}>
19
- {props.children}
20
- </div>
21
- )
22
- }
@@ -1,19 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type CodeProps = React.ComponentProps<'code'>
5
-
6
- export const Code = (props: CodeProps) => {
7
- const { className, children, ...newProps } = props
8
-
9
- const style = `
10
- bg-sumi-50
11
- font-mono
12
- `
13
-
14
- return (
15
- <code className={cx(style, className)} {...newProps}>
16
- {children}
17
- </code>
18
- )
19
- }
@@ -1,109 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type HeadingProps = React.ComponentProps<'h1'>
5
-
6
- const common = `
7
- font-bold
8
- `
9
-
10
- export const H1 = (props: HeadingProps) => {
11
- const { className, children, ...newProps } = props
12
-
13
- const style = `
14
- text-h1
15
- mt-16
16
- mb-6
17
- `
18
-
19
- return (
20
- <h1 className={cx(common, style, props.className)} {...newProps}>
21
- {props.children}
22
- </h1>
23
- )
24
- }
25
-
26
- export const H2 = (props: HeadingProps) => {
27
- // コンポーネントを使う側でclassNameを指定しても問題ないようにする
28
- const { className, children, ...newProps } = props
29
-
30
- const style = `
31
- text-h2
32
- mt-16
33
- mb-6
34
- `
35
-
36
- return (
37
- <h2 className={cx(common, style, props.className)} {...newProps}>
38
- {props.children}
39
- </h2>
40
- )
41
- }
42
-
43
- export const H3 = (props: HeadingProps) => {
44
- // コンポーネントを使う側でclassNameを指定しても問題ないようにする
45
- const { className, children, ...newProps } = props
46
-
47
- const style = `
48
- text-h3
49
- mt-10
50
- mb-6
51
- `
52
-
53
- return (
54
- <h3 className={cx(common, style, props.className)} {...newProps}>
55
- {props.children}
56
- </h3>
57
- )
58
- }
59
-
60
- export const H4 = (props: HeadingProps) => {
61
- // コンポーネントを使う側でclassNameを指定しても問題ないようにする
62
- const { className, children, ...newProps } = props
63
-
64
- const style = `
65
- text-h4
66
- mt-10
67
- mb-4
68
- `
69
-
70
- return (
71
- <h4 className={cx(common, style, props.className)} {...newProps}>
72
- {props.children}
73
- </h4>
74
- )
75
- }
76
-
77
- export const H5 = (props: HeadingProps) => {
78
- // コンポーネントを使う側でclassNameを指定しても問題ないようにする
79
- const { className, children, ...newProps } = props
80
-
81
- const style = `
82
- text-h5
83
- mt-10
84
- mb-4
85
- `
86
-
87
- return (
88
- <h5 className={cx(common, style, props.className)} {...newProps}>
89
- {props.children}
90
- </h5>
91
- )
92
- }
93
-
94
- export const H6 = (props: HeadingProps) => {
95
- // コンポーネントを使う側でclassNameを指定しても問題ないようにする
96
- const { className, children, ...newProps } = props
97
-
98
- const style = `
99
- text-h6
100
- mt-6
101
- mb-4
102
- `
103
-
104
- return (
105
- <h6 className={cx(common, style, props.className)} {...newProps}>
106
- {props.children}
107
- </h6>
108
- )
109
- }
@@ -1,71 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type IconButtonProps = React.ComponentProps<'button'> & {
5
- variant?: 'primary' | 'secondary'
6
- icon: string
7
- }
8
-
9
- export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
10
- (props, ref) => {
11
- const { className, children, icon, variant, ...newProps } = props
12
-
13
- const align = 'center'
14
-
15
- const style = `
16
- inline-block
17
- p-4
18
- text-base
19
- font-bold
20
- rounded-lg
21
- text-${align}
22
- cursor-pointer
23
- `
24
-
25
- const primary = `
26
- text-white-1000
27
- bg-sea-600
28
- hover:bg-sea-800
29
- active:bg-sea-800
30
- focus:outline
31
- focus:outline-2
32
- focus:outline-wood-500
33
- disabled:bg-sumi-500
34
- disabled:text-white-1000
35
- disabled:border
36
- disabled:border-solid
37
- disabled:border-sumi-500
38
- `
39
- const secondary = `
40
- border
41
- border-solid
42
- border-sea-600
43
- hover:bg-sea-100
44
- active:bg-sea-100
45
- focus:outline
46
- focus:outline-2
47
- focus:outline-wood-500
48
- disabled:bg-sumi-500
49
- disabled:text-white-1000
50
- disabled:border
51
- disabled:border-solid
52
- disabled:border-sumi-500
53
- `
54
-
55
- const styles = {
56
- primary: primary,
57
- secondary: secondary
58
- }
59
-
60
- return (
61
- <button
62
- className={cx(style, styles[variant ?? 'primary'], className)}
63
- {...newProps}
64
- ref={ref}
65
- >
66
- <img src={`/icons/${props.icon}.svg`} alt={props.icon} width="24" />
67
- {children}
68
- </button>
69
- )
70
- }
71
- )
@@ -1,36 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type Props = React.ComponentProps<'div'> & {
5
- title?: string
6
- }
7
-
8
- export const InfoCard = (props: Props) => {
9
- const { className, children, ...newProps } = props
10
-
11
- const style = `
12
- bg-sumi-50
13
- border-sumi-900
14
- border
15
- border-solid
16
- rounded-[12px]
17
- `
18
-
19
- const topStyle = `
20
- p-4
21
- text-h5
22
- font-bold
23
- `
24
-
25
- const bottmStyle = `
26
- px-4
27
- pb-4
28
- `
29
-
30
- return (
31
- <div className={cx(style, props.className)} {...newProps}>
32
- <h2 className={topStyle}>{props.title}</h2>
33
- <p className={bottmStyle}>{props.children}</p>
34
- </div>
35
- )
36
- }
@@ -1,73 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type LinkProps = React.ComponentProps<'a'>
5
-
6
- const getFileType = (url: string) => {
7
- const converted = url.toLowerCase()
8
-
9
- if (converted.endsWith('.pdf')) {
10
- return 'PDF'
11
- }
12
- if (converted.endsWith('.doc') || converted.endsWith('.docx')) {
13
- return 'Word'
14
- }
15
- if (converted.endsWith('.xls') || converted.endsWith('.xlsx')) {
16
- return 'Excel'
17
- }
18
- if (converted.endsWith('.csv')) {
19
- return 'CSV'
20
- }
21
- if (converted.endsWith('.json')) {
22
- return 'JSON'
23
- }
24
- if (converted.endsWith('.ndjson')) {
25
- return 'NDJSON'
26
- }
27
- if (converted.includes('youtu.be')) {
28
- return 'YouTube'
29
- }
30
- return null
31
- }
32
-
33
- export const Link = (props: LinkProps) => {
34
- const { className, children, ...newProps } = props
35
- const href = props.href ?? ''
36
- const fileType = getFileType(href)
37
-
38
- const style = `
39
- rounded-sm
40
- cursor-pointer
41
- text-sea-600
42
- underline
43
- underline-offset-[0.1em]
44
- hover:text-sea-800
45
- active:text-sea-800
46
- visited:text-sea-900
47
- focus:outline
48
- focus:outline-2
49
- focus:outline-wood-500
50
- disabled:border-sumi-500
51
- `
52
-
53
- if (href.startsWith('http')) {
54
- return (
55
- <a
56
- className={cx(style, props.className)}
57
- href={href}
58
- target="_blank"
59
- rel="noopener noreferrer"
60
- {...newProps}
61
- >
62
- {props.children}
63
- {fileType ? `(${fileType})` : null}
64
- </a>
65
- )
66
- }
67
- return (
68
- <a className={cx(style, props.className)} href={href} {...newProps}>
69
- {props.children}
70
- {fileType ? `(${fileType})` : null}
71
- </a>
72
- )
73
- }
@@ -1,38 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type UlProps = React.ComponentProps<'ul'>
5
-
6
- export const Ul = (props: UlProps) => {
7
- const { className, children, ...newprops } = props
8
-
9
- const style = `
10
- list-disc
11
- list-inside
12
- -indent-4
13
- pl-4
14
- `
15
- return (
16
- <ul className={cx(style, className)} {...newprops}>
17
- {children}
18
- </ul>
19
- )
20
- }
21
-
22
- export type OlProps = React.ComponentProps<'ol'>
23
-
24
- export const Ol = (props: OlProps) => {
25
- const { className, children, ...newprops } = props
26
-
27
- const style = `
28
- list-decimal
29
- list-inside
30
- -indent-4
31
- pl-4
32
- `
33
- return (
34
- <ol className={cx(style, className)} {...newprops}>
35
- {children}
36
- </ol>
37
- )
38
- }
@@ -1,22 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type PreProps = React.ComponentProps<'pre'>
5
-
6
- export const Pre = (props: PreProps) => {
7
- const { className, children, ...newProps } = props
8
-
9
- const style = `
10
- p-4
11
- bg-sumi-50
12
- rounded-lg
13
- whitespace-pre-wrap
14
- overflow-y-scroll
15
- `
16
-
17
- return (
18
- <pre className={cx(style, className)} {...newProps}>
19
- {children}
20
- </pre>
21
- )
22
- }
@@ -1,39 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type Props = React.ComponentProps<'input'> & {}
5
-
6
- export const Radio = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
7
- const { className, children, ...newProps } = props
8
-
9
- const style = `
10
- flex
11
- items-center
12
- text-sm
13
- cursor-pointer
14
- `
15
- const styleInput = `
16
- hidden
17
- peer
18
- `
19
-
20
- const styleRadio = `
21
- inline-block
22
- bg-clip-content
23
- w-6 h-6
24
- mr-2
25
- p-1
26
- rounded-full
27
- border
28
- border-solid
29
- border-sumi-900
30
- peer-checked:bg-sea-600
31
- `
32
- return (
33
- <label htmlFor={newProps.id} className={cx(style, className)}>
34
- <input className={styleInput} type="radio" {...newProps} ref={ref} />
35
- <span className={styleRadio}></span>
36
- {children}
37
- </label>
38
- )
39
- })
@@ -1,38 +0,0 @@
1
- import React from 'react'
2
- import { Radio } from './Radio'
3
-
4
- interface Item {
5
- label: string
6
- value: string
7
- }
8
-
9
- export interface RadioGroupProps {
10
- name: string
11
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
12
- items: Item[]
13
- }
14
-
15
- export const RadioGroup = ({ name, items, onChange }: RadioGroupProps) => {
16
- return (
17
- <>
18
- {items.map(({ label, value }, index) => {
19
- const itemId = name + value
20
-
21
- return (
22
- <div key={index}>
23
- <Radio
24
- className="mb-6 ml-4"
25
- id={itemId}
26
- name={name}
27
- value={value}
28
- onChange={onChange}
29
- defaultChecked={index === 0}
30
- >
31
- {label}
32
- </Radio>
33
- </div>
34
- )
35
- })}
36
- </>
37
- )
38
- }
@@ -1,41 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type Props = React.ComponentPropsWithoutRef<'select'>
5
-
6
- export const Select = React.forwardRef<HTMLSelectElement, Props>(
7
- (props, ref) => {
8
- const { className, children, ...newProps } = props
9
-
10
- const style = `
11
- block
12
- appearance-none
13
- w-full
14
- bg-white-100
15
- border
16
- border-solid
17
- border-sea-600
18
- py-4 px-4 pr-8
19
- rounded-[4px]
20
- focus:outline
21
- focus:outline-2
22
- focus:outline-wood-500
23
- `
24
- return (
25
- <div className="inline-block relative">
26
- <select className={cx(style, props.className)} {...newProps} ref={ref}>
27
- {props.children}
28
- </select>
29
- <div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2">
30
- <svg
31
- className="fill-current h-4 w-4"
32
- xmlns="http://www.w3.org/2000/svg"
33
- viewBox="0 0 20 20"
34
- >
35
- <path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
36
- </svg>
37
- </div>
38
- </div>
39
- )
40
- }
41
- )
@@ -1,111 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type TableProps = React.ComponentProps<'table'>
5
-
6
- const styleBorder = `
7
- border
8
- border-collapse
9
- border-sumi-900
10
- `
11
-
12
- export const Table = (props: TableProps) => {
13
- const { className, children, ...newprops } = props
14
-
15
- // If there is no break-all setting, the table will protrude when using a smartphone
16
- const style = `
17
- w-full
18
- table-auto
19
- break-all
20
- `
21
-
22
- return (
23
- <table className={cx(style, styleBorder, className)} {...newprops}>
24
- {children}
25
- </table>
26
- )
27
- }
28
-
29
- export type CaptionProps = React.ComponentProps<'caption'>
30
-
31
- export const Caption = (props: CaptionProps) => {
32
- const { className, children, ...newprops } = props
33
-
34
- const style = `text-left`
35
- return (
36
- <caption className={cx(style, className)} {...newprops}>
37
- {children}
38
- </caption>
39
- )
40
- }
41
-
42
- export type TheadProps = React.ComponentProps<'thead'>
43
-
44
- export const Thead = (props: TheadProps) => {
45
- const { className, children, ...newprops } = props
46
-
47
- return (
48
- <thead className={cx(className)} {...newprops}>
49
- {children}
50
- </thead>
51
- )
52
- }
53
-
54
- export type TbodyProps = React.ComponentProps<'tbody'>
55
-
56
- export const Tbody = (props: TbodyProps) => {
57
- const { className, children, ...newprops } = props
58
-
59
- return (
60
- <tbody className={cx(className)} {...newprops}>
61
- {children}
62
- </tbody>
63
- )
64
- }
65
-
66
- export type ThProps = React.ComponentProps<'th'>
67
-
68
- export const Th = (props: ThProps) => {
69
- const { className, children, ...newprops } = props
70
-
71
- const style = `
72
- p-2
73
- bg-sumi-100
74
- text-left
75
- `
76
- return (
77
- <th className={cx(style, styleBorder, className)} {...newprops}>
78
- {children}
79
- </th>
80
- )
81
- }
82
-
83
- export type TrProps = React.ComponentProps<'tr'>
84
-
85
- export const Tr = (props: TrProps) => {
86
- const { className, children, ...newprops } = props
87
-
88
- const style = ``
89
-
90
- return (
91
- <tr className={cx(style, styleBorder, className)} {...newprops}>
92
- {children}
93
- </tr>
94
- )
95
- }
96
-
97
- export type TdProps = React.ComponentProps<'td'>
98
-
99
- export const Td = (props: TdProps) => {
100
- const { className, children, ...newprops } = props
101
-
102
- const style = `
103
- p-2
104
- `
105
-
106
- return (
107
- <td className={cx(style, styleBorder, className)} {...newprops}>
108
- {children}
109
- </td>
110
- )
111
- }
@@ -1,35 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type TextProps = React.ComponentPropsWithoutRef<'input'>
5
-
6
- export const Text = React.forwardRef<HTMLInputElement, TextProps>(
7
- ({ ...props }, ref) => {
8
- const { className, ...newProps } = props
9
-
10
- const style = `
11
- p-4
12
- rounded-[4px]
13
- border
14
- border-solid
15
- border-sumi-900
16
- focus:outline
17
- focus:outline-2
18
- focus:outline-wood-500
19
- disabled:bg-sumi-500
20
- disabled:text-white-1000
21
- disabled:border
22
- disabled:border-solid
23
- disabled:border-sumi-500
24
- `
25
-
26
- return (
27
- <input
28
- type="text"
29
- className={cx(style, className)}
30
- {...newProps}
31
- ref={ref}
32
- />
33
- )
34
- }
35
- )
@@ -1,32 +0,0 @@
1
- import React from 'react'
2
- import { cx } from '../utils'
3
-
4
- export type TextareaProps = React.ComponentPropsWithoutRef<'textarea'>
5
-
6
- export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
7
- ({ ...props }, ref) => {
8
- const { className, children, ...newProps } = props
9
-
10
- const style = `
11
- p-4
12
- rounded-[12px]
13
- border
14
- border-solid
15
- border-sumi-900
16
- focus:outline
17
- focus:outline-2
18
- focus:outline-wood-500
19
- disabled:bg-sumi-500
20
- disabled:text-white-1000
21
- disabled:border
22
- disabled:border-solid
23
- disabled:border-sumi-500
24
- `
25
-
26
- return (
27
- <textarea className={cx(style, className)} {...newProps} ref={ref}>
28
- {children}
29
- </textarea>
30
- )
31
- }
32
- )
@@ -1,15 +0,0 @@
1
- export { Button } from './Button'
2
- export { Card } from './Card'
3
- export { Code } from './Code'
4
- export { H1, H2, H3, H4, H5, H6 } from './Heading'
5
- export { IconButton } from './IconButton'
6
- export { InfoCard } from './InfoCard'
7
- export { Link } from './Link'
8
- export { Ol, Ul } from './List'
9
- export { Pre } from './Pre'
10
- export { Radio } from './Radio'
11
- export { RadioGroup } from './RadioGroup'
12
- export { Select } from './Select'
13
- export { Table, Caption, Thead, Tbody, Th, Tr, Td } from './Table'
14
- export { Text } from './Text'
15
- export { Textarea } from './Textarea'
@@ -1,92 +0,0 @@
1
- export const extend = {
2
- fontSize: {
3
- h1: ['42px', '42px'],
4
- h2: ['32px', '32px'],
5
- h3: ['26px', '26px'],
6
- h4: ['22px', '22px'],
7
- h5: ['20px', '20px'],
8
- h6: ['18px', '18px'],
9
- base: ['16px', '28px'],
10
- code: ['16px', '24px'],
11
- sm: ['14px', '24px'],
12
- xs: ['12px', '20px']
13
- },
14
- colors: {
15
- white: {
16
- 1000: '#FFFFFF'
17
- },
18
- sea: {
19
- 900: '#0017B6',
20
- 800: '#0024CE',
21
- 700: '#0031D8',
22
- 600: '#003EE5',
23
- 500: '#0946F1',
24
- 400: '#4979F5',
25
- 300: '#7096F8',
26
- 200: '#9DB7F9',
27
- 100: '#C5D7FB',
28
- 50: '#E8F1FE'
29
- },
30
- sumi: {
31
- 900: '#1A1A1C',
32
- 800: '#414143',
33
- 700: '#626264',
34
- 600: '#757578',
35
- 500: '#949497',
36
- 400: '#B4B4B7',
37
- 300: '#D8D8DB',
38
- 200: '#E8E8EB',
39
- 100: '#F1F1F4',
40
- 50: '#F8F8FB'
41
- },
42
- forest: {
43
- 900: '#115A36',
44
- 800: '#197A4B',
45
- 700: '#1D8B56',
46
- 600: '#259D63',
47
- 500: '#2CAC6E',
48
- 400: '#51B883',
49
- 300: '#71C598',
50
- 200: '#9BD4B5',
51
- 100: '#C2E5D1',
52
- 50: '#E6F5Ec'
53
- },
54
- wood: {
55
- 900: '#B65200',
56
- 800: '#C16800',
57
- 700: '#C87504',
58
- 600: '#CD820A',
59
- 500: '#D18D0F',
60
- 400: '#D69C2B',
61
- 300: '#DCAC4D',
62
- 200: '#E5C47f',
63
- 100: '#EFDBB1',
64
- 50: '#F8F1E0'
65
- },
66
- sun: {
67
- 900: '#D50000',
68
- 800: '#EC0000',
69
- 700: '#FA1606',
70
- 600: '#FF220D',
71
- 500: '#FF4B36',
72
- 400: '#FF5838',
73
- 300: '#FF7B5C',
74
- 200: '#FFA28B',
75
- 100: '#FFC8B8',
76
- 50: '#FFE7E6'
77
- }
78
- },
79
- fontFamily: {
80
- sans: [
81
- 'Noto Sans JP',
82
- '-apple-system',
83
- 'blinkmacsystemfont',
84
- 'Segoe UI',
85
- 'Hiragino Kaku Gothic ProN',
86
- 'BIZ UDPGothic',
87
- 'meiryo',
88
- 'sans-serif'
89
- ],
90
- code: ['Monaco', 'Menlo', 'Consolas', 'Courier New', 'monospace']
91
- }
92
- }
package/src/index.ts DELETED
@@ -1,59 +0,0 @@
1
- import { extend } from './configs'
2
-
3
- interface Config {
4
- [prop: string]: any
5
- }
6
-
7
- //const content = ``
8
-
9
- export const sakuraConfig = (userConfig = {}) => {
10
- const newConfig: Config = {
11
- ...userConfig,
12
- theme: {
13
- extend: extend
14
- }
15
- }
16
- /*
17
- if (!newConfig.content) {
18
- newConfig.content = [content]
19
- } else if (Array.isArray(newConfig.content)) {
20
- newConfig.content = [...newConfig.content, content]
21
- } else if (newConfig.content.files) {
22
- newConfig.content.files = [...newConfig.content.files, content]
23
- } else if (!newConfig.content.files) {
24
- newConfig.content.files = [content]
25
- }
26
- */
27
-
28
- return newConfig
29
- }
30
-
31
- export {
32
- Button,
33
- Card,
34
- Code,
35
- H1,
36
- H2,
37
- H3,
38
- H4,
39
- H5,
40
- H6,
41
- IconButton,
42
- InfoCard,
43
- Link,
44
- Ol,
45
- Ul,
46
- Pre,
47
- Radio,
48
- RadioGroup,
49
- Select,
50
- Table,
51
- Caption,
52
- Thead,
53
- Tbody,
54
- Th,
55
- Tr,
56
- Td,
57
- Text,
58
- Textarea
59
- } from './components'
@@ -1 +0,0 @@
1
- export const cx = (...classNames: any[]) => classNames.filter(Boolean).join(' ')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes