@codecademy/gamut 68.6.1-alpha.f6b2ce.0 → 68.6.2-alpha.1fc7ca.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 (59) hide show
  1. package/dist/Modals/elements.d.ts +186 -1
  2. package/dist/Modals/elements.js +3 -3
  3. package/dist/{InternalFloatingCard/InternalFloatingCard.d.ts → PatternBackdrop/PatternBackdrop.d.ts} +8 -24
  4. package/dist/PatternBackdrop/PatternBackdrop.js +42 -0
  5. package/dist/Toast/Toast.js +4 -4
  6. package/package.json +8 -11
  7. package/agent-tools/.claude-plugin/marketplace.json +0 -16
  8. package/agent-tools/.claude-plugin/plugin.json +0 -7
  9. package/agent-tools/.cursor-plugin/plugin.json +0 -7
  10. package/agent-tools/DESIGN.Codecademy.md +0 -696
  11. package/agent-tools/DESIGN.LXStudio.md +0 -512
  12. package/agent-tools/DESIGN.Percipio.md +0 -513
  13. package/agent-tools/DESIGN.md +0 -1
  14. package/agent-tools/agents/.gitkeep +0 -0
  15. package/agent-tools/commands/gamut-review.md +0 -259
  16. package/agent-tools/guidelines/components/animations.md +0 -74
  17. package/agent-tools/guidelines/components/buttons.md +0 -95
  18. package/agent-tools/guidelines/components/card.md +0 -19
  19. package/agent-tools/guidelines/components/coachmark.md +0 -21
  20. package/agent-tools/guidelines/components/data-table.md +0 -79
  21. package/agent-tools/guidelines/components/forms.md +0 -106
  22. package/agent-tools/guidelines/components/loading-states.md +0 -17
  23. package/agent-tools/guidelines/components/menu.md +0 -58
  24. package/agent-tools/guidelines/components/overview.md +0 -124
  25. package/agent-tools/guidelines/components/radial-progress.md +0 -13
  26. package/agent-tools/guidelines/components/select.md +0 -23
  27. package/agent-tools/guidelines/components/tooltips.md +0 -22
  28. package/agent-tools/guidelines/components/video.md +0 -29
  29. package/agent-tools/guidelines/foundations/color.md +0 -168
  30. package/agent-tools/guidelines/foundations/modes.md +0 -69
  31. package/agent-tools/guidelines/foundations/spacing.md +0 -107
  32. package/agent-tools/guidelines/foundations/typography.md +0 -82
  33. package/agent-tools/guidelines/overview-icons.md +0 -19
  34. package/agent-tools/guidelines/overview-illustrations.md +0 -7
  35. package/agent-tools/guidelines/overview-patterns.md +0 -7
  36. package/agent-tools/guidelines/overview.md +0 -84
  37. package/agent-tools/guidelines/setup.md +0 -83
  38. package/agent-tools/rules/accessibility.mdc +0 -78
  39. package/agent-tools/skills/gamut-accessibility/SKILL.md +0 -224
  40. package/agent-tools/skills/gamut-color-mode/SKILL.md +0 -149
  41. package/agent-tools/skills/gamut-components/SKILL.md +0 -46
  42. package/agent-tools/skills/gamut-forms/SKILL.md +0 -101
  43. package/agent-tools/skills/gamut-style-utilities/SKILL.md +0 -111
  44. package/agent-tools/skills/gamut-system-props/SKILL.md +0 -225
  45. package/agent-tools/skills/gamut-testing/SKILL.md +0 -225
  46. package/agent-tools/skills/gamut-theming/SKILL.md +0 -63
  47. package/agent-tools/skills/gamut-typography/SKILL.md +0 -79
  48. package/bin/commands/plugin/install.mjs +0 -213
  49. package/bin/commands/plugin/list.mjs +0 -73
  50. package/bin/commands/plugin/remove.mjs +0 -108
  51. package/bin/commands/plugin/update.mjs +0 -59
  52. package/bin/gamut.mjs +0 -96
  53. package/bin/lib/claude.mjs +0 -52
  54. package/bin/lib/cursor.mjs +0 -40
  55. package/bin/lib/design.mjs +0 -71
  56. package/bin/lib/io.mjs +0 -14
  57. package/bin/lib/resolve-plugin-dir.mjs +0 -38
  58. package/bin/lib/run-command.mjs +0 -22
  59. package/dist/InternalFloatingCard/InternalFloatingCard.js +0 -98
