@charcoal-ui/react 3.7.0 → 3.8.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 (100) hide show
  1. package/dist/components/Button/StyledButton.d.ts +1 -0
  2. package/dist/components/Button/StyledButton.d.ts.map +1 -1
  3. package/dist/components/Button/index.d.ts +1 -0
  4. package/dist/components/Button/index.d.ts.map +1 -1
  5. package/dist/components/Button/index.story.d.ts +16 -32
  6. package/dist/components/Button/index.story.d.ts.map +1 -1
  7. package/dist/components/Checkbox/index.d.ts.map +1 -1
  8. package/dist/components/DropdownSelector/ListItem/index.story.d.ts +7 -7
  9. package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +1 -1
  10. package/dist/components/DropdownSelector/MenuList/index.story.d.ts +6 -9
  11. package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +1 -1
  12. package/dist/components/DropdownSelector/Popover/index.story.d.ts +3 -7
  13. package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +1 -1
  14. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  15. package/dist/components/DropdownSelector/index.story.d.ts +9 -12
  16. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  17. package/dist/components/Icon/index.story.d.ts +4 -26
  18. package/dist/components/Icon/index.story.d.ts.map +1 -1
  19. package/dist/components/IconButton/index.d.ts +1 -0
  20. package/dist/components/IconButton/index.d.ts.map +1 -1
  21. package/dist/components/IconButton/index.story.d.ts +6 -25
  22. package/dist/components/IconButton/index.story.d.ts.map +1 -1
  23. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +8 -0
  24. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +1 -0
  25. package/dist/components/LoadingSpinner/index.d.ts +2 -2
  26. package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
  27. package/dist/components/LoadingSpinner/index.story.d.ts +4 -7
  28. package/dist/components/LoadingSpinner/index.story.d.ts.map +1 -1
  29. package/dist/components/Modal/index.story.d.ts +16 -41
  30. package/dist/components/Modal/index.story.d.ts.map +1 -1
  31. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  32. package/dist/components/Radio/index.d.ts +0 -2
  33. package/dist/components/Radio/index.d.ts.map +1 -1
  34. package/dist/components/Radio/index.story.d.ts +12 -23
  35. package/dist/components/Radio/index.story.d.ts.map +1 -1
  36. package/dist/components/SegmentedControl/index.story.d.ts +5 -8
  37. package/dist/components/SegmentedControl/index.story.d.ts.map +1 -1
  38. package/dist/components/Switch/index.d.ts.map +1 -1
  39. package/dist/components/Switch/index.story.d.ts +7 -12
  40. package/dist/components/Switch/index.story.d.ts.map +1 -1
  41. package/dist/components/TagItem/index.d.ts.map +1 -1
  42. package/dist/components/TagItem/index.story.d.ts +14 -24
  43. package/dist/components/TagItem/index.story.d.ts.map +1 -1
  44. package/dist/components/TextArea/TextArea.story.d.ts +7 -25
  45. package/dist/components/TextArea/TextArea.story.d.ts.map +1 -1
  46. package/dist/components/TextField/TextField.story.d.ts +13 -20
  47. package/dist/components/TextField/TextField.story.d.ts.map +1 -1
  48. package/dist/components/TextField/index.d.ts.map +1 -1
  49. package/dist/index.cjs.js +80 -86
  50. package/dist/index.cjs.js.map +1 -1
  51. package/dist/index.esm.js +80 -86
  52. package/dist/index.esm.js.map +1 -1
  53. package/dist/styled.d.ts +4 -4
  54. package/package.json +6 -6
  55. package/src/components/Button/StyledButton.tsx +19 -14
  56. package/src/components/Button/__snapshots__/index.story.storyshot +314 -118
  57. package/src/components/Button/index.story.tsx +141 -138
  58. package/src/components/Button/index.tsx +3 -0
  59. package/src/components/Checkbox/__snapshots__/index.story.storyshot +12 -27
  60. package/src/components/Checkbox/index.tsx +2 -12
  61. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  62. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +42 -37
  63. package/src/components/DropdownSelector/ListItem/index.story.tsx +8 -4
  64. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +38 -38
  65. package/src/components/DropdownSelector/MenuList/index.story.tsx +33 -27
  66. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +11 -5
  67. package/src/components/DropdownSelector/Popover/index.story.tsx +6 -6
  68. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +145 -47
  69. package/src/components/DropdownSelector/index.story.tsx +207 -204
  70. package/src/components/DropdownSelector/index.tsx +17 -10
  71. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  72. package/src/components/Icon/index.story.tsx +8 -12
  73. package/src/components/IconButton/__snapshots__/index.story.storyshot +130 -13
  74. package/src/components/IconButton/index.story.tsx +30 -23
  75. package/src/components/IconButton/index.tsx +32 -20
  76. package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +12 -0
  77. package/src/components/LoadingSpinner/__snapshots__/LoadingSpinnerIcon.story.storyshot +28 -0
  78. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +1 -35
  79. package/src/components/LoadingSpinner/index.story.tsx +11 -54
  80. package/src/components/LoadingSpinner/index.tsx +1 -1
  81. package/src/components/Modal/__snapshots__/index.story.storyshot +212 -171
  82. package/src/components/Modal/index.story.tsx +139 -133
  83. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +56 -4
  84. package/src/components/MultiSelect/index.tsx +3 -0
  85. package/src/components/Radio/__snapshots__/index.story.storyshot +981 -121
  86. package/src/components/Radio/index.story.tsx +128 -63
  87. package/src/components/Radio/index.tsx +10 -16
  88. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  89. package/src/components/SegmentedControl/index.story.tsx +24 -29
  90. package/src/components/Switch/__snapshots__/index.story.storyshot +184 -26
  91. package/src/components/Switch/index.story.tsx +72 -48
  92. package/src/components/Switch/index.tsx +2 -7
  93. package/src/components/TagItem/__snapshots__/index.story.storyshot +72 -33
  94. package/src/components/TagItem/index.story.tsx +154 -159
  95. package/src/components/TagItem/index.tsx +2 -6
  96. package/src/components/TextArea/TextArea.story.tsx +29 -32
  97. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +127 -73
  98. package/src/components/TextField/TextField.story.tsx +67 -66
  99. package/src/components/TextField/__snapshots__/TextField.story.storyshot +182 -147
  100. package/src/components/TextField/index.tsx +0 -7
