@takecasper/acuity-design-system 2.2.1 → 2.4.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/README.md +25 -0
- package/dist/components/Markdown/Markdown.styles.d.ts +3 -0
- package/dist/components/Markdown/Markdown.styles.d.ts.map +1 -1
- package/dist/components/MarkdownEditor/MarkdownEditor.d.ts +49 -0
- package/dist/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -0
- package/dist/docs/storiesList.d.ts.map +1 -1
- package/dist/index.cjs +102 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +20009 -57102
- package/dist/index.es.js.map +1 -1
- package/package.json +31 -17
- package/dist/index.cjs.js +0 -1284
- package/dist/index.cjs.js.map +0 -1
package/README.md
CHANGED
|
@@ -39,6 +39,22 @@ Then run:
|
|
|
39
39
|
|
|
40
40
|
`npm install @takecasper/acuity-design-system`
|
|
41
41
|
|
|
42
|
+
The library is built to run on your app's React, MUI and Emotion rather than
|
|
43
|
+
bundling its own copies (one copy per page is required for React and for MUI
|
|
44
|
+
theming to work). Make sure these peer dependencies are installed in your app:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
npm install react react-dom @mui/material @mui/icons-material @mui/system @mui/utils @emotion/react @emotion/styled react-toastify
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Supported ranges: `react`/`react-dom` 18.2+ or 19, `@mui/*` 7, `@emotion/*` 11,
|
|
51
|
+
`react-toastify` 11. `@mui/x-data-grid` is bundled with the library, so it does
|
|
52
|
+
not need to be installed at runtime; it is an optional peer because the
|
|
53
|
+
`AcuityDataGrid` prop types reference it, so install it if you use that
|
|
54
|
+
component and want its props typed. `npm run smoke:consumer` installs the built package
|
|
55
|
+
into a throwaway project with a given React/MUI version and renders a component
|
|
56
|
+
with it (see `scripts/consumer-smoke.mjs`).
|
|
57
|
+
|
|
42
58
|
To get the newest version of the library, just run this command again.
|
|
43
59
|
|
|
44
60
|
To check for the newest releases, you can check the [npm page](https://www.npmjs.com/package/@takecasper/acuity-design-system/).
|
|
@@ -51,6 +67,15 @@ To use a component within your project, you can use a component like this:
|
|
|
51
67
|
|
|
52
68
|
`import { Button } from '@takecasper/acuity-design-system';`
|
|
53
69
|
|
|
70
|
+
Import the stylesheet once at your app's entry point:
|
|
71
|
+
|
|
72
|
+
`import '@takecasper/acuity-design-system/style.css';`
|
|
73
|
+
|
|
74
|
+
MUI-based components read the host MUI theme. To render them with the design
|
|
75
|
+
system's own theme, wrap them (or your app root) in `AcuityMuiThemeProvider`:
|
|
76
|
+
|
|
77
|
+
`import { AcuityMuiThemeProvider } from '@takecasper/acuity-design-system';`
|
|
78
|
+
|
|
54
79
|
## IDE Setup
|
|
55
80
|
|
|
56
81
|
### Quick Start
|
|
@@ -8,6 +8,9 @@ import { Theme } from '@mui/material';
|
|
|
8
8
|
* discarded and headings fall back to their MUI variant sizes. This is carried over
|
|
9
9
|
* as-is rather than fixed here, so TEX and the design system render identically —
|
|
10
10
|
* see the component's docs page.
|
|
11
|
+
*
|
|
12
|
+
* Every heading is left-aligned, lining up with the text below it. (TEX centred
|
|
13
|
+
* `h1`, `h2` and `h4`; the design system does not.)
|
|
11
14
|
*/
|
|
12
15
|
export declare const getMarkdownStyles: (theme: Theme) => {
|
|
13
16
|
h1: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown/Markdown.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC
|
|
1
|
+
{"version":3,"file":"Markdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown/Markdown.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqE5C,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
+
/** Text for the toolbar. English by default; pass translated text from the app. */
|
|
3
|
+
export interface MarkdownEditorLabels {
|
|
4
|
+
/** Accessible name of the toolbar. */
|
|
5
|
+
toolbar: string;
|
|
6
|
+
undo: string;
|
|
7
|
+
redo: string;
|
|
8
|
+
/** Accessible name of the paragraph/heading select. */
|
|
9
|
+
textStyle: string;
|
|
10
|
+
paragraph: string;
|
|
11
|
+
/** Option text for a heading level, e.g. "Heading 1". */
|
|
12
|
+
heading: (level: HeadingLevel) => string;
|
|
13
|
+
bold: string;
|
|
14
|
+
italic: string;
|
|
15
|
+
numberedList: string;
|
|
16
|
+
bulletedList: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultMarkdownEditorLabels: MarkdownEditorLabels;
|
|
19
|
+
export interface MarkdownEditorProps {
|
|
20
|
+
/** Id of the editable area. The label gets `label_<id>`. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Visible label above the editor. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** The text as Markdown. */
|
|
25
|
+
value: string;
|
|
26
|
+
/** Called with the new Markdown on every edit. */
|
|
27
|
+
onChange: (markdown: string) => void;
|
|
28
|
+
/** Ids of elements that describe the editor, such as shared help text. */
|
|
29
|
+
'aria-describedby'?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Fixed height of the toolbar and text box together (any CSS length). The text scrolls inside
|
|
32
|
+
* the box. Leave unset to let the box grow with its text, from a 300px minimum.
|
|
33
|
+
*/
|
|
34
|
+
height?: string | number;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** Toolbar text, merged over the English defaults. */
|
|
37
|
+
labels?: Partial<MarkdownEditorLabels>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A formatting editor that reads and writes Markdown: people see headings, bold and lists as they
|
|
41
|
+
* type, and the value stays a Markdown string. The toolbar matches the assessments question
|
|
42
|
+
* builder (undo, redo, paragraph and headings, bold, italic, numbered and bulleted lists).
|
|
43
|
+
*
|
|
44
|
+
* Only what plain Markdown can store is offered: strikethrough, underline, code and tables are
|
|
45
|
+
* switched off, including their keyboard shortcuts.
|
|
46
|
+
*/
|
|
47
|
+
export declare const MarkdownEditor: ({ id, label, value, onChange, "aria-describedby": ariaDescribedBy, height, disabled, labels: labelOverrides }: MarkdownEditorProps) => import("react").JSX.Element;
|
|
48
|
+
export default MarkdownEditor;
|
|
49
|
+
//# sourceMappingURL=MarkdownEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownEditor/MarkdownEditor.tsx"],"names":[],"mappings":"AAwBA,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAG1C,mFAAmF;AACnF,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,MAAM,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,2BAA2B,EAAE,oBAWzC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACxC;AA2ED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,+GAS5B,mBAAmB,gCAsOrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storiesList.d.ts","sourceRoot":"","sources":["../../src/docs/storiesList.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"storiesList.d.ts","sourceRoot":"","sources":["../../src/docs/storiesList.tsx"],"names":[],"mappings":";;;;;AAAA,wBAwSE"}
|