@takecasper/acuity-design-system 2.3.0 → 2.4.1
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/dist/components/Markdown/Markdown.d.ts +4 -4
- package/dist/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown/Markdown.styles.d.ts +117 -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 +48 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +7333 -7003
- package/dist/index.es.js.map +1 -1
- package/package.json +17 -13
|
@@ -5,10 +5,10 @@ export interface MarkdownProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* Renders question and instruction copy written in Markdown.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Content is styled by `getMarkdownContentStyles`, the same styles `MarkdownEditor` uses, so text
|
|
9
|
+
* looks the same in the editor and wherever it is shown. Text takes its colour from the container.
|
|
10
|
+
* Links always open in a new tab with `noopener` — content is authored per-institution, and a
|
|
11
|
+
* candidate mid-assessment must not be navigated away.
|
|
12
12
|
*/
|
|
13
13
|
export declare const Markdown: ({ content }: MarkdownProps) => import("react").JSX.Element;
|
|
14
14
|
export default Markdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown/Markdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown/Markdown.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,aAAkB,aAAa,gCAqBvD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -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: {
|
|
@@ -78,4 +81,118 @@ export declare const getMarkdownStyles: (theme: Theme) => {
|
|
|
78
81
|
p: number;
|
|
79
82
|
};
|
|
80
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* The one set of styles for Markdown content, shared by `Markdown` and `MarkdownEditor` so what
|
|
86
|
+
* people type in the editor looks exactly like what `Markdown` shows. Apply it to the element that
|
|
87
|
+
* contains the rendered tags; it styles the tags themselves (`h1`, `p`, `li`...), so nothing inside
|
|
88
|
+
* depends on MUI components or browser defaults. Text colour is inherited from the container.
|
|
89
|
+
*/
|
|
90
|
+
export declare const getMarkdownContentStyles: (theme: Theme) => {
|
|
91
|
+
fontFamily: string | (string & {});
|
|
92
|
+
'& h1': {
|
|
93
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
94
|
+
fontSize: string | undefined;
|
|
95
|
+
lineHeight: string | undefined;
|
|
96
|
+
fontFamily: import("csstype").Property.FontFamily | "Lato, sans-serif";
|
|
97
|
+
letterSpacing: "normal";
|
|
98
|
+
textAlign: "left";
|
|
99
|
+
m: 0;
|
|
100
|
+
};
|
|
101
|
+
'& h2': {
|
|
102
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
103
|
+
fontSize: string | undefined;
|
|
104
|
+
lineHeight: string | undefined;
|
|
105
|
+
fontFamily: import("csstype").Property.FontFamily | "Lato, sans-serif";
|
|
106
|
+
letterSpacing: "normal";
|
|
107
|
+
textAlign: "left";
|
|
108
|
+
m: 0;
|
|
109
|
+
};
|
|
110
|
+
'& h3': {
|
|
111
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
112
|
+
mt: string;
|
|
113
|
+
fontSize: string | undefined;
|
|
114
|
+
lineHeight: string | undefined;
|
|
115
|
+
fontFamily: import("csstype").Property.FontFamily | "Lato, sans-serif";
|
|
116
|
+
letterSpacing: "normal";
|
|
117
|
+
textAlign: "left";
|
|
118
|
+
m: 0;
|
|
119
|
+
};
|
|
120
|
+
'& h4': {
|
|
121
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
122
|
+
fontSize: string | undefined;
|
|
123
|
+
lineHeight: string | undefined;
|
|
124
|
+
fontFamily: import("csstype").Property.FontFamily | "Lato, sans-serif";
|
|
125
|
+
letterSpacing: "normal";
|
|
126
|
+
textAlign: "left";
|
|
127
|
+
m: 0;
|
|
128
|
+
};
|
|
129
|
+
'& h5': {
|
|
130
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
131
|
+
fontSize: string | undefined;
|
|
132
|
+
lineHeight: string | undefined;
|
|
133
|
+
fontFamily: import("csstype").Property.FontFamily | "Lato, sans-serif";
|
|
134
|
+
letterSpacing: "normal";
|
|
135
|
+
textAlign: "left";
|
|
136
|
+
m: 0;
|
|
137
|
+
};
|
|
138
|
+
'& h6': {
|
|
139
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
140
|
+
fontSize: string | undefined;
|
|
141
|
+
lineHeight: string | undefined;
|
|
142
|
+
fontFamily: import("csstype").Property.FontFamily | "Lato, sans-serif";
|
|
143
|
+
letterSpacing: "normal";
|
|
144
|
+
textAlign: "left";
|
|
145
|
+
m: 0;
|
|
146
|
+
};
|
|
147
|
+
'& p': {
|
|
148
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
149
|
+
letterSpacing: string;
|
|
150
|
+
textAlign: string;
|
|
151
|
+
wordBreak: string;
|
|
152
|
+
m: number;
|
|
153
|
+
mt: string;
|
|
154
|
+
fontSize: string | undefined;
|
|
155
|
+
lineHeight: string | undefined;
|
|
156
|
+
fontFamily: string | (string & {});
|
|
157
|
+
};
|
|
158
|
+
'& ul, & ol': {
|
|
159
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
160
|
+
textAlign: string;
|
|
161
|
+
m: number;
|
|
162
|
+
pl: string;
|
|
163
|
+
pr: number;
|
|
164
|
+
fontSize: string | undefined;
|
|
165
|
+
lineHeight: string | undefined;
|
|
166
|
+
fontFamily: string | (string & {});
|
|
167
|
+
};
|
|
168
|
+
'& ul': {
|
|
169
|
+
listStyleType: string;
|
|
170
|
+
pt: number;
|
|
171
|
+
pb: string;
|
|
172
|
+
};
|
|
173
|
+
'& ol': {
|
|
174
|
+
listStyleType: string;
|
|
175
|
+
mt: string;
|
|
176
|
+
pt: string;
|
|
177
|
+
pb: string;
|
|
178
|
+
};
|
|
179
|
+
'& li': {
|
|
180
|
+
display: string;
|
|
181
|
+
m: number;
|
|
182
|
+
p: number;
|
|
183
|
+
};
|
|
184
|
+
'& li > p': {
|
|
185
|
+
m: number;
|
|
186
|
+
};
|
|
187
|
+
'& a': {
|
|
188
|
+
color: string;
|
|
189
|
+
textDecoration: string;
|
|
190
|
+
};
|
|
191
|
+
'& strong': {
|
|
192
|
+
fontWeight: number | import("csstype").Property.FontWeight;
|
|
193
|
+
};
|
|
194
|
+
'& em': {
|
|
195
|
+
fontStyle: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
81
198
|
//# sourceMappingURL=Markdown.styles.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"Markdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown/Markdown.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAI3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqE5C,CAAC;AAkBH;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEpD,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;AAgFD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,+GAS5B,mBAAmB,gCAwNrB,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"}
|