package/dist/styled.d.ts CHANGED
@@ -61,17 +61,17 @@ export declare const theme: (specFn: (o: Record<string, unknown> & Readonly<{
61
61
  }> & {
62
62
  readonly typography: (size: keyof import("@charcoal-ui/theme").Typography) => import("@charcoal-ui/styled/dist/factories/lib").PropertyChain<import("@charcoal-ui/styled/dist/internals").Internal, "bold" | "monospace" | "preserveHalfLeading">;
63
63
  } & {
64
- readonly margin: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
65
- readonly padding: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
64
+ readonly margin: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 40 | 8 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
65
+ readonly padding: import("@charcoal-ui/styled/dist/factories/lib").MethodChain<import("@charcoal-ui/styled/dist/internals").Internal, "horizontal" | "vertical" | "all" | "bottom" | "left" | "right" | "top", [0 | "auto" | 4 | 40 | 8 | 16 | 24 | 64 | 104 | 168 | 272 | 440]>;
66
66
  } & {
67
67
  readonly height: Readonly<{
68
- px: (size: 0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
68
+ px: (size: 0 | "auto" | 4 | 40 | 8 | 16 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
69
69
  column: (span: number) => import("@charcoal-ui/styled/dist/internals").Internal;
70
70
  auto: import("@charcoal-ui/styled/dist/internals").Internal;
71
71
  full: import("@charcoal-ui/styled/dist/internals").Internal;
72
72
  }>;
73
73
  readonly width: Readonly<{
74
- px: (size: 0 | "auto" | 4 | 8 | 40 | 16 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
74
+ px: (size: 0 | "auto" | 4 | 40 | 8 | 16 | 24 | 64 | 104 | 168 | 272 | 440) => import("@charcoal-ui/styled/dist/internals").Internal;
75
75
  column: (span: number) => import("@charcoal-ui/styled/dist/internals").Internal;
76
76
  auto: import("@charcoal-ui/styled/dist/internals").Internal;
77
77
  full: import("@charcoal-ui/styled/dist/internals").Internal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcoal-ui/react",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -51,10 +51,10 @@
51
51
  "typescript": "^4.9.5"
52
52
  },
53
53
  "dependencies": {
54
- "@charcoal-ui/icons": "^3.7.0",
55
- "@charcoal-ui/styled": "^3.7.0",
56
- "@charcoal-ui/theme": "^3.7.0",
57
- "@charcoal-ui/utils": "^3.7.0",
54
+ "@charcoal-ui/icons": "^3.8.0",
55
+ "@charcoal-ui/styled": "^3.8.0",
56
+ "@charcoal-ui/theme": "^3.8.0",
57
+ "@charcoal-ui/utils": "^3.8.0",
58
58
  "@react-aria/button": "^3.9.1",
59
59
  "@react-aria/checkbox": "^3.13.0",
60
60
  "@react-aria/dialog": "^3.5.10",
@@ -87,5 +87,5 @@
87
87
  "url": "https://github.com/pixiv/charcoal.git",
88
88
  "directory": "packages/react"
89
89
  },
90
- "gitHead": "ebb9480045faf2418cb5a2f95f69848f946e14ed"
90
+ "gitHead": "939ab20e11455ff9cba840c38c7dfd33cd739b59"
91
91
  }
@@ -3,6 +3,7 @@ import Clickable from '../Clickable'
3
3
  import { variantToFont } from './lib/variantToFont'
4
4
  import { variantToBackground } from './lib/variantToBackground'
5
5
  import type { Size } from '.'
6
+ import { focusVisibleFocusRingCss } from '@charcoal-ui/styled'
6
7
 
7
8
  const horizontalPaddingSmall = css`
8
9
  padding-right: 16px;
@@ -19,6 +20,7 @@ type StyledButtonProps = {
19
20
  $size: Size
20
21
  $background: ReturnType<typeof variantToBackground>
21
22
  $color: ReturnType<typeof variantToFont>
23
+ $isActive: boolean
22
24
  }
23
25
 
24
26
  export const StyledButton = styled(Clickable)<StyledButtonProps>`
@@ -41,21 +43,24 @@ export const StyledButton = styled(Clickable)<StyledButtonProps>`
41
43
 
42
44
  &:not(:disabled):not([aria-disabled]),
43
45
  &[aria-disabled='false'] {
44
- &:active,
45
- &:focus,
46
- &:focus-visible {
47
- outline: none;
48
- box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
49
- }
46
+ ${focusVisibleFocusRingCss}
50
47
 
51
- &:hover {
52
- color: var(--charcoal-${(p) => p.$color}-hover);
53
- background-color: var(--charcoal-${(p) => p.$background}-hover);
54
- }
55
- &:active {
56
- color: var(--charcoal-${(p) => p.$color}-press);
57
- background-color: var(--charcoal-${(p) => p.$background}-press);
58
- }
48
+ ${({ $isActive: $active, $color, $background }) =>
49
+ $active
50
+ ? css`
51
+ color: var(--charcoal-${$color}-press);
52
+ background-color: var(--charcoal-${$background}-press);
53
+ `
54
+ : css`
55
+ &:hover {
56
+ color: var(--charcoal-${$color}-hover);
57
+ background-color: var(--charcoal-${$background}-hover);
58
+ }
59
+ &:active {
60
+ color: var(--charcoal-${$color}-press);
61
+ background-color: var(--charcoal-${$background}-press);
62
+ }
63
+ `}
59
64
  }
60
65
 
61
66
  &:disabled,