@jig-ui/react 0.1.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 (109) hide show
  1. package/LICENSE +52 -0
  2. package/README.md +193 -0
  3. package/dist/adorn/adorn.d.ts +38 -0
  4. package/dist/adorn/index.d.ts +2 -0
  5. package/dist/box/box.d.ts +32 -0
  6. package/dist/box/index.d.ts +2 -0
  7. package/dist/breakpoints.d.ts +35 -0
  8. package/dist/button/button.d.ts +37 -0
  9. package/dist/button/index.d.ts +2 -0
  10. package/dist/codeblock/codeblock.d.ts +28 -0
  11. package/dist/codeblock/index.d.ts +2 -0
  12. package/dist/collapsible/collapsible.d.ts +116 -0
  13. package/dist/collapsible/index.d.ts +2 -0
  14. package/dist/combobox/combobox.d.ts +119 -0
  15. package/dist/combobox/index.d.ts +2 -0
  16. package/dist/dev.d.ts +14 -0
  17. package/dist/dialog/dialog.d.ts +80 -0
  18. package/dist/dialog/index.d.ts +2 -0
  19. package/dist/focus-ring.d.ts +15 -0
  20. package/dist/grid/grid.d.ts +54 -0
  21. package/dist/grid/index.d.ts +2 -0
  22. package/dist/icon/generated/arrow-down.d.ts +4 -0
  23. package/dist/icon/generated/arrow-left.d.ts +4 -0
  24. package/dist/icon/generated/arrow-right.d.ts +4 -0
  25. package/dist/icon/generated/arrow-square-out.d.ts +4 -0
  26. package/dist/icon/generated/arrow-up.d.ts +4 -0
  27. package/dist/icon/generated/bell.d.ts +4 -0
  28. package/dist/icon/generated/calendar.d.ts +4 -0
  29. package/dist/icon/generated/caret-down.d.ts +4 -0
  30. package/dist/icon/generated/caret-left.d.ts +4 -0
  31. package/dist/icon/generated/caret-right.d.ts +4 -0
  32. package/dist/icon/generated/caret-up.d.ts +4 -0
  33. package/dist/icon/generated/check-circle.d.ts +4 -0
  34. package/dist/icon/generated/check.d.ts +4 -0
  35. package/dist/icon/generated/clock.d.ts +4 -0
  36. package/dist/icon/generated/copy.d.ts +4 -0
  37. package/dist/icon/generated/dots-nine.d.ts +4 -0
  38. package/dist/icon/generated/dots-three.d.ts +4 -0
  39. package/dist/icon/generated/eye-slash.d.ts +4 -0
  40. package/dist/icon/generated/eye.d.ts +4 -0
  41. package/dist/icon/generated/gear.d.ts +4 -0
  42. package/dist/icon/generated/github-logo.d.ts +4 -0
  43. package/dist/icon/generated/heart.d.ts +4 -0
  44. package/dist/icon/generated/index.d.ts +151 -0
  45. package/dist/icon/generated/info.d.ts +4 -0
  46. package/dist/icon/generated/list.d.ts +4 -0
  47. package/dist/icon/generated/magnifying-glass.d.ts +4 -0
  48. package/dist/icon/generated/minus.d.ts +4 -0
  49. package/dist/icon/generated/moon.d.ts +4 -0
  50. package/dist/icon/generated/pencil-simple.d.ts +4 -0
  51. package/dist/icon/generated/plus.d.ts +4 -0
  52. package/dist/icon/generated/question.d.ts +4 -0
  53. package/dist/icon/generated/star.d.ts +4 -0
  54. package/dist/icon/generated/sun.d.ts +4 -0
  55. package/dist/icon/generated/trash.d.ts +4 -0
  56. package/dist/icon/generated/user.d.ts +4 -0
  57. package/dist/icon/generated/warning-circle.d.ts +4 -0
  58. package/dist/icon/generated/warning.d.ts +4 -0
  59. package/dist/icon/generated/x.d.ts +4 -0
  60. package/dist/icon/icon.d.ts +46 -0
  61. package/dist/icon/index.d.ts +2 -0
  62. package/dist/icon-BRHwInc5.js +165 -0
  63. package/dist/icon-B_NrwKaL.js +173 -0
  64. package/dist/iconbutton/iconbutton.d.ts +35 -0
  65. package/dist/iconbutton/index.d.ts +2 -0
  66. package/dist/icons.d.ts +17 -0
  67. package/dist/icons.js +2 -0
  68. package/dist/index.d.ts +56 -0
  69. package/dist/index.js +3061 -0
  70. package/dist/input/index.d.ts +2 -0
  71. package/dist/input/input.d.ts +63 -0
  72. package/dist/layout.d.ts +87 -0
  73. package/dist/link/index.d.ts +2 -0
  74. package/dist/link/link.d.ts +125 -0
  75. package/dist/listitem/index.d.ts +2 -0
  76. package/dist/listitem/listitem.d.ts +92 -0
  77. package/dist/polymorphic.d.ts +31 -0
  78. package/dist/reset.css +4 -0
  79. package/dist/responsive.d.ts +10 -0
  80. package/dist/scrollarea/index.d.ts +2 -0
  81. package/dist/scrollarea/scrollarea.d.ts +26 -0
  82. package/dist/separator/index.d.ts +2 -0
  83. package/dist/separator/separator.d.ts +48 -0
  84. package/dist/sidenav/index.d.ts +2 -0
  85. package/dist/sidenav/sidenav.d.ts +35 -0
  86. package/dist/sidenavsection/index.d.ts +2 -0
  87. package/dist/sidenavsection/sidenavsection.d.ts +44 -0
  88. package/dist/slider/index.d.ts +2 -0
  89. package/dist/slider/slider.d.ts +73 -0
  90. package/dist/spacing.d.ts +35 -0
  91. package/dist/stack/index.d.ts +2 -0
  92. package/dist/stack/stack.d.ts +52 -0
  93. package/dist/structuredlist/index.d.ts +2 -0
  94. package/dist/structuredlist/structuredlist.d.ts +104 -0
  95. package/dist/styles.css +911 -0
  96. package/dist/togglebutton/index.d.ts +2 -0
  97. package/dist/togglebutton/togglebutton.d.ts +93 -0
  98. package/dist/togglebuttongroup/index.d.ts +2 -0
  99. package/dist/togglebuttongroup/togglebuttongroup.d.ts +72 -0
  100. package/dist/token/index.d.ts +2 -0
  101. package/dist/token/token.d.ts +82 -0
  102. package/dist/tokens-vars.d.ts +579 -0
  103. package/dist/tokens.d.ts +24 -0
  104. package/dist/tokens.js +577 -0
  105. package/dist/tooltip/index.d.ts +2 -0
  106. package/dist/tooltip/tooltip.d.ts +52 -0
  107. package/dist/typography/index.d.ts +2 -0
  108. package/dist/typography/typography.d.ts +71 -0
  109. package/package.json +81 -0
