@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 +1 -1
- package/src/atoms/Pill.jsx +14 -8
- package/src/molecules/CodeBlock.jsx +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
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",
|
package/src/atoms/Pill.jsx
CHANGED
|
@@ -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: `
|
|
12
|
-
* outline needs a stated reason) and `sm` (chip law).
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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: '
|
|
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 = '
|
|
25
|
+
const Pill = ({ children, variant = 'primary', size = 'sm', className = '' }) => {
|
|
23
26
|
const variantClasses = {
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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=
|
|
84
|
-
<div className=
|
|
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
|
)}
|