@kolkrabbi/kol-component 0.13.0 → 0.14.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/package.json +1 -1
- package/src/atoms/Pill.jsx +14 -8
- package/src/molecules/CodeBlock.jsx +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
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 = {
|
|
@@ -3,6 +3,10 @@ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
|
|
|
3
3
|
import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism'
|
|
4
4
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
5
5
|
|
|
6
|
+
/* taxonomy-ok: molecule — nests <Icon> from @kolkrabbi/kol-icons (the copy
|
|
7
|
+
* affordance). The gate only counts kol-component nesting, so a molecule whose
|
|
8
|
+
* only KOL child lives in a sibling package reads as an atom to it. */
|
|
9
|
+
|
|
6
10
|
/**
|
|
7
11
|
* CodeBlock — REPLICATED from the elder reference
|
|
8
12
|
* (kol-website/packages/ui/src/molecules/CodeBlock.jsx, 2026-07-28 user
|