@@ -0,0 +1,71 @@
1
+ import { SpacingProps } from '../spacing';
2
+ import { PolymorphicProps } from '../polymorphic';
3
+ /**
4
+ * The elements Typography is willing to render as. `with` chooses how the text
5
+ * looks; `as` chooses what it means, and the two are deliberately independent —
6
+ * a `heading01` preset on a `<p>` is a legitimate thing to want.
7
+ */
8
+ export type TypographyElement = 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'blockquote' | 'figcaption';
9
+ /**
10
+ * The semantic text roles.
11
+ *
12
+ * A register rather than a colour: `danger` is not red, it is *danger*, and it
13
+ * resolves to a different red in each theme. Named `tone` rather than `color`
14
+ * because `Token`'s `color` prop names a hue, and 0006 D2 keeps those two
15
+ * ideas apart. Decided in apps/docs/decisions/0010-typography-tone.html (D2).
16
+ */
17
+ export type TypographyTone = 'primary' | 'secondary' | 'muted' | 'accent' | 'danger' | 'inverse';
18
+ /** The type presets. Exported so consumers building wrappers can name one. */
19
+ export type TypeStyles = 'display01' | 'display02' | 'display03' | 'display04' | 'display05' | 'display06' | 'heading01' | 'heading02' | 'heading03' | 'heading04' | 'heading05' | 'heading06' | 'body01' | 'body02' | 'caption01' | 'caption02' | 'code01';
20
+ /** Typography's own props. The element's own attributes are added by PolymorphicProps. */
21
+ export interface TypographyOwnProps extends SpacingProps {
22
+ with?: TypeStyles;
23
+ /**
24
+ * Evens out the line lengths rather than filling each line before breaking,
25
+ * so a heading does not end on a single orphaned word. Meant for short text
26
+ * that wraps to a few lines — headings, standfirsts, captions; browsers cap
27
+ * `text-wrap: balance` at a handful of lines, so it does nothing for a
28
+ * paragraph.
29
+ */
30
+ balance?: boolean;
31
+ /**
32
+ * Which semantic text role the text takes. Sets the colour, and with it the
33
+ * hover colour of any `Link` inside — so a link in muted prose hovers to
34
+ * muted's own partner rather than to body copy's.
35
+ *
36
+ * **`inverse` needs an inverted surface.** It is the one role that is a
37
+ * context rather than a register: it paints light ink for a dark panel
38
+ * (`color.surfaces.inverse`), and on the ordinary body surface it renders
39
+ * text the same colour as the page. Nothing can check this — whether the
40
+ * background behind is inverted is not knowable from here, at render time or
41
+ * from computed style, because any ancestor may have painted it. 0010 D3
42
+ * exposed it anyway, and this note is the guard.
43
+ */
44
+ tone?: TypographyTone;
45
+ }
46
+ export type TypographyProps<E extends TypographyElement = 'div'> = PolymorphicProps<E, TypographyOwnProps>;
47
+ /**
48
+ * Text.
49
+ *
50
+ * `with` chooses how it looks and `as` chooses what it means, independently —
51
+ * a `heading01` preset on a `<p>` is a legitimate thing to want, and headings
52
+ * should be levelled for the document outline rather than for their size.
53
+ *
54
+ * `tone` sets the semantic colour, and with it the hover colour of any `Link`
55
+ * inside, so a link in muted prose stays in that register.
56
+ *
57
+ * `balance` evens out line lengths so a heading does not end on a single
58
+ * orphaned word; it is capped at a few lines, so it does nothing for a
59
+ * paragraph.
60
+ *
61
+ * Takes the margin and padding props for spacing around it.
62
+ *
63
+ * @example
64
+ * <Typography as="h2" with="heading03" balance mb="400">
65
+ * A heading that wraps evenly
66
+ * </Typography>
67
+ * <Typography as="p" tone="muted">
68
+ * Supporting copy, with <Link href="/more">a link</Link> in it.
69
+ * </Typography>
70
+ */
71
+ export declare function Typography<E extends TypographyElement = 'div'>({ with: typeStyle, balance, tone, as, className, children, ...props }: TypographyProps<E>): import("react/jsx-runtime").JSX.Element;
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@jig-ui/react",
3
+ "version": "0.1.0",
4
+ "description": "Jig design system — React components",
5
+ "license": "MIT",
6
+ "author": "Nate Bridi",
7
+ "type": "module",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/natebridi/jig.git",
11
+ "directory": "packages/components"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "sideEffects": [
17
+ "**/*.css"
18
+ ],
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./tokens": {
27
+ "types": "./dist/tokens.d.ts",
28
+ "default": "./dist/tokens.js"
29
+ },
30
+ "./icons": {
31
+ "types": "./dist/icons.d.ts",
32
+ "default": "./dist/icons.js"
33
+ },
34
+ "./styles.css": "./dist/styles.css",
35
+ "./reset.css": "./dist/reset.css",
36
+ "./package.json": "./package.json"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "peerDependencies": {
42
+ "react": ">=19",
43
+ "react-dom": ">=19"
44
+ },
45
+ "devDependencies": {
46
+ "@phosphor-icons/core": "^2.1.1",
47
+ "@storybook/react-vite": "^10.5.7",
48
+ "@testing-library/jest-dom": "^7.0.1",
49
+ "@testing-library/react": "^16.3.2",
50
+ "@testing-library/user-event": "^14.6.4",
51
+ "@types/react": "^19.2.14",
52
+ "@types/react-dom": "^19.2.3",
53
+ "@vanilla-extract/css": "^1.20.0",
54
+ "@vanilla-extract/recipes": "^0.5.7",
55
+ "@vanilla-extract/sprinkles": "^1.6.5",
56
+ "@vanilla-extract/vite-plugin": "^5.2.1",
57
+ "jsdom": "^30.0.1",
58
+ "react": "^19.2.4",
59
+ "react-dom": "^19.2.4",
60
+ "storybook": "^10.5.7",
61
+ "typescript": "^6.0.2",
62
+ "vite": "8.0.3",
63
+ "vite-plugin-dts": "^4.5.4",
64
+ "vitest": "^4.1.10",
65
+ "@jig-ui/styles": "0.0.0",
66
+ "@jig-ui/tsconfig": "0.0.0"
67
+ },
68
+ "dependencies": {
69
+ "@base-ui/react": "~1.7.0"
70
+ },
71
+ "scripts": {
72
+ "build": "vite build",
73
+ "typecheck": "tsc --noEmit -p tsconfig.json",
74
+ "generate:icons": "node scripts/generate-icons.mjs",
75
+ "check:icons": "node scripts/generate-icons.mjs && git diff --exit-code --stat -- src/icon/generated",
76
+ "dev": "vite build --watch",
77
+ "pack:local": "pnpm build && pnpm pack",
78
+ "test": "vitest run",
79
+ "test:packed": "node scripts/packed-consumer-test.mjs"
80
+ }
81
+ }