@codecademy/styleguide 78.5.6-alpha.abebfb.0 → 78.5.6-alpha.c2d955.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.
package/CHANGELOG.md CHANGED
@@ -3,10 +3,6 @@
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
- ### [78.5.6-alpha.abebfb.0](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@78.5.5...@codecademy/styleguide@78.5.6-alpha.abebfb.0) (2026-01-20)
7
-
8
- **Note:** Version bump only for package @codecademy/styleguide
9
-
10
6
  ### [78.5.5](https://github.com/Codecademy/gamut/compare/@codecademy/styleguide@78.5.4...@codecademy/styleguide@78.5.5) (2026-01-07)
11
7
 
12
8
  **Note:** Version bump only for package @codecademy/styleguide
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@codecademy/styleguide",
3
3
  "description": "Styleguide & Component library for codecademy.com",
4
- "version": "78.5.6-alpha.abebfb.0",
4
+ "version": "78.5.6-alpha.c2d955.0",
5
5
  "author": "Codecademy Engineering",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
- "repository": "git@github.com:Codecademy/gamut.git",
11
- "gitHead": "bb48e953c9bd7f75ef8f34e6f61d19b40db48901"
10
+ "repository": "git@github.com:Codecademy/gamut.git"
12
11
  }
@@ -1,9 +1,7 @@
1
- import { DetailedCode } from '@codecademy/gamut';
2
1
  import { Canvas, Controls, Meta } from '@storybook/blocks';
3
2
 
4
3
  import { ComponentHeader, LinkTo } from '~styleguide/blocks';
5
4
 
6
- import { codeExample } from './codeExample';
7
5
  import * as ConnectedFormStories from './ConnectedForm.stories';
8
6
 
9
7
  export const parameters = {
@@ -42,7 +40,75 @@ This hook also returns the `FormRequiredText` component - include this before yo
42
40
 
43
41
  ### Example code
44
42
 
45
- <DetailedCode language="tsx" code={codeExample} preview />
43
+ ```tsx
44
+ import {
45
+ ConnectedCheckbox,
46
+ ConnectedInput,
47
+ ConnectedSelect,
48
+ useConnectedForm,
49
+ } from '@codecademy/gamut';
50
+
51
+ import { TerminalIcon } from '@codecademy/gamut-icons';
52
+
53
+ export const GoodForm = () => {
54
+ const {
55
+ ConnectedFormGroup,
56
+ ConnectedForm,
57
+ connectedFormProps,
58
+ FormRequiredText,
59
+ } = useConnectedForm({
60
+ defaultValues: {
61
+ thisField: true,
62
+ thatField: 'zero',
63
+ anotherField: 'state your name.',
64
+ },
65
+ validationRules: {
66
+ thisField: { required: 'you need to check this.' },
67
+ thatField: {
68
+ pattern: {
69
+ value: /^(?:(?!zero).)*$/,
70
+ message: 'literally anything but zero',
71
+ },
72
+ },
73
+ },
74
+ });
75
+
76
+ return (
77
+ <ConnectedForm
78
+ onSubmit={({ thisField }) => console.log(thisField)}
79
+ resetOnSubmit
80
+ {...connectedFormProps}
81
+ >
82
+ <SubmitButton>submit this form.</SubmitButton>
83
+ <ConnectedFormGroup
84
+ name="thisField"
85
+ label="cool checkbox bruh"
86
+ field={{
87
+ component: ConnectedCheckbox,
88
+ label: 'check it ouuut',
89
+ }}
90
+ />
91
+ <ConnectedFormGroup
92
+ name="thatField"
93
+ label="cool select dude"
94
+ field={{
95
+ component: ConnectedSelect,
96
+ options: ['one', 'two', 'zero'],
97
+ }}
98
+ />
99
+ <ConnectedFormGroup
100
+ name="anotherField"
101
+ label="cool input"
102
+ field={{
103
+ component: ConnectedInput,
104
+ icon: TerminalIcon,
105
+ }}
106
+ />
107
+ <FormRequiredText />
108
+ </ConnectedForm>
109
+ );
110
+ };
111
+ ```
46
112
 
47
113
  ## Variants
48
114
 
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2022 Codecademy LLC
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,67 +0,0 @@
1
- export const codeExample = `import {
2
- ConnectedCheckbox,
3
- ConnectedInput,
4
- ConnectedSelect,
5
- useConnectedForm,
6
- } from '@codecademy/gamut';
7
-
8
- import { TerminalIcon } from '@codecademy/gamut-icons';
9
-
10
- export const GoodForm = () => {
11
- const {
12
- ConnectedFormGroup,
13
- ConnectedForm,
14
- connectedFormProps,
15
- FormRequiredText,
16
- } = useConnectedForm({
17
- defaultValues: {
18
- thisField: true,
19
- thatField: 'zero',
20
- anotherField: 'state your name.',
21
- },
22
- validationRules: {
23
- thisField: { required: 'you need to check this.' },
24
- thatField: {
25
- pattern: {
26
- value: /^(?:(?!zero).)*$/,
27
- message: 'literally anything but zero',
28
- },
29
- },
30
- },
31
- });
32
-
33
- return (
34
- <ConnectedForm
35
- onSubmit={({ thisField }) => console.log(thisField)}
36
- resetOnSubmit
37
- {...connectedFormProps}
38
- >
39
- <SubmitButton>submit this form.</SubmitButton>
40
- <ConnectedFormGroup
41
- name="thisField"
42
- label="cool checkbox bruh"
43
- field={{
44
- component: ConnectedCheckbox,
45
- label: 'check it ouuut',
46
- }}
47
- />
48
- <ConnectedFormGroup
49
- name="thatField"
50
- label="cool select dude"
51
- field={{
52
- component: ConnectedSelect,
53
- options: ['one', 'two', 'zero'],
54
- }}
55
- />
56
- <ConnectedFormGroup
57
- name="anotherField"
58
- label="cool input"
59
- field={{
60
- component: ConnectedInput,
61
- icon: TerminalIcon,
62
- }}
63
- />
64
- <FormRequiredText />
65
- </ConnectedForm>
66
- );
67
- };`;