diff --git a/.claude/rules/vue-components.md b/.claude/rules/vue-components.md index 581d967f06..82d886f998 100644 --- a/.claude/rules/vue-components.md +++ b/.claude/rules/vue-components.md @@ -7,7 +7,7 @@ paths: ## API Style -- **New components**: Composition API with ` diff --git a/apps/dialtone-documentation/docs/scratch.md b/apps/dialtone-documentation/docs/scratch.md index 0191836dd9..1be4fdb42c 100644 --- a/apps/dialtone-documentation/docs/scratch.md +++ b/apps/dialtone-documentation/docs/scratch.md @@ -2,7 +2,237 @@ layout: Blank --- - + + + + Size + + 100 + 200 + 300 + + + + Density + + 100 + 200 + 300 + + + + + +

Heading Level 1 small text

+

This is a standard paragraph of body text. It contains enough words to wrap across multiple lines so you can evaluate line height, measure, and paragraph spacing. Good typography makes content easier to read and understand.

+

This is another standard paragraph of body text.

+

Heading Level 2 small text

+

This is a standard paragraph of body text. It contains enough words to wrap across multiple lines so you can evaluate line height, measure, and paragraph spacing. Good typography makes content easier to read and understand.

+

Heading Level 3 small text

+

This is a standard paragraph of body text. It contains enough words to wrap across multiple lines so you can evaluate line height, measure, and paragraph spacing. Good typography makes content easier to read and understand.

+

Heading Level 4 small text

+

This is a standard paragraph of body text. It contains enough words to wrap across multiple lines so you can evaluate line height, measure, and paragraph spacing. Good typography makes content easier to read and understand.

+
Heading Level 5 small text
+

This is a standard paragraph of body text. It contains enough words to wrap across multiple lines so you can evaluate line height, measure, and paragraph spacing. Good typography makes content easier to read and understand.

+
Heading Level 6 small text
+ +

This is a standard paragraph of body text. It contains enough words to wrap across multiple lines so you can evaluate line height, measure, and paragraph spacing. Good typography makes content easier to read and understand.

+

This second paragraph tests spacing between consecutive paragraphs. It also contains bold text, italic text, bold italic text, and underlined text. Here is strikethrough text for deleted content.

+

Inline elements: inline code, Ctrl + S keyboard input, highlighted text, small text, subscript and superscript, and abbr.

+

More inline elements: x = y + z for variables, Error: file not found for sample output, design token for defining terms, and an inline quotation with automatic quote marks. The formula is E = mc2 and water is H2O.

+

Edit tracking: This text has been removed and been added to show revision marks.

+ +

Here is a standard link within a paragraph. And here is a link with bold and em inside it.

+ +
+ +

Unordered List

+ + +

Ordered List

+
    +
  1. First step in a process
  2. +
  3. Second step with more detail to test line wrapping within ordered list items
  4. +
  5. Third step with a nested ordered list: +
      +
    1. Sub-step one
    2. +
    3. Sub-step two
    4. +
    +
  6. +
  7. Fourth step back at the top level
  8. +
+ +

Mixed List

+ + +

Blockquotes

+
+

This is a single-paragraph blockquote. It should be visually distinct from surrounding body text.

+
+
+

This is a multi-paragraph blockquote. The first paragraph introduces the idea.

+

The second paragraph continues the thought. Both paragraphs should sit inside the same blockquote styling.

+
+
+

Nested blockquote:

+
+

This is a blockquote inside a blockquote.

+
+
+
+

Good design is as little design as possible.

+
Dieter Rams, Ten Principles of Good Design
+
+ +

Code Blocks

+
// A plain code block
+return `Hello, ${name}!`;
+const message = greet('world');
+console.log(message);
+
<template>
+  <div class="container">
+    <h1>{{ title }}</h1>
+    <p>{{ description }}</p>
+  </div>
+</template>
+ +

Tables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Component API reference
PropertyTypeDefaultDescription
sizeString'md'Sets the size of the component
variantString'default'Sets the visual style variant
disabledBooleanfalseWhen true, prevents user interaction
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Token spacing scale
TokenValuePixels
--dt-size-3000.4rem4px
--dt-size-4000.8rem8px
--dt-size-5001.6rem16px
+ +

Definition List

+
+
Design token
+
A named value that represents a design decision, such as a color, spacing unit, or font size.
+
Component
+
A reusable UI element that encapsulates structure, style, and behavior.
+
Utility class
+
A single-purpose CSS class that applies one specific style rule.
+
+ +

Images

+ Standalone image outside of a figure + +
+ Placeholder image +
Figure 1: A placeholder image with a caption below it.
+
+ +

Details / Summary

+
+ Click to expand for more information +

This content is hidden by default and revealed when the user interacts with the summary element. It can contain any block-level content including paragraphs, lists, and code.

+
    +
  • Detail item one
  • +
  • Detail item two
  • +
+
+ +

Task List

+ + +

Long-Form Content Flow

+

This section tests how all the elements above flow together naturally, as they would in real documentation or article content.

+

When building with our design system, start by installing the package:

+
npm install @dialpad/dialtone
+

Then import the styles in your entry file:

+
import '@dialpad/dialtone/css';
+

You can now use any of the available utility classes. For example:

+ +
+

Note: Make sure your build pipeline is configured to process CSS imports before using utility classes in production.

+
+

For more details, see the installation guide or reach out to the team on Slack.

+
+
diff --git a/packages/dialtone-vue/components/prose/prose_constants.js b/packages/dialtone-vue/components/prose/prose_constants.js new file mode 100644 index 0000000000..a635898c03 --- /dev/null +++ b/packages/dialtone-vue/components/prose/prose_constants.js @@ -0,0 +1,37 @@ +export const PROSE_SIZE_MODIFIERS = { + 100: 'd-prose--size-100', + 200: 'd-prose--size-200', + 300: '', +}; + +export const PROSE_DENSITY_MODIFIERS = { + 100: 'd-prose--density-100', + 200: '', + 300: 'd-prose--density-300', +}; + +export const PROSE_DISALLOWED_ELEMENTS = [ + 'form', 'input', 'select', 'textarea', 'button', + 'fieldset', 'output', 'datalist', 'progress', 'meter', + 'optgroup', 'option', +]; + +export const PROSE_ALLOWED_ATTRIBUTES = { + _global: ['id', 'lang', 'dir', 'translate', 'title'], + a: ['href', 'target', 'rel', 'hreflang'], + img: ['src', 'alt', 'width', 'height', 'loading', 'decoding'], + th: ['scope', 'colspan', 'rowspan', 'headers'], + td: ['colspan', 'rowspan', 'headers'], + ol: ['start', 'reversed', 'type'], + blockquote: ['cite'], + q: ['cite'], + ins: ['cite'], + del: ['cite'], + time: ['datetime'], + abbr: ['title'], + input: ['type', 'checked', 'disabled'], + details: ['open'], + table: ['summary'], + col: ['span'], + colgroup: ['span'], +}; diff --git a/packages/dialtone-vue/components/prose/prose_default.story.vue b/packages/dialtone-vue/components/prose/prose_default.story.vue new file mode 100644 index 0000000000..6a8bc44d4b --- /dev/null +++ b/packages/dialtone-vue/components/prose/prose_default.story.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/packages/dialtone-vue/index.js b/packages/dialtone-vue/index.js index f27a14bbba..74c657f242 100644 --- a/packages/dialtone-vue/index.js +++ b/packages/dialtone-vue/index.js @@ -48,6 +48,7 @@ export * from './components/pagination'; export * from './components/popover'; export * from './components/progress_circle'; export * from './components/presence'; +export * from './components/prose'; export * from './components/radio'; export * from './components/radio_group'; export * from './components/rich_text_editor'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18aa8a008c..ff1763ac5b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1368,7 +1368,11 @@ packages: '@dialpad/i18n-goblin-core@1.1.0': resolution: {integrity: sha512-1hc4vItUk6via1ek/qDZPNyS6K8vjIJi6c3Adzf5etZVtzBR2q51oTORNhyUpt+Kdrnf/86VFY2o9DJ5p6rgZA==, tarball: https://npm.pkg.github.com/download/@dialpad/i18n-goblin-core/1.1.0/dcdb873663c071b4c9507d49eb3298a2e270513c} peerDependencies: + '@vue/composition-api': '*' vue: ^3.0.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true '@dialpad/i18n-goblin-services@1.2.0': resolution: {integrity: sha512-fWfp/HIaf3FOcNtxcw1TRzcbWOXOVqnd0W1hJ5REH9l8EW6ywvPjkIRgAUvKR6wmqQychPd7JbjD0Yv5NZ/dWg==, tarball: https://npm.pkg.github.com/download/@dialpad/i18n-goblin-services/1.2.0/01f4f4d88518e29cd7f34509dd464c58327048f1} @@ -16485,8 +16489,6 @@ snapshots: '@fluent/bundle': 0.17.1 fluent-vue: 3.7.2(@fluent/bundle@0.17.1)(vue@3.5.31(typescript@5.9.3)) vue: 3.5.31(typescript@5.9.3) - transitivePeerDependencies: - - '@vue/composition-api' '@dialpad/i18n-goblin-services@1.2.0': dependencies: