@kolkrabbi/kol-component 0.13.1 → 0.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.13.1",
3
+ "version": "0.14.1",
4
4
  "description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,22 +8,28 @@
8
8
  * whole point; a Tag with no handler is a Pill wearing the wrong name.
9
9
  * Badge — system status or a count.
10
10
  *
11
- * Defaults follow the standing laws: `subtle` (nothing defaults to outline
12
- * outline needs a stated reason) and `sm` (chip law). Both were wrong until
13
- * 2026-07-30 — the component defaulted outline/md, so every correct call site
14
- * had to pass both props explicitly.
11
+ * Defaults follow the standing laws: `primary` (the grey fill; nothing defaults
12
+ * to outline — outline needs a stated reason) and `sm` (chip law).
13
+ *
14
+ * Variant vocabulary joined Button's (user ruling 2026-07-30): `primary` is the
15
+ * grey/filled chip (was `subtle`), `secondary` is the outlined chip (was
16
+ * `outline`). The old names remain as deprecated aliases — same classes, no
17
+ * visual change at any call site.
15
18
  *
16
19
  * @param {Object} props
17
20
  * @param {string} props.children - Text content of the pill
18
- * @param {string} props.variant - Visual variant: 'subtle' | 'outline' | 'inverse' (default: 'subtle')
21
+ * @param {string} props.variant - Visual variant: 'primary' | 'secondary' | 'inverse' (deprecated aliases: 'subtle' → primary, 'outline' → secondary) (default: 'primary')
19
22
  * @param {string} props.size - Size variant: 'sm' | 'md' | 'lg' (default: 'sm')
20
23
  * @param {string} props.className - Additional classes for customization
21
24
  */
22
- const Pill = ({ children, variant = 'subtle', size = 'sm', className = '' }) => {
25
+ const Pill = ({ children, variant = 'primary', size = 'sm', className = '' }) => {
23
26
  const variantClasses = {
24
- outline: 'pill-outline',
27
+ primary: 'pill-subtle',
28
+ secondary: 'pill-outline',
29
+ inverse: 'pill-inverse',
30
+ /* deprecated aliases (pre-2026-07-30 vocabulary) */
25
31
  subtle: 'pill-subtle',
26
- inverse: 'pill-inverse'
32
+ outline: 'pill-outline'
27
33
  }
28
34
 
29
35
  const sizeClasses = {
@@ -62,7 +62,10 @@ const syntaxTheme = (foregroundToken = 80) => ({
62
62
  }
63
63
  })
64
64
 
65
- export default function CodeBlock({ children, code: codeProp, language: languageProp, filename: filenameProp, value }) {
65
+ /* `bare` (2026-07-30): highlight + chip + copy WITHOUT the framed chrome — for
66
+ * hosts that already own the frame (PreviewCard's Code tab sat a full
67
+ * CodeBlock frame inside the kol-doc-figure border: frame-in-frame). */
68
+ export default function CodeBlock({ children, code: codeProp, language: languageProp, filename: filenameProp, value, bare = false }) {
66
69
  const [copied, setCopied] = useState(false)
67
70
 
68
71
  const code = String(value?.code ?? codeProp ?? children ?? '')
@@ -80,8 +83,8 @@ export default function CodeBlock({ children, code: codeProp, language: language
80
83
  }
81
84
 
82
85
  return (
83
- <div className="kol-codeblock-wrapper">
84
- <div className="kol-codeblock">
86
+ <div className={bare ? '' : 'kol-codeblock-wrapper'}>
87
+ <div className={`kol-codeblock${bare ? ' kol-codeblock--bare' : ''}`}>
85
88
  {(filename || (language && language !== 'text')) && (
86
89
  <div className="kol-codeblock-filename">{filename || language}</div>
87
90
  )}