@instructure/ui-buttons 11.0.1-snapshot-1 → 11.0.1-snapshot-2

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.
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [11.0.1-snapshot-1](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-1) (2025-10-08)
6
+ ## [11.0.1-snapshot-2](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-2) (2025-10-10)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-buttons
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-buttons",
3
- "version": "11.0.1-snapshot-1",
3
+ "version": "11.0.1-snapshot-2",
4
4
  "description": "Accessible button components",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "11.0.1-snapshot-1",
27
- "@instructure/ui-babel-preset": "11.0.1-snapshot-1",
28
- "@instructure/ui-themes": "11.0.1-snapshot-1",
26
+ "@instructure/ui-axe-check": "11.0.1-snapshot-2",
27
+ "@instructure/ui-babel-preset": "11.0.1-snapshot-2",
28
+ "@instructure/ui-themes": "11.0.1-snapshot-2",
29
29
  "@testing-library/jest-dom": "^6.6.3",
30
30
  "@testing-library/react": "15.0.7",
31
31
  "@testing-library/user-event": "^14.6.1",
@@ -33,19 +33,19 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.27.6",
36
- "@instructure/console": "11.0.1-snapshot-1",
37
- "@instructure/emotion": "11.0.1-snapshot-1",
38
- "@instructure/shared-types": "11.0.1-snapshot-1",
39
- "@instructure/ui-a11y-content": "11.0.1-snapshot-1",
40
- "@instructure/ui-a11y-utils": "11.0.1-snapshot-1",
41
- "@instructure/ui-color-utils": "11.0.1-snapshot-1",
42
- "@instructure/ui-dom-utils": "11.0.1-snapshot-1",
43
- "@instructure/ui-icons": "11.0.1-snapshot-1",
44
- "@instructure/ui-position": "11.0.1-snapshot-1",
45
- "@instructure/ui-react-utils": "11.0.1-snapshot-1",
46
- "@instructure/ui-tooltip": "11.0.1-snapshot-1",
47
- "@instructure/ui-utils": "11.0.1-snapshot-1",
48
- "@instructure/ui-view": "11.0.1-snapshot-1",
36
+ "@instructure/console": "11.0.1-snapshot-2",
37
+ "@instructure/emotion": "11.0.1-snapshot-2",
38
+ "@instructure/shared-types": "11.0.1-snapshot-2",
39
+ "@instructure/ui-a11y-content": "11.0.1-snapshot-2",
40
+ "@instructure/ui-a11y-utils": "11.0.1-snapshot-2",
41
+ "@instructure/ui-color-utils": "11.0.1-snapshot-2",
42
+ "@instructure/ui-dom-utils": "11.0.1-snapshot-2",
43
+ "@instructure/ui-icons": "11.0.1-snapshot-2",
44
+ "@instructure/ui-position": "11.0.1-snapshot-2",
45
+ "@instructure/ui-react-utils": "11.0.1-snapshot-2",
46
+ "@instructure/ui-tooltip": "11.0.1-snapshot-2",
47
+ "@instructure/ui-utils": "11.0.1-snapshot-2",
48
+ "@instructure/ui-view": "11.0.1-snapshot-2",
49
49
  "keycode": "^2"
50
50
  },
51
51
  "peerDependencies": {
@@ -97,56 +97,10 @@ type: example
97
97
 
98
98
  If you need to prevent text wrapping, you can use the [TruncateText](#TruncateText) util. You can also conditionally render a [Tooltip](#Tooltip) with the full text when truncation occurs.
99
99
 
100
- - ```js
101
- class Example extends React.Component {
102
- state = {
103
- isTruncated: false
104
- }
105
-
106
- handleUpdate = (isTruncated) => {
107
- if (this.state.isTruncated !== isTruncated) {
108
- this.setState({ isTruncated })
109
- }
110
- }
111
-
112
- renderButton() {
113
- return (
114
- <Button color="primary">
115
- <TruncateText onUpdate={this.handleUpdate}>
116
- {this.props.message}
117
- </TruncateText>
118
- </Button>
119
- )
120
- }
121
-
122
- render() {
123
- return (
124
- <View
125
- display="block"
126
- width="10rem"
127
- margin="small"
128
- padding="small none"
129
- withVisualDebug
130
- >
131
- {this.state.isTruncated ? (
132
- <Tooltip
133
- renderTip={this.props.message}
134
- mountNode={() => document.getElementById('main')}
135
- >
136
- {this.renderButton()}
137
- </Tooltip>
138
- ) : (
139
- this.renderButton()
140
- )}
141
- </View>
142
- )
143
- }
144
- }
145
-
146
- render(<Example message="A Button With a Whole Lot of Text" />)
147
- ```
148
-
149
- - ```js
100
+ ```js
101
+ ---
102
+ type: example
103
+ ---
150
104
  const Example = ({ message }) => {
151
105
  const [isTruncated, setIsTruncated] = useState(false)
152
106
 
@@ -187,7 +141,7 @@ If you need to prevent text wrapping, you can use the [TruncateText](#TruncateTe
187
141
  }
188
142
 
189
143
  render(<Example message="A Button With a Whole Lot of Text" />)
190
- ```
144
+ ```
191
145
 
192
146
  ### Display
193
147
 
@@ -5,37 +5,10 @@ describes: ToggleButton
5
5
  `ToggleButton` is a controlled button component used for toggling a status or setting
6
6
  between one of two states (locked/unlocked, published/unpublished, etc.).
7
7
 
8
- - ```javascript
9
- class Example extends React.Component {
10
- state = {
11
- locked: false
12
- }
13
-
14
- handleLocked = (e) => {
15
- this.setState((prevState) => ({ locked: !prevState.locked }))
16
- }
17
-
18
- render() {
19
- const locked = this.state.locked
20
-
21
- return (
22
- <View as="div" padding="x-large" id="toggleContainer">
23
- <ToggleButton
24
- status={locked ? 'pressed' : 'unpressed'}
25
- color={locked ? 'danger' : 'secondary'}
26
- renderIcon={locked ? IconLockSolid : IconUnlockLine}
27
- screenReaderLabel={locked ? 'Unlock assignment' : 'Lock assignment'}
28
- renderTooltipContent={locked ? 'Unlock' : 'Lock'}
29
- onClick={this.handleLocked}
30
- />
31
- </View>
32
- )
33
- }
34
- }
35
- render(<Example />)
36
- ```
37
-
38
- - ```js
8
+ ```js
9
+ ---
10
+ type: example
11
+ ---
39
12
  const Example = () => {
40
13
  const [locked, setLocked] = useState(false)
41
14
 
@@ -58,46 +31,14 @@ between one of two states (locked/unlocked, published/unpublished, etc.).
58
31
  }
59
32
 
60
33
  render(<Example />)
61
- ```
34
+ ```
62
35
 
63
36
  ### Inverse ToggleButton
64
37
 
65
- - ```javascript
66
- class InverseExample extends React.Component {
67
- state = {
68
- locked: false
69
- }
70
-
71
- handleLocked = (e) => {
72
- this.setState((prevState) => ({ locked: !prevState.locked }))
73
- }
74
-
75
- render() {
76
- const locked = this.state.locked
77
-
78
- return (
79
- <View
80
- as="div"
81
- padding="xx-large"
82
- background="primary-inverse"
83
- id="inverseToggleContainer"
84
- >
85
- <ToggleButton
86
- status={locked ? 'pressed' : 'unpressed'}
87
- color="primary-inverse"
88
- renderIcon={locked ? IconLockSolid : IconUnlockLine}
89
- screenReaderLabel={locked ? 'Unlock assignment' : 'Lock assignment'}
90
- renderTooltipContent={locked ? 'Unlock' : 'Lock'}
91
- onClick={this.handleLocked}
92
- />
93
- </View>
94
- )
95
- }
96
- }
97
- render(<InverseExample />)
98
- ```
99
-
100
- - ```js
38
+ ```js
39
+ ---
40
+ type: example
41
+ ---
101
42
  const InverseExample = () => {
102
43
  const [locked, setLocked] = useState(false)
103
44
 
@@ -124,7 +65,7 @@ between one of two states (locked/unlocked, published/unpublished, etc.).
124
65
  )
125
66
  }
126
67
  render(<InverseExample />)
127
- ```
68
+ ```
128
69
 
129
70
  ### Guidelines
130
71