@@ -1,71 +0,0 @@
1
- import { copyFile, stat } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
-
4
- /** @type {Record<string, { sourceFile: string, label: string }>} */
5
- const THEME_ALIASES = {
6
- core: { sourceFile: 'DESIGN.Codecademy.md', label: 'Codecademy (Core)' },
7
- codecademy: {
8
- sourceFile: 'DESIGN.Codecademy.md',
9
- label: 'Codecademy (Core)',
10
- },
11
- cc: { sourceFile: 'DESIGN.Codecademy.md', label: 'Codecademy (Core)' },
12
- admin: { sourceFile: 'DESIGN.Codecademy.md', label: 'Codecademy (Admin)' },
13
- platform: {
14
- sourceFile: 'DESIGN.Codecademy.md',
15
- label: 'Codecademy (Platform)',
16
- },
17
- percipio: { sourceFile: 'DESIGN.Percipio.md', label: 'Percipio' },
18
- lxstudio: { sourceFile: 'DESIGN.LXStudio.md', label: 'LX Studio' },
19
- 'lx-studio': { sourceFile: 'DESIGN.LXStudio.md', label: 'LX Studio' },
20
- };
21
-
22
- const CANONICAL_THEMES = ['core', 'admin', 'platform', 'percipio', 'lxstudio'];
23
-
24
- /**
25
- * @param {string} name
26
- * @returns {{ sourceFile: string, label: string, alias: string }}
27
- */
28
- export function resolveTheme(name) {
29
- const alias = name.trim().toLowerCase();
30
- const entry = THEME_ALIASES[alias];
31
- if (!entry) {
32
- throw new Error(
33
- `Unknown theme: "${name}". Choose from: ${CANONICAL_THEMES.join(', ')} ` +
34
- `(aliases: codecademy, cc, lx-studio, …).`
35
- );
36
- }
37
- return { ...entry, alias };
38
- }
39
-
40
- /** @returns {string[]} */
41
- export function listCanonicalThemes() {
42
- return [...CANONICAL_THEMES];
43
- }
44
-
45
- /**
46
- * @param {string} sourceRoot agent-tools directory
47
- * @param {string} cwd destination directory (app repo root)
48
- * @param {string} theme
49
- * @param {{ force?: boolean }} [options]
50
- * @returns {Promise<{ dest: string, label: string }>}
51
- */
52
- export async function installDesignMd(sourceRoot, cwd, theme, options = {}) {
53
- const { sourceFile, label } = resolveTheme(theme);
54
- const src = join(sourceRoot, sourceFile);
55
- const dest = join(cwd, 'DESIGN.md');
56
-
57
- const srcStat = await stat(src).catch(() => null);
58
- if (!srcStat?.isFile()) {
59
- throw new Error(`DESIGN source not found: ${src}`);
60
- }
61
-
62
- const destStat = await stat(dest).catch(() => null);
63
- if (destStat?.isFile() && !options.force) {
64
- throw new Error(
65
- `DESIGN.md already exists at ${dest}. Use --force to overwrite, or remove it first.`
66
- );
67
- }
68
-
69
- await copyFile(src, dest);
70
- return { dest, label };
71
- }
package/bin/lib/io.mjs DELETED
@@ -1,14 +0,0 @@
1
- /** @param {string} message */
2
- export function log(message) {
3
- process.stdout.write(message.endsWith('\n') ? message : `${message}\n`);
4
- }
5
-
6
- /** @param {string} message */
7
- export function warn(message) {
8
- process.stderr.write(message.endsWith('\n') ? message : `${message}\n`);
9
- }
10
-
11
- /** @param {string} message */
12
- export function error(message) {
13
- process.stderr.write(message.endsWith('\n') ? message : `${message}\n`);
14
- }
@@ -1,38 +0,0 @@
1
- import { stat } from 'node:fs/promises';
2
- import { dirname, resolve } from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
-
5
- const __dirname = dirname(fileURLToPath(import.meta.url));
6
-
7
- /**
8
- * Returns the absolute path to the bundled agent-tools directory, or the
9
- * value of --plugin-dir if provided.
10
- *
11
- * @param {string[]} args
12
- * @returns {Promise<string>}
13
- */
14
- export async function resolvePluginDir(args) {
15
- const override = getFlag(args, '--plugin-dir');
16
- if (override) {
17
- const abs = resolve(override);
18
- const st = await stat(abs).catch(() => null);
19
- if (!st?.isDirectory()) {
20
- throw new Error(`--plugin-dir path not found: ${abs}`);
21
- }
22
- return abs;
23
- }
24
-
25
- // agent-tools/ is bundled at <package-root>/agent-tools/ relative to bin/lib/
26
- return resolve(__dirname, '..', '..', 'agent-tools');
27
- }
28
-
29
- /**
30
- * @param {string[]} argv
31
- * @param {string} flag
32
- * @param {string} [fallback]
33
- * @returns {string | undefined}
34
- */
35
- export function getFlag(argv, flag, fallback) {
36
- const idx = argv.indexOf(flag);
37
- return idx !== -1 ? argv[idx + 1] : fallback;
38
- }
@@ -1,22 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
-
3
- /**
4
- * Spawns an external command and returns its exit code.
5
- *
6
- * @param {string} command
7
- * @param {string[]} args
8
- * @returns {Promise<number>}
9
- */
10
- export function runCommand(command, args) {
11
- return new Promise((resolve, reject) => {
12
- const child = spawn(command, args, { stdio: 'inherit', shell: false });
13
- child.on('error', (/** @type {NodeJS.ErrnoException} */ err) => {
14
- if (err.code === 'ENOENT') {
15
- reject(new Error(`"${command}" not found on PATH. Is it installed?`));
16
- } else {
17
- reject(err);
18
- }
19
- });
20
- child.on('close', (code) => resolve(code ?? 1));
21
- });
22
- }
@@ -1,98 +0,0 @@
1
- import _styled from "@emotion/styled/base";
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- import { CheckerDense } from '@codecademy/gamut-patterns';
4
- import { styledOptions, system } from '@codecademy/gamut-styles';
5
- import { variance } from '@codecademy/variance';
6
- import { forwardRef } from 'react';
7
- import * as React from 'react';
8
- import { Box } from '../Box';
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- const cardProps = variance.compose(system.layout, system.padding);
11
- const beakVariants = system.variant({
12
- prop: 'beak',
13
- base: {
14
- p: 12,
15
- '&:after': {
16
- content: '""',
17
- width: '1.25rem',
18
- height: '1.25rem',
19
- bg: 'inherit',
20
- transform: 'rotate(45deg)',
21
- position: 'absolute',
22
- border: 1,
23
- borderStyleRight: 'none',
24
- borderStyleBottom: 'none'
25
- }
26
- },
27
- variants: {
28
- 'bottom-left': {
29
- '&:after': {
30
- bottom: 'calc(-0.625rem - 1px)',
31
- left: '1.5rem',
32
- transform: 'rotate(225deg)'
33
- }
34
- },
35
- 'bottom-right': {
36
- '&:after': {
37
- bottom: 'calc(-0.625rem - 1px)',
38
- right: '1.5rem',
39
- transform: 'rotate(225deg)'
40
- }
41
- },
42
- 'top-left': {
43
- '&:after': {
44
- top: 'calc(-0.625rem - 1px)',
45
- left: '1.5rem',
46
- transform: 'rotate(45deg)'
47
- }
48
- },
49
- 'top-right': {
50
- '&:after': {
51
- top: 'calc(-0.625rem - 1px)',
52
- right: '1.5rem',
53
- transform: 'rotate(45deg)'
54
- }
55
- }
56
- }
57
- });
58
- const CardBody = /*#__PURE__*/_styled('div', _extends({}, {
59
- target: "e14ubxlw0",
60
- label: "CardBody"
61
- }, styledOptions))(system.css({
62
- p: 12,
63
- zIndex: 1,
64
- position: 'relative',
65
- bg: 'background',
66
- border: 1,
67
- maxWidth: 1
68
- }), beakVariants, cardProps, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9JbnRlcm5hbEZsb2F0aW5nQ2FyZC9JbnRlcm5hbEZsb2F0aW5nQ2FyZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNERpQiIsImZpbGUiOiIuLi8uLi9zcmMvSW50ZXJuYWxGbG9hdGluZ0NhcmQvSW50ZXJuYWxGbG9hdGluZ0NhcmQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ2hlY2tlckRlbnNlLCBQYXR0ZXJuUHJvcHMgfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1wYXR0ZXJucyc7XG5pbXBvcnQgeyBzdHlsZWRPcHRpb25zLCBzeXN0ZW0gfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1zdHlsZXMnO1xuaW1wb3J0IHsgU3R5bGVQcm9wcywgdmFyaWFuY2UgfSBmcm9tICdAY29kZWNhZGVteS92YXJpYW5jZSc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBQcm9wZXJ0aWVzIH0gZnJvbSAnY3NzdHlwZSc7XG5pbXBvcnQgeyBDb21wb25lbnRQcm9wcywgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCAqIGFzIFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgQm94IH0gZnJvbSAnLi4vQm94JztcblxuY29uc3Q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XCJcbiAgICAgICAgcmlnaHQ9e3NoYWRvdyA9PT0gJ2JvdHRvbVJpZ2h0JyA/ICctMC41cmVtJyA6IHVuZGVmaW5lZH1cbiAgICAgICAgdG9wPVwiMC41cmVtXCJcbiAgICAgIC8+XG4gICAgICA8Q2FyZEJvZHkgY2xhc3NOYW1lPXtjbGFzc05hbWV9IHsuLi5yZXN0fSByZWY9e3JlZn0+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvQ2FyZEJvZHk+XG4gICAgPC9Cb3g+XG4gIClcbik7XG4iXX0= */");
69
- /**
70
- * @deprecated
71
- * This component is strictly for internal Gamut usage.
72
- * Please use the `Card` component instead.
73
- */
74
- export const InternalFloatingCard = /*#__PURE__*/forwardRef(({
75
- children,
76
- className,
77
- pattern: Pattern = CheckerDense,
78
- shadow = 'bottomLeft',
79
- containerDisplay = 'inline-block',
80
- ...rest
81
- }, ref) => /*#__PURE__*/_jsxs(Box, {
82
- display: containerDisplay,
83
- maxWidth: "100%",
84
- position: "relative",
85
- zIndex: 1,
86
- children: [/*#__PURE__*/_jsx(Pattern, {
87
- dimensions: 1,
88
- left: shadow === 'bottomLeft' ? '-0.5rem' : undefined,
89
- position: "absolute",
90
- right: shadow === 'bottomRight' ? '-0.5rem' : undefined,
91
- top: "0.5rem"
92
- }), /*#__PURE__*/_jsx(CardBody, {
93
- className: className,
94
- ...rest,
95
- ref: ref,
96
- children: children
97
- })]
98
